{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.DrawContext
(
DrawContext(..) ,
IsDrawContext ,
toDrawContext ,
#if defined(ENABLE_OVERLOADING)
ResolveDrawContextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DrawContextBeginFrameMethodInfo ,
#endif
drawContextBeginFrame ,
#if defined(ENABLE_OVERLOADING)
DrawContextEndFrameMethodInfo ,
#endif
drawContextEndFrame ,
#if defined(ENABLE_OVERLOADING)
DrawContextGetDisplayMethodInfo ,
#endif
drawContextGetDisplay ,
#if defined(ENABLE_OVERLOADING)
DrawContextGetFrameRegionMethodInfo ,
#endif
drawContextGetFrameRegion ,
#if defined(ENABLE_OVERLOADING)
DrawContextGetSurfaceMethodInfo ,
#endif
drawContextGetSurface ,
#if defined(ENABLE_OVERLOADING)
DrawContextIsInFrameMethodInfo ,
#endif
drawContextIsInFrame ,
#if defined(ENABLE_OVERLOADING)
DrawContextDisplayPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
drawContextDisplay ,
#endif
getDrawContextDisplay ,
#if defined(ENABLE_OVERLOADING)
DrawContextSurfacePropertyInfo ,
#endif
constructDrawContextSurface ,
#if defined(ENABLE_OVERLOADING)
drawContextSurface ,
#endif
getDrawContextSurface ,
) 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.BasicTypes as B.Types
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
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 qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
newtype DrawContext = DrawContext (SP.ManagedPtr DrawContext)
deriving (DrawContext -> DrawContext -> Bool
(DrawContext -> DrawContext -> Bool)
-> (DrawContext -> DrawContext -> Bool) -> Eq DrawContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DrawContext -> DrawContext -> Bool
$c/= :: DrawContext -> DrawContext -> Bool
== :: DrawContext -> DrawContext -> Bool
$c== :: DrawContext -> DrawContext -> Bool
Eq)
instance SP.ManagedPtrNewtype DrawContext where
toManagedPtr :: DrawContext -> ManagedPtr DrawContext
toManagedPtr (DrawContext ManagedPtr DrawContext
p) = ManagedPtr DrawContext
p
foreign import ccall "gdk_draw_context_get_type"
c_gdk_draw_context_get_type :: IO B.Types.GType
instance B.Types.TypedObject DrawContext where
glibType :: IO GType
glibType = IO GType
c_gdk_draw_context_get_type
instance B.Types.GObject DrawContext
instance B.GValue.IsGValue DrawContext where
toGValue :: DrawContext -> IO GValue
toGValue DrawContext
o = do
GType
gtype <- IO GType
c_gdk_draw_context_get_type
DrawContext -> (Ptr DrawContext -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DrawContext
o (GType
-> (GValue -> Ptr DrawContext -> IO ())
-> Ptr DrawContext
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DrawContext -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DrawContext
fromGValue GValue
gv = do
Ptr DrawContext
ptr <- GValue -> IO (Ptr DrawContext)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DrawContext)
(ManagedPtr DrawContext -> DrawContext)
-> Ptr DrawContext -> IO DrawContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DrawContext -> DrawContext
DrawContext Ptr DrawContext
ptr
class (SP.GObject o, O.IsDescendantOf DrawContext o) => IsDrawContext o
instance (SP.GObject o, O.IsDescendantOf DrawContext o) => IsDrawContext o
instance O.HasParentTypes DrawContext
type instance O.ParentTypes DrawContext = '[GObject.Object.Object]
toDrawContext :: (MonadIO m, IsDrawContext o) => o -> m DrawContext
toDrawContext :: o -> m DrawContext
toDrawContext = IO DrawContext -> m DrawContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DrawContext -> m DrawContext)
-> (o -> IO DrawContext) -> o -> m DrawContext
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DrawContext -> DrawContext) -> o -> IO DrawContext
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DrawContext -> DrawContext
DrawContext
#if defined(ENABLE_OVERLOADING)
type family ResolveDrawContextMethod (t :: Symbol) (o :: *) :: * where
ResolveDrawContextMethod "beginFrame" o = DrawContextBeginFrameMethodInfo
ResolveDrawContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDrawContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDrawContextMethod "endFrame" o = DrawContextEndFrameMethodInfo
ResolveDrawContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDrawContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDrawContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDrawContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDrawContextMethod "isInFrame" o = DrawContextIsInFrameMethodInfo
ResolveDrawContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDrawContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDrawContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDrawContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDrawContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDrawContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDrawContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDrawContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDrawContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDrawContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDrawContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDrawContextMethod "getDisplay" o = DrawContextGetDisplayMethodInfo
ResolveDrawContextMethod "getFrameRegion" o = DrawContextGetFrameRegionMethodInfo
ResolveDrawContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDrawContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDrawContextMethod "getSurface" o = DrawContextGetSurfaceMethodInfo
ResolveDrawContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDrawContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDrawContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDrawContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDrawContextMethod t DrawContext, O.MethodInfo info DrawContext p) => OL.IsLabel t (DrawContext -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getDrawContextDisplay :: (MonadIO m, IsDrawContext o) => o -> m (Maybe Gdk.Display.Display)
getDrawContextDisplay :: o -> m (Maybe Display)
getDrawContextDisplay o
obj = IO (Maybe Display) -> m (Maybe Display)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Display) -> m (Maybe Display))
-> IO (Maybe Display) -> m (Maybe Display)
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Display -> Display) -> IO (Maybe Display)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"display" ManagedPtr Display -> Display
Gdk.Display.Display
#if defined(ENABLE_OVERLOADING)
data DrawContextDisplayPropertyInfo
instance AttrInfo DrawContextDisplayPropertyInfo where
type AttrAllowedOps DrawContextDisplayPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DrawContextDisplayPropertyInfo = IsDrawContext
type AttrSetTypeConstraint DrawContextDisplayPropertyInfo = (~) ()
type AttrTransferTypeConstraint DrawContextDisplayPropertyInfo = (~) ()
type AttrTransferType DrawContextDisplayPropertyInfo = ()
type AttrGetType DrawContextDisplayPropertyInfo = (Maybe Gdk.Display.Display)
type AttrLabel DrawContextDisplayPropertyInfo = "display"
type AttrOrigin DrawContextDisplayPropertyInfo = DrawContext
attrGet = getDrawContextDisplay
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDrawContextSurface :: (MonadIO m, IsDrawContext o) => o -> m (Maybe Gdk.Surface.Surface)
getDrawContextSurface :: o -> m (Maybe Surface)
getDrawContextSurface o
obj = IO (Maybe Surface) -> m (Maybe Surface)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Surface) -> m (Maybe Surface))
-> IO (Maybe Surface) -> m (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Surface -> Surface) -> IO (Maybe Surface)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"surface" ManagedPtr Surface -> Surface
Gdk.Surface.Surface
constructDrawContextSurface :: (IsDrawContext o, MIO.MonadIO m, Gdk.Surface.IsSurface a) => a -> m (GValueConstruct o)
constructDrawContextSurface :: a -> m (GValueConstruct o)
constructDrawContextSurface a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"surface" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data DrawContextSurfacePropertyInfo
instance AttrInfo DrawContextSurfacePropertyInfo where
type AttrAllowedOps DrawContextSurfacePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DrawContextSurfacePropertyInfo = IsDrawContext
type AttrSetTypeConstraint DrawContextSurfacePropertyInfo = Gdk.Surface.IsSurface
type AttrTransferTypeConstraint DrawContextSurfacePropertyInfo = Gdk.Surface.IsSurface
type AttrTransferType DrawContextSurfacePropertyInfo = Gdk.Surface.Surface
type AttrGetType DrawContextSurfacePropertyInfo = (Maybe Gdk.Surface.Surface)
type AttrLabel DrawContextSurfacePropertyInfo = "surface"
type AttrOrigin DrawContextSurfacePropertyInfo = DrawContext
attrGet = getDrawContextSurface
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Surface.Surface v
attrConstruct = constructDrawContextSurface
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DrawContext
type instance O.AttributeList DrawContext = DrawContextAttributeList
type DrawContextAttributeList = ('[ '("display", DrawContextDisplayPropertyInfo), '("surface", DrawContextSurfacePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
drawContextDisplay :: AttrLabelProxy "display"
drawContextDisplay = AttrLabelProxy
drawContextSurface :: AttrLabelProxy "surface"
drawContextSurface = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DrawContext = DrawContextSignalList
type DrawContextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_draw_context_begin_frame" gdk_draw_context_begin_frame ::
Ptr DrawContext ->
Ptr Cairo.Region.Region ->
IO ()
drawContextBeginFrame ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawContext a) =>
a
-> Cairo.Region.Region
-> m ()
drawContextBeginFrame :: a -> Region -> m ()
drawContextBeginFrame a
context Region
region = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DrawContext
context' <- a -> IO (Ptr DrawContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Region
region' <- Region -> IO (Ptr Region)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Region
region
Ptr DrawContext -> Ptr Region -> IO ()
gdk_draw_context_begin_frame Ptr DrawContext
context' Ptr Region
region'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Region -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Region
region
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DrawContextBeginFrameMethodInfo
instance (signature ~ (Cairo.Region.Region -> m ()), MonadIO m, IsDrawContext a) => O.MethodInfo DrawContextBeginFrameMethodInfo a signature where
overloadedMethod = drawContextBeginFrame
#endif
foreign import ccall "gdk_draw_context_end_frame" gdk_draw_context_end_frame ::
Ptr DrawContext ->
IO ()
drawContextEndFrame ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawContext a) =>
a
-> m ()
drawContextEndFrame :: a -> m ()
drawContextEndFrame a
context = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DrawContext
context' <- a -> IO (Ptr DrawContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr DrawContext -> IO ()
gdk_draw_context_end_frame Ptr DrawContext
context'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DrawContextEndFrameMethodInfo
instance (signature ~ (m ()), MonadIO m, IsDrawContext a) => O.MethodInfo DrawContextEndFrameMethodInfo a signature where
overloadedMethod = drawContextEndFrame
#endif
foreign import ccall "gdk_draw_context_get_display" gdk_draw_context_get_display ::
Ptr DrawContext ->
IO (Ptr Gdk.Display.Display)
drawContextGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawContext a) =>
a
-> m (Maybe Gdk.Display.Display)
drawContextGetDisplay :: a -> m (Maybe Display)
drawContextGetDisplay a
context = IO (Maybe Display) -> m (Maybe Display)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Display) -> m (Maybe Display))
-> IO (Maybe Display) -> m (Maybe Display)
forall a b. (a -> b) -> a -> b
$ do
Ptr DrawContext
context' <- a -> IO (Ptr DrawContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Display
result <- Ptr DrawContext -> IO (Ptr Display)
gdk_draw_context_get_display Ptr DrawContext
context'
Maybe Display
maybeResult <- Ptr Display -> (Ptr Display -> IO Display) -> IO (Maybe Display)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Display
result ((Ptr Display -> IO Display) -> IO (Maybe Display))
-> (Ptr Display -> IO Display) -> IO (Maybe Display)
forall a b. (a -> b) -> a -> b
$ \Ptr Display
result' -> do
Display
result'' <- ((ManagedPtr Display -> Display) -> Ptr Display -> IO Display
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Display -> Display
Gdk.Display.Display) Ptr Display
result'
Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Maybe Display -> IO (Maybe Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Display
maybeResult
#if defined(ENABLE_OVERLOADING)
data DrawContextGetDisplayMethodInfo
instance (signature ~ (m (Maybe Gdk.Display.Display)), MonadIO m, IsDrawContext a) => O.MethodInfo DrawContextGetDisplayMethodInfo a signature where
overloadedMethod = drawContextGetDisplay
#endif
foreign import ccall "gdk_draw_context_get_frame_region" gdk_draw_context_get_frame_region ::
Ptr DrawContext ->
IO (Ptr Cairo.Region.Region)
drawContextGetFrameRegion ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawContext a) =>
a
-> m (Maybe Cairo.Region.Region)
drawContextGetFrameRegion :: a -> m (Maybe Region)
drawContextGetFrameRegion a
context = IO (Maybe Region) -> m (Maybe Region)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Region) -> m (Maybe Region))
-> IO (Maybe Region) -> m (Maybe Region)
forall a b. (a -> b) -> a -> b
$ do
Ptr DrawContext
context' <- a -> IO (Ptr DrawContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Region
result <- Ptr DrawContext -> IO (Ptr Region)
gdk_draw_context_get_frame_region Ptr DrawContext
context'
Maybe Region
maybeResult <- Ptr Region -> (Ptr Region -> IO Region) -> IO (Maybe Region)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Region
result ((Ptr Region -> IO Region) -> IO (Maybe Region))
-> (Ptr Region -> IO Region) -> IO (Maybe Region)
forall a b. (a -> b) -> a -> b
$ \Ptr Region
result' -> do
Region
result'' <- ((ManagedPtr Region -> Region) -> Ptr Region -> IO Region
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Region -> Region
Cairo.Region.Region) Ptr Region
result'
Region -> IO Region
forall (m :: * -> *) a. Monad m => a -> m a
return Region
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Maybe Region -> IO (Maybe Region)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Region
maybeResult
#if defined(ENABLE_OVERLOADING)
data DrawContextGetFrameRegionMethodInfo
instance (signature ~ (m (Maybe Cairo.Region.Region)), MonadIO m, IsDrawContext a) => O.MethodInfo DrawContextGetFrameRegionMethodInfo a signature where
overloadedMethod = drawContextGetFrameRegion
#endif
foreign import ccall "gdk_draw_context_get_surface" gdk_draw_context_get_surface ::
Ptr DrawContext ->
IO (Ptr Gdk.Surface.Surface)
drawContextGetSurface ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawContext a) =>
a
-> m (Maybe Gdk.Surface.Surface)
drawContextGetSurface :: a -> m (Maybe Surface)
drawContextGetSurface a
context = IO (Maybe Surface) -> m (Maybe Surface)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Surface) -> m (Maybe Surface))
-> IO (Maybe Surface) -> m (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ do
Ptr DrawContext
context' <- a -> IO (Ptr DrawContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Surface
result <- Ptr DrawContext -> IO (Ptr Surface)
gdk_draw_context_get_surface Ptr DrawContext
context'
Maybe Surface
maybeResult <- Ptr Surface -> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Surface
result ((Ptr Surface -> IO Surface) -> IO (Maybe Surface))
-> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ \Ptr Surface
result' -> do
Surface
result'' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Gdk.Surface.Surface) Ptr Surface
result'
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Maybe Surface -> IO (Maybe Surface)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Surface
maybeResult
#if defined(ENABLE_OVERLOADING)
data DrawContextGetSurfaceMethodInfo
instance (signature ~ (m (Maybe Gdk.Surface.Surface)), MonadIO m, IsDrawContext a) => O.MethodInfo DrawContextGetSurfaceMethodInfo a signature where
overloadedMethod = drawContextGetSurface
#endif
foreign import ccall "gdk_draw_context_is_in_frame" gdk_draw_context_is_in_frame ::
Ptr DrawContext ->
IO CInt
drawContextIsInFrame ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawContext a) =>
a
-> m Bool
drawContextIsInFrame :: a -> m Bool
drawContextIsInFrame a
context = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr DrawContext
context' <- a -> IO (Ptr DrawContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
CInt
result <- Ptr DrawContext -> IO CInt
gdk_draw_context_is_in_frame Ptr DrawContext
context'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DrawContextIsInFrameMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrawContext a) => O.MethodInfo DrawContextIsInFrameMethodInfo a signature where
overloadedMethod = drawContextIsInFrame
#endif