#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gdk.Structs.EventOwnerChange
(
EventOwnerChange(..) ,
newZeroEventOwnerChange ,
noEventOwnerChange ,
clearEventOwnerChangeOwner ,
#if ENABLE_OVERLOADING
eventOwnerChange_owner ,
#endif
getEventOwnerChangeOwner ,
setEventOwnerChangeOwner ,
#if ENABLE_OVERLOADING
eventOwnerChange_reason ,
#endif
getEventOwnerChangeReason ,
setEventOwnerChangeReason ,
#if ENABLE_OVERLOADING
eventOwnerChange_selection ,
#endif
getEventOwnerChangeSelection ,
#if ENABLE_OVERLOADING
eventOwnerChange_selectionTime ,
#endif
getEventOwnerChangeSelectionTime ,
setEventOwnerChangeSelectionTime ,
#if ENABLE_OVERLOADING
eventOwnerChange_sendEvent ,
#endif
getEventOwnerChangeSendEvent ,
setEventOwnerChangeSendEvent ,
#if ENABLE_OVERLOADING
eventOwnerChange_time ,
#endif
getEventOwnerChangeTime ,
setEventOwnerChangeTime ,
#if ENABLE_OVERLOADING
eventOwnerChange_type ,
#endif
getEventOwnerChangeType ,
setEventOwnerChangeType ,
clearEventOwnerChangeWindow ,
#if ENABLE_OVERLOADING
eventOwnerChange_window ,
#endif
getEventOwnerChangeWindow ,
setEventOwnerChangeWindow ,
) 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
import {-# SOURCE #-} qualified GI.Gdk.Structs.Atom as Gdk.Atom
newtype EventOwnerChange = EventOwnerChange (ManagedPtr EventOwnerChange)
instance WrappedPtr EventOwnerChange where
wrappedPtrCalloc = callocBytes 56
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 56 >=> wrapPtr EventOwnerChange)
wrappedPtrFree = Just ptr_to_g_free
newZeroEventOwnerChange :: MonadIO m => m EventOwnerChange
newZeroEventOwnerChange = liftIO $ wrappedPtrCalloc >>= wrapPtr EventOwnerChange
instance tag ~ 'AttrSet => Constructible EventOwnerChange tag where
new _ attrs = do
o <- newZeroEventOwnerChange
GI.Attributes.set o attrs
return o
noEventOwnerChange :: Maybe EventOwnerChange
noEventOwnerChange = Nothing
getEventOwnerChangeType :: MonadIO m => EventOwnerChange -> m Gdk.Enums.EventType
getEventOwnerChangeType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CInt
let val' = (toEnum . fromIntegral) val
return val'
setEventOwnerChangeType :: MonadIO m => EventOwnerChange -> Gdk.Enums.EventType -> m ()
setEventOwnerChangeType s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 0) (val' :: CInt)
#if ENABLE_OVERLOADING
data EventOwnerChangeTypeFieldInfo
instance AttrInfo EventOwnerChangeTypeFieldInfo where
type AttrAllowedOps EventOwnerChangeTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventOwnerChangeTypeFieldInfo = (~) Gdk.Enums.EventType
type AttrBaseTypeConstraint EventOwnerChangeTypeFieldInfo = (~) EventOwnerChange
type AttrGetType EventOwnerChangeTypeFieldInfo = Gdk.Enums.EventType
type AttrLabel EventOwnerChangeTypeFieldInfo = "type"
type AttrOrigin EventOwnerChangeTypeFieldInfo = EventOwnerChange
attrGet _ = getEventOwnerChangeType
attrSet _ = setEventOwnerChangeType
attrConstruct = undefined
attrClear _ = undefined
eventOwnerChange_type :: AttrLabelProxy "type"
eventOwnerChange_type = AttrLabelProxy
#endif
getEventOwnerChangeWindow :: MonadIO m => EventOwnerChange -> m (Maybe Gdk.Window.Window)
getEventOwnerChangeWindow 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
setEventOwnerChangeWindow :: MonadIO m => EventOwnerChange -> Ptr Gdk.Window.Window -> m ()
setEventOwnerChangeWindow s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Ptr Gdk.Window.Window)
clearEventOwnerChangeWindow :: MonadIO m => EventOwnerChange -> m ()
clearEventOwnerChangeWindow s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr Gdk.Window.Window)
#if ENABLE_OVERLOADING
data EventOwnerChangeWindowFieldInfo
instance AttrInfo EventOwnerChangeWindowFieldInfo where
type AttrAllowedOps EventOwnerChangeWindowFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EventOwnerChangeWindowFieldInfo = (~) (Ptr Gdk.Window.Window)
type AttrBaseTypeConstraint EventOwnerChangeWindowFieldInfo = (~) EventOwnerChange
type AttrGetType EventOwnerChangeWindowFieldInfo = Maybe Gdk.Window.Window
type AttrLabel EventOwnerChangeWindowFieldInfo = "window"
type AttrOrigin EventOwnerChangeWindowFieldInfo = EventOwnerChange
attrGet _ = getEventOwnerChangeWindow
attrSet _ = setEventOwnerChangeWindow
attrConstruct = undefined
attrClear _ = clearEventOwnerChangeWindow
eventOwnerChange_window :: AttrLabelProxy "window"
eventOwnerChange_window = AttrLabelProxy
#endif
getEventOwnerChangeSendEvent :: MonadIO m => EventOwnerChange -> m Int8
getEventOwnerChangeSendEvent s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Int8
return val
setEventOwnerChangeSendEvent :: MonadIO m => EventOwnerChange -> Int8 -> m ()
setEventOwnerChangeSendEvent s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Int8)
#if ENABLE_OVERLOADING
data EventOwnerChangeSendEventFieldInfo
instance AttrInfo EventOwnerChangeSendEventFieldInfo where
type AttrAllowedOps EventOwnerChangeSendEventFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventOwnerChangeSendEventFieldInfo = (~) Int8
type AttrBaseTypeConstraint EventOwnerChangeSendEventFieldInfo = (~) EventOwnerChange
type AttrGetType EventOwnerChangeSendEventFieldInfo = Int8
type AttrLabel EventOwnerChangeSendEventFieldInfo = "send_event"
type AttrOrigin EventOwnerChangeSendEventFieldInfo = EventOwnerChange
attrGet _ = getEventOwnerChangeSendEvent
attrSet _ = setEventOwnerChangeSendEvent
attrConstruct = undefined
attrClear _ = undefined
eventOwnerChange_sendEvent :: AttrLabelProxy "sendEvent"
eventOwnerChange_sendEvent = AttrLabelProxy
#endif
getEventOwnerChangeOwner :: MonadIO m => EventOwnerChange -> m (Maybe Gdk.Window.Window)
getEventOwnerChangeOwner s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO (Ptr Gdk.Window.Window)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newObject Gdk.Window.Window) val'
return val''
return result
setEventOwnerChangeOwner :: MonadIO m => EventOwnerChange -> Ptr Gdk.Window.Window -> m ()
setEventOwnerChangeOwner s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Ptr Gdk.Window.Window)
clearEventOwnerChangeOwner :: MonadIO m => EventOwnerChange -> m ()
clearEventOwnerChangeOwner s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: Ptr Gdk.Window.Window)
#if ENABLE_OVERLOADING
data EventOwnerChangeOwnerFieldInfo
instance AttrInfo EventOwnerChangeOwnerFieldInfo where
type AttrAllowedOps EventOwnerChangeOwnerFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EventOwnerChangeOwnerFieldInfo = (~) (Ptr Gdk.Window.Window)
type AttrBaseTypeConstraint EventOwnerChangeOwnerFieldInfo = (~) EventOwnerChange
type AttrGetType EventOwnerChangeOwnerFieldInfo = Maybe Gdk.Window.Window
type AttrLabel EventOwnerChangeOwnerFieldInfo = "owner"
type AttrOrigin EventOwnerChangeOwnerFieldInfo = EventOwnerChange
attrGet _ = getEventOwnerChangeOwner
attrSet _ = setEventOwnerChangeOwner
attrConstruct = undefined
attrClear _ = clearEventOwnerChangeOwner
eventOwnerChange_owner :: AttrLabelProxy "owner"
eventOwnerChange_owner = AttrLabelProxy
#endif
getEventOwnerChangeReason :: MonadIO m => EventOwnerChange -> m Gdk.Enums.OwnerChange
getEventOwnerChangeReason s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
setEventOwnerChangeReason :: MonadIO m => EventOwnerChange -> Gdk.Enums.OwnerChange -> m ()
setEventOwnerChangeReason s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 32) (val' :: CUInt)
#if ENABLE_OVERLOADING
data EventOwnerChangeReasonFieldInfo
instance AttrInfo EventOwnerChangeReasonFieldInfo where
type AttrAllowedOps EventOwnerChangeReasonFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventOwnerChangeReasonFieldInfo = (~) Gdk.Enums.OwnerChange
type AttrBaseTypeConstraint EventOwnerChangeReasonFieldInfo = (~) EventOwnerChange
type AttrGetType EventOwnerChangeReasonFieldInfo = Gdk.Enums.OwnerChange
type AttrLabel EventOwnerChangeReasonFieldInfo = "reason"
type AttrOrigin EventOwnerChangeReasonFieldInfo = EventOwnerChange
attrGet _ = getEventOwnerChangeReason
attrSet _ = setEventOwnerChangeReason
attrConstruct = undefined
attrClear _ = undefined
eventOwnerChange_reason :: AttrLabelProxy "reason"
eventOwnerChange_reason = AttrLabelProxy
#endif
getEventOwnerChangeSelection :: MonadIO m => EventOwnerChange -> m Gdk.Atom.Atom
getEventOwnerChangeSelection s = liftIO $ withManagedPtr s $ \ptr -> do
let val = ptr `plusPtr` 40 :: (Ptr Gdk.Atom.Atom)
val' <- (newPtr Gdk.Atom.Atom) val
return val'
#if ENABLE_OVERLOADING
data EventOwnerChangeSelectionFieldInfo
instance AttrInfo EventOwnerChangeSelectionFieldInfo where
type AttrAllowedOps EventOwnerChangeSelectionFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint EventOwnerChangeSelectionFieldInfo = (~) (Ptr Gdk.Atom.Atom)
type AttrBaseTypeConstraint EventOwnerChangeSelectionFieldInfo = (~) EventOwnerChange
type AttrGetType EventOwnerChangeSelectionFieldInfo = Gdk.Atom.Atom
type AttrLabel EventOwnerChangeSelectionFieldInfo = "selection"
type AttrOrigin EventOwnerChangeSelectionFieldInfo = EventOwnerChange
attrGet _ = getEventOwnerChangeSelection
attrSet _ = undefined
attrConstruct = undefined
attrClear _ = undefined
eventOwnerChange_selection :: AttrLabelProxy "selection"
eventOwnerChange_selection = AttrLabelProxy
#endif
getEventOwnerChangeTime :: MonadIO m => EventOwnerChange -> m Word32
getEventOwnerChangeTime s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 48) :: IO Word32
return val
setEventOwnerChangeTime :: MonadIO m => EventOwnerChange -> Word32 -> m ()
setEventOwnerChangeTime s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 48) (val :: Word32)
#if ENABLE_OVERLOADING
data EventOwnerChangeTimeFieldInfo
instance AttrInfo EventOwnerChangeTimeFieldInfo where
type AttrAllowedOps EventOwnerChangeTimeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventOwnerChangeTimeFieldInfo = (~) Word32
type AttrBaseTypeConstraint EventOwnerChangeTimeFieldInfo = (~) EventOwnerChange
type AttrGetType EventOwnerChangeTimeFieldInfo = Word32
type AttrLabel EventOwnerChangeTimeFieldInfo = "time"
type AttrOrigin EventOwnerChangeTimeFieldInfo = EventOwnerChange
attrGet _ = getEventOwnerChangeTime
attrSet _ = setEventOwnerChangeTime
attrConstruct = undefined
attrClear _ = undefined
eventOwnerChange_time :: AttrLabelProxy "time"
eventOwnerChange_time = AttrLabelProxy
#endif
getEventOwnerChangeSelectionTime :: MonadIO m => EventOwnerChange -> m Word32
getEventOwnerChangeSelectionTime s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 52) :: IO Word32
return val
setEventOwnerChangeSelectionTime :: MonadIO m => EventOwnerChange -> Word32 -> m ()
setEventOwnerChangeSelectionTime s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 52) (val :: Word32)
#if ENABLE_OVERLOADING
data EventOwnerChangeSelectionTimeFieldInfo
instance AttrInfo EventOwnerChangeSelectionTimeFieldInfo where
type AttrAllowedOps EventOwnerChangeSelectionTimeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventOwnerChangeSelectionTimeFieldInfo = (~) Word32
type AttrBaseTypeConstraint EventOwnerChangeSelectionTimeFieldInfo = (~) EventOwnerChange
type AttrGetType EventOwnerChangeSelectionTimeFieldInfo = Word32
type AttrLabel EventOwnerChangeSelectionTimeFieldInfo = "selection_time"
type AttrOrigin EventOwnerChangeSelectionTimeFieldInfo = EventOwnerChange
attrGet _ = getEventOwnerChangeSelectionTime
attrSet _ = setEventOwnerChangeSelectionTime
attrConstruct = undefined
attrClear _ = undefined
eventOwnerChange_selectionTime :: AttrLabelProxy "selectionTime"
eventOwnerChange_selectionTime = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList EventOwnerChange
type instance O.AttributeList EventOwnerChange = EventOwnerChangeAttributeList
type EventOwnerChangeAttributeList = ('[ '("type", EventOwnerChangeTypeFieldInfo), '("window", EventOwnerChangeWindowFieldInfo), '("sendEvent", EventOwnerChangeSendEventFieldInfo), '("owner", EventOwnerChangeOwnerFieldInfo), '("reason", EventOwnerChangeReasonFieldInfo), '("selection", EventOwnerChangeSelectionFieldInfo), '("time", EventOwnerChangeTimeFieldInfo), '("selectionTime", EventOwnerChangeSelectionTimeFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveEventOwnerChangeMethod (t :: Symbol) (o :: *) :: * where
ResolveEventOwnerChangeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEventOwnerChangeMethod t EventOwnerChange, O.MethodInfo info EventOwnerChange p) => OL.IsLabel t (EventOwnerChange -> 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