module GI.Gdk.Structs.EventFocus
(
EventFocus(..) ,
newZeroEventFocus ,
noEventFocus ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
eventFocus_in ,
#endif
getEventFocusIn ,
setEventFocusIn ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
eventFocus_sendEvent ,
#endif
getEventFocusSendEvent ,
setEventFocusSendEvent ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
eventFocus_type ,
#endif
getEventFocusType ,
setEventFocusType ,
clearEventFocusWindow ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
eventFocus_window ,
#endif
getEventFocusWindow ,
setEventFocusWindow ,
) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.Gdk.Enums as Gdk.Enums
import qualified GI.Gdk.Objects.Window as Gdk.Window
newtype EventFocus = EventFocus (ManagedPtr EventFocus)
instance WrappedPtr EventFocus where
wrappedPtrCalloc = callocBytes 24
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 24 >=> wrapPtr EventFocus)
wrappedPtrFree = Just ptr_to_g_free
newZeroEventFocus :: MonadIO m => m EventFocus
newZeroEventFocus = liftIO $ wrappedPtrCalloc >>= wrapPtr EventFocus
instance tag ~ 'AttrSet => Constructible EventFocus tag where
new _ attrs = do
o <- newZeroEventFocus
GI.Attributes.set o attrs
return o
noEventFocus :: Maybe EventFocus
noEventFocus = Nothing
getEventFocusType :: MonadIO m => EventFocus -> m Gdk.Enums.EventType
getEventFocusType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
setEventFocusType :: MonadIO m => EventFocus -> Gdk.Enums.EventType -> m ()
setEventFocusType s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 0) (val' :: CUInt)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data EventFocusTypeFieldInfo
instance AttrInfo EventFocusTypeFieldInfo where
type AttrAllowedOps EventFocusTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventFocusTypeFieldInfo = (~) Gdk.Enums.EventType
type AttrBaseTypeConstraint EventFocusTypeFieldInfo = (~) EventFocus
type AttrGetType EventFocusTypeFieldInfo = Gdk.Enums.EventType
type AttrLabel EventFocusTypeFieldInfo = "type"
type AttrOrigin EventFocusTypeFieldInfo = EventFocus
attrGet _ = getEventFocusType
attrSet _ = setEventFocusType
attrConstruct = undefined
attrClear _ = undefined
eventFocus_type :: AttrLabelProxy "type"
eventFocus_type = AttrLabelProxy
#endif
getEventFocusWindow :: MonadIO m => EventFocus -> m (Maybe Gdk.Window.Window)
getEventFocusWindow 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
setEventFocusWindow :: MonadIO m => EventFocus -> Ptr Gdk.Window.Window -> m ()
setEventFocusWindow s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Ptr Gdk.Window.Window)
clearEventFocusWindow :: MonadIO m => EventFocus -> m ()
clearEventFocusWindow s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr Gdk.Window.Window)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data EventFocusWindowFieldInfo
instance AttrInfo EventFocusWindowFieldInfo where
type AttrAllowedOps EventFocusWindowFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EventFocusWindowFieldInfo = (~) (Ptr Gdk.Window.Window)
type AttrBaseTypeConstraint EventFocusWindowFieldInfo = (~) EventFocus
type AttrGetType EventFocusWindowFieldInfo = Maybe Gdk.Window.Window
type AttrLabel EventFocusWindowFieldInfo = "window"
type AttrOrigin EventFocusWindowFieldInfo = EventFocus
attrGet _ = getEventFocusWindow
attrSet _ = setEventFocusWindow
attrConstruct = undefined
attrClear _ = clearEventFocusWindow
eventFocus_window :: AttrLabelProxy "window"
eventFocus_window = AttrLabelProxy
#endif
getEventFocusSendEvent :: MonadIO m => EventFocus -> m Int8
getEventFocusSendEvent s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Int8
return val
setEventFocusSendEvent :: MonadIO m => EventFocus -> Int8 -> m ()
setEventFocusSendEvent s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Int8)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data EventFocusSendEventFieldInfo
instance AttrInfo EventFocusSendEventFieldInfo where
type AttrAllowedOps EventFocusSendEventFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventFocusSendEventFieldInfo = (~) Int8
type AttrBaseTypeConstraint EventFocusSendEventFieldInfo = (~) EventFocus
type AttrGetType EventFocusSendEventFieldInfo = Int8
type AttrLabel EventFocusSendEventFieldInfo = "send_event"
type AttrOrigin EventFocusSendEventFieldInfo = EventFocus
attrGet _ = getEventFocusSendEvent
attrSet _ = setEventFocusSendEvent
attrConstruct = undefined
attrClear _ = undefined
eventFocus_sendEvent :: AttrLabelProxy "sendEvent"
eventFocus_sendEvent = AttrLabelProxy
#endif
getEventFocusIn :: MonadIO m => EventFocus -> m Int16
getEventFocusIn s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 18) :: IO Int16
return val
setEventFocusIn :: MonadIO m => EventFocus -> Int16 -> m ()
setEventFocusIn s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 18) (val :: Int16)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data EventFocusInFieldInfo
instance AttrInfo EventFocusInFieldInfo where
type AttrAllowedOps EventFocusInFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EventFocusInFieldInfo = (~) Int16
type AttrBaseTypeConstraint EventFocusInFieldInfo = (~) EventFocus
type AttrGetType EventFocusInFieldInfo = Int16
type AttrLabel EventFocusInFieldInfo = "in"
type AttrOrigin EventFocusInFieldInfo = EventFocus
attrGet _ = getEventFocusIn
attrSet _ = setEventFocusIn
attrConstruct = undefined
attrClear _ = undefined
eventFocus_in :: AttrLabelProxy "in"
eventFocus_in = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList EventFocus
type instance O.AttributeList EventFocus = EventFocusAttributeList
type EventFocusAttributeList = ('[ '("type", EventFocusTypeFieldInfo), '("window", EventFocusWindowFieldInfo), '("sendEvent", EventFocusSendEventFieldInfo), '("in", EventFocusInFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveEventFocusMethod (t :: Symbol) (o :: *) :: * where
ResolveEventFocusMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEventFocusMethod t EventFocus, O.MethodInfo info EventFocus p) => O.IsLabelProxy t (EventFocus -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveEventFocusMethod t EventFocus, O.MethodInfo info EventFocus p) => O.IsLabel t (EventFocus -> 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
#endif