#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gdk.Structs.EventVisibility
(
EventVisibility(..) ,
newZeroEventVisibility ,
noEventVisibility ,
#if ENABLE_OVERLOADING
eventVisibility_sendEvent ,
#endif
getEventVisibilitySendEvent ,
setEventVisibilitySendEvent ,
#if ENABLE_OVERLOADING
eventVisibility_state ,
#endif
getEventVisibilityState ,
setEventVisibilityState ,
#if ENABLE_OVERLOADING
eventVisibility_type ,
#endif
getEventVisibilityType ,
setEventVisibilityType ,
clearEventVisibilityWindow ,
#if ENABLE_OVERLOADING
eventVisibility_window ,
#endif
getEventVisibilityWindow ,
setEventVisibilityWindow ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Objects.Window as Gdk.Window
newtype EventVisibility = EventVisibility (ManagedPtr EventVisibility)
instance WrappedPtr EventVisibility where
wrappedPtrCalloc = callocBytes 24
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 24 >=> wrapPtr EventVisibility)
wrappedPtrFree = Just ptr_to_g_free
newZeroEventVisibility :: MonadIO m => m EventVisibility
newZeroEventVisibility = liftIO $ wrappedPtrCalloc >>= wrapPtr EventVisibility
instance tag ~ 'AttrSet => Constructible EventVisibility tag where
new _ attrs = do
o <- newZeroEventVisibility
GI.Attributes.set o attrs
return o
noEventVisibility :: Maybe EventVisibility
noEventVisibility = Nothing
getEventVisibilityType :: MonadIO m => EventVisibility -> m Gdk.Enums.EventType
getEventVisibilityType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CInt
let val' = (toEnum . fromIntegral) val
return val'
setEventVisibilityType :: MonadIO m => EventVisibility -> Gdk.Enums.EventType -> m ()
setEventVisibilityType s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 0) (val' :: CInt)
#if ENABLE_OVERLOADING
data EventVisibilityTypeFieldInfo
instance AttrInfo EventVisibilityTypeFieldInfo where
type AttrAllowedOps EventVisibilityTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventVisibilityTypeFieldInfo = (~) Gdk.Enums.EventType
type AttrBaseTypeConstraint EventVisibilityTypeFieldInfo = (~) EventVisibility
type AttrGetType EventVisibilityTypeFieldInfo = Gdk.Enums.EventType
type AttrLabel EventVisibilityTypeFieldInfo = "type"
type AttrOrigin EventVisibilityTypeFieldInfo = EventVisibility
attrGet _ = getEventVisibilityType
attrSet _ = setEventVisibilityType
attrConstruct = undefined
attrClear _ = undefined
eventVisibility_type :: AttrLabelProxy "type"
eventVisibility_type = AttrLabelProxy
#endif
getEventVisibilityWindow :: MonadIO m => EventVisibility -> m (Maybe Gdk.Window.Window)
getEventVisibilityWindow s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (Ptr Gdk.Window.Window)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newObject Gdk.Window.Window) val'
return val''
return result
setEventVisibilityWindow :: MonadIO m => EventVisibility -> Ptr Gdk.Window.Window -> m ()
setEventVisibilityWindow s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Ptr Gdk.Window.Window)
clearEventVisibilityWindow :: MonadIO m => EventVisibility -> m ()
clearEventVisibilityWindow s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr Gdk.Window.Window)
#if ENABLE_OVERLOADING
data EventVisibilityWindowFieldInfo
instance AttrInfo EventVisibilityWindowFieldInfo where
type AttrAllowedOps EventVisibilityWindowFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EventVisibilityWindowFieldInfo = (~) (Ptr Gdk.Window.Window)
type AttrBaseTypeConstraint EventVisibilityWindowFieldInfo = (~) EventVisibility
type AttrGetType EventVisibilityWindowFieldInfo = Maybe Gdk.Window.Window
type AttrLabel EventVisibilityWindowFieldInfo = "window"
type AttrOrigin EventVisibilityWindowFieldInfo = EventVisibility
attrGet _ = getEventVisibilityWindow
attrSet _ = setEventVisibilityWindow
attrConstruct = undefined
attrClear _ = clearEventVisibilityWindow
eventVisibility_window :: AttrLabelProxy "window"
eventVisibility_window = AttrLabelProxy
#endif
getEventVisibilitySendEvent :: MonadIO m => EventVisibility -> m Int8
getEventVisibilitySendEvent s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Int8
return val
setEventVisibilitySendEvent :: MonadIO m => EventVisibility -> Int8 -> m ()
setEventVisibilitySendEvent s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Int8)
#if ENABLE_OVERLOADING
data EventVisibilitySendEventFieldInfo
instance AttrInfo EventVisibilitySendEventFieldInfo where
type AttrAllowedOps EventVisibilitySendEventFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventVisibilitySendEventFieldInfo = (~) Int8
type AttrBaseTypeConstraint EventVisibilitySendEventFieldInfo = (~) EventVisibility
type AttrGetType EventVisibilitySendEventFieldInfo = Int8
type AttrLabel EventVisibilitySendEventFieldInfo = "send_event"
type AttrOrigin EventVisibilitySendEventFieldInfo = EventVisibility
attrGet _ = getEventVisibilitySendEvent
attrSet _ = setEventVisibilitySendEvent
attrConstruct = undefined
attrClear _ = undefined
eventVisibility_sendEvent :: AttrLabelProxy "sendEvent"
eventVisibility_sendEvent = AttrLabelProxy
#endif
getEventVisibilityState :: MonadIO m => EventVisibility -> m Gdk.Enums.VisibilityState
getEventVisibilityState s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 20) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
setEventVisibilityState :: MonadIO m => EventVisibility -> Gdk.Enums.VisibilityState -> m ()
setEventVisibilityState s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 20) (val' :: CUInt)
#if ENABLE_OVERLOADING
data EventVisibilityStateFieldInfo
instance AttrInfo EventVisibilityStateFieldInfo where
type AttrAllowedOps EventVisibilityStateFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventVisibilityStateFieldInfo = (~) Gdk.Enums.VisibilityState
type AttrBaseTypeConstraint EventVisibilityStateFieldInfo = (~) EventVisibility
type AttrGetType EventVisibilityStateFieldInfo = Gdk.Enums.VisibilityState
type AttrLabel EventVisibilityStateFieldInfo = "state"
type AttrOrigin EventVisibilityStateFieldInfo = EventVisibility
attrGet _ = getEventVisibilityState
attrSet _ = setEventVisibilityState
attrConstruct = undefined
attrClear _ = undefined
eventVisibility_state :: AttrLabelProxy "state"
eventVisibility_state = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList EventVisibility
type instance O.AttributeList EventVisibility = EventVisibilityAttributeList
type EventVisibilityAttributeList = ('[ '("type", EventVisibilityTypeFieldInfo), '("window", EventVisibilityWindowFieldInfo), '("sendEvent", EventVisibilitySendEventFieldInfo), '("state", EventVisibilityStateFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveEventVisibilityMethod (t :: Symbol) (o :: *) :: * where
ResolveEventVisibilityMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEventVisibilityMethod t EventVisibility, O.MethodInfo info EventVisibility p) => OL.IsLabel t (EventVisibility -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif