{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.DrawingContext
(
DrawingContext(..) ,
IsDrawingContext ,
toDrawingContext ,
#if defined(ENABLE_OVERLOADING)
ResolveDrawingContextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DrawingContextGetCairoContextMethodInfo ,
#endif
drawingContextGetCairoContext ,
#if defined(ENABLE_OVERLOADING)
DrawingContextGetClipMethodInfo ,
#endif
drawingContextGetClip ,
#if defined(ENABLE_OVERLOADING)
DrawingContextGetWindowMethodInfo ,
#endif
drawingContextGetWindow ,
#if defined(ENABLE_OVERLOADING)
DrawingContextIsValidMethodInfo ,
#endif
drawingContextIsValid ,
#if defined(ENABLE_OVERLOADING)
DrawingContextClipPropertyInfo ,
#endif
constructDrawingContextClip ,
#if defined(ENABLE_OVERLOADING)
drawingContextClip ,
#endif
getDrawingContextClip ,
#if defined(ENABLE_OVERLOADING)
DrawingContextWindowPropertyInfo ,
#endif
constructDrawingContextWindow ,
#if defined(ENABLE_OVERLOADING)
drawingContextWindow ,
#endif
getDrawingContextWindow ,
) 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.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Objects.Window as Gdk.Window
newtype DrawingContext = DrawingContext (SP.ManagedPtr DrawingContext)
deriving (DrawingContext -> DrawingContext -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DrawingContext -> DrawingContext -> Bool
$c/= :: DrawingContext -> DrawingContext -> Bool
== :: DrawingContext -> DrawingContext -> Bool
$c== :: DrawingContext -> DrawingContext -> Bool
Eq)
instance SP.ManagedPtrNewtype DrawingContext where
toManagedPtr :: DrawingContext -> ManagedPtr DrawingContext
toManagedPtr (DrawingContext ManagedPtr DrawingContext
p) = ManagedPtr DrawingContext
p
foreign import ccall "gdk_drawing_context_get_type"
c_gdk_drawing_context_get_type :: IO B.Types.GType
instance B.Types.TypedObject DrawingContext where
glibType :: IO GType
glibType = IO GType
c_gdk_drawing_context_get_type
instance B.Types.GObject DrawingContext
class (SP.GObject o, O.IsDescendantOf DrawingContext o) => IsDrawingContext o
instance (SP.GObject o, O.IsDescendantOf DrawingContext o) => IsDrawingContext o
instance O.HasParentTypes DrawingContext
type instance O.ParentTypes DrawingContext = '[GObject.Object.Object]
toDrawingContext :: (MIO.MonadIO m, IsDrawingContext o) => o -> m DrawingContext
toDrawingContext :: forall (m :: * -> *) o.
(MonadIO m, IsDrawingContext o) =>
o -> m DrawingContext
toDrawingContext = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr DrawingContext -> DrawingContext
DrawingContext
instance B.GValue.IsGValue (Maybe DrawingContext) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_drawing_context_get_type
gvalueSet_ :: Ptr GValue -> Maybe DrawingContext -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DrawingContext
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr DrawingContext)
gvalueSet_ Ptr GValue
gv (P.Just DrawingContext
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DrawingContext
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DrawingContext)
gvalueGet_ Ptr GValue
gv = do
Ptr DrawingContext
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DrawingContext)
if Ptr DrawingContext
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DrawingContext -> DrawingContext
DrawingContext Ptr DrawingContext
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDrawingContextMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveDrawingContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDrawingContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDrawingContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDrawingContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDrawingContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDrawingContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDrawingContextMethod "isValid" o = DrawingContextIsValidMethodInfo
ResolveDrawingContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDrawingContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDrawingContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDrawingContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDrawingContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDrawingContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDrawingContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDrawingContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDrawingContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDrawingContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDrawingContextMethod "getCairoContext" o = DrawingContextGetCairoContextMethodInfo
ResolveDrawingContextMethod "getClip" o = DrawingContextGetClipMethodInfo
ResolveDrawingContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDrawingContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDrawingContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDrawingContextMethod "getWindow" o = DrawingContextGetWindowMethodInfo
ResolveDrawingContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDrawingContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDrawingContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDrawingContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDrawingContextMethod t DrawingContext, O.OverloadedMethod info DrawingContext p) => OL.IsLabel t (DrawingContext -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveDrawingContextMethod t DrawingContext, O.OverloadedMethod info DrawingContext p, R.HasField t DrawingContext p) => R.HasField t DrawingContext p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDrawingContextMethod t DrawingContext, O.OverloadedMethodInfo info DrawingContext) => OL.IsLabel t (O.MethodProxy info DrawingContext) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getDrawingContextClip :: (MonadIO m, IsDrawingContext o) => o -> m (Maybe Cairo.Region.Region)
getDrawingContextClip :: forall (m :: * -> *) o.
(MonadIO m, IsDrawingContext o) =>
o -> m (Maybe Region)
getDrawingContextClip o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"clip" ManagedPtr Region -> Region
Cairo.Region.Region
constructDrawingContextClip :: (IsDrawingContext o, MIO.MonadIO m) => Cairo.Region.Region -> m (GValueConstruct o)
constructDrawingContextClip :: forall o (m :: * -> *).
(IsDrawingContext o, MonadIO m) =>
Region -> m (GValueConstruct o)
constructDrawingContextClip Region
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"clip" (forall a. a -> Maybe a
P.Just Region
val)
#if defined(ENABLE_OVERLOADING)
data DrawingContextClipPropertyInfo
instance AttrInfo DrawingContextClipPropertyInfo where
type AttrAllowedOps DrawingContextClipPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DrawingContextClipPropertyInfo = IsDrawingContext
type AttrSetTypeConstraint DrawingContextClipPropertyInfo = (~) Cairo.Region.Region
type AttrTransferTypeConstraint DrawingContextClipPropertyInfo = (~) Cairo.Region.Region
type AttrTransferType DrawingContextClipPropertyInfo = Cairo.Region.Region
type AttrGetType DrawingContextClipPropertyInfo = (Maybe Cairo.Region.Region)
type AttrLabel DrawingContextClipPropertyInfo = "clip"
type AttrOrigin DrawingContextClipPropertyInfo = DrawingContext
attrGet = getDrawingContextClip
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDrawingContextClip
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DrawingContext.clip"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DrawingContext.html#g:attr:clip"
})
#endif
getDrawingContextWindow :: (MonadIO m, IsDrawingContext o) => o -> m Gdk.Window.Window
getDrawingContextWindow :: forall (m :: * -> *) o.
(MonadIO m, IsDrawingContext o) =>
o -> m Window
getDrawingContextWindow o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getDrawingContextWindow" forall a b. (a -> b) -> a -> b
$ forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"window" ManagedPtr Window -> Window
Gdk.Window.Window
constructDrawingContextWindow :: (IsDrawingContext o, MIO.MonadIO m, Gdk.Window.IsWindow a) => a -> m (GValueConstruct o)
constructDrawingContextWindow :: forall o (m :: * -> *) a.
(IsDrawingContext o, MonadIO m, IsWindow a) =>
a -> m (GValueConstruct o)
constructDrawingContextWindow a
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"window" (forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data DrawingContextWindowPropertyInfo
instance AttrInfo DrawingContextWindowPropertyInfo where
type AttrAllowedOps DrawingContextWindowPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DrawingContextWindowPropertyInfo = IsDrawingContext
type AttrSetTypeConstraint DrawingContextWindowPropertyInfo = Gdk.Window.IsWindow
type AttrTransferTypeConstraint DrawingContextWindowPropertyInfo = Gdk.Window.IsWindow
type AttrTransferType DrawingContextWindowPropertyInfo = Gdk.Window.Window
type AttrGetType DrawingContextWindowPropertyInfo = Gdk.Window.Window
type AttrLabel DrawingContextWindowPropertyInfo = "window"
type AttrOrigin DrawingContextWindowPropertyInfo = DrawingContext
attrGet = getDrawingContextWindow
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Window.Window v
attrConstruct = constructDrawingContextWindow
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DrawingContext.window"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DrawingContext.html#g:attr:window"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DrawingContext
type instance O.AttributeList DrawingContext = DrawingContextAttributeList
type DrawingContextAttributeList = ('[ '("clip", DrawingContextClipPropertyInfo), '("window", DrawingContextWindowPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
drawingContextClip :: AttrLabelProxy "clip"
drawingContextClip = AttrLabelProxy
drawingContextWindow :: AttrLabelProxy "window"
drawingContextWindow = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DrawingContext = DrawingContextSignalList
type DrawingContextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gdk_drawing_context_get_cairo_context" gdk_drawing_context_get_cairo_context ::
Ptr DrawingContext ->
IO (Ptr Cairo.Context.Context)
drawingContextGetCairoContext ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawingContext a) =>
a
-> m Cairo.Context.Context
drawingContextGetCairoContext :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrawingContext a) =>
a -> m Context
drawingContextGetCairoContext a
context = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DrawingContext
context' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Context
result <- Ptr DrawingContext -> IO (Ptr Context)
gdk_drawing_context_get_cairo_context Ptr DrawingContext
context'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"drawingContextGetCairoContext" Ptr Context
result
Context
result' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Context -> Context
Cairo.Context.Context) Ptr Context
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
forall (m :: * -> *) a. Monad m => a -> m a
return Context
result'
#if defined(ENABLE_OVERLOADING)
data DrawingContextGetCairoContextMethodInfo
instance (signature ~ (m Cairo.Context.Context), MonadIO m, IsDrawingContext a) => O.OverloadedMethod DrawingContextGetCairoContextMethodInfo a signature where
overloadedMethod = drawingContextGetCairoContext
instance O.OverloadedMethodInfo DrawingContextGetCairoContextMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DrawingContext.drawingContextGetCairoContext",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DrawingContext.html#v:drawingContextGetCairoContext"
})
#endif
foreign import ccall "gdk_drawing_context_get_clip" gdk_drawing_context_get_clip ::
Ptr DrawingContext ->
IO (Ptr Cairo.Region.Region)
drawingContextGetClip ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawingContext a) =>
a
-> m (Maybe Cairo.Region.Region)
drawingContextGetClip :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrawingContext a) =>
a -> m (Maybe Region)
drawingContextGetClip a
context = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DrawingContext
context' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Region
result <- Ptr DrawingContext -> IO (Ptr Region)
gdk_drawing_context_get_clip Ptr DrawingContext
context'
Maybe Region
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Region
result forall a b. (a -> b) -> a -> b
$ \Ptr Region
result' -> do
Region
result'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Region -> Region
Cairo.Region.Region) Ptr Region
result'
forall (m :: * -> *) a. Monad m => a -> m a
return Region
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Region
maybeResult
#if defined(ENABLE_OVERLOADING)
data DrawingContextGetClipMethodInfo
instance (signature ~ (m (Maybe Cairo.Region.Region)), MonadIO m, IsDrawingContext a) => O.OverloadedMethod DrawingContextGetClipMethodInfo a signature where
overloadedMethod = drawingContextGetClip
instance O.OverloadedMethodInfo DrawingContextGetClipMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DrawingContext.drawingContextGetClip",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DrawingContext.html#v:drawingContextGetClip"
})
#endif
foreign import ccall "gdk_drawing_context_get_window" gdk_drawing_context_get_window ::
Ptr DrawingContext ->
IO (Ptr Gdk.Window.Window)
drawingContextGetWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawingContext a) =>
a
-> m Gdk.Window.Window
drawingContextGetWindow :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrawingContext a) =>
a -> m Window
drawingContextGetWindow a
context = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DrawingContext
context' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Window
result <- Ptr DrawingContext -> IO (Ptr Window)
gdk_drawing_context_get_window Ptr DrawingContext
context'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"drawingContextGetWindow" Ptr Window
result
Window
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gdk.Window.Window) Ptr Window
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
forall (m :: * -> *) a. Monad m => a -> m a
return Window
result'
#if defined(ENABLE_OVERLOADING)
data DrawingContextGetWindowMethodInfo
instance (signature ~ (m Gdk.Window.Window), MonadIO m, IsDrawingContext a) => O.OverloadedMethod DrawingContextGetWindowMethodInfo a signature where
overloadedMethod = drawingContextGetWindow
instance O.OverloadedMethodInfo DrawingContextGetWindowMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DrawingContext.drawingContextGetWindow",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DrawingContext.html#v:drawingContextGetWindow"
})
#endif
foreign import ccall "gdk_drawing_context_is_valid" gdk_drawing_context_is_valid ::
Ptr DrawingContext ->
IO CInt
drawingContextIsValid ::
(B.CallStack.HasCallStack, MonadIO m, IsDrawingContext a) =>
a
-> m Bool
drawingContextIsValid :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrawingContext a) =>
a -> m Bool
drawingContextIsValid a
context = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DrawingContext
context' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
CInt
result <- Ptr DrawingContext -> IO CInt
gdk_drawing_context_is_valid Ptr DrawingContext
context'
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DrawingContextIsValidMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrawingContext a) => O.OverloadedMethod DrawingContextIsValidMethodInfo a signature where
overloadedMethod = drawingContextIsValid
instance O.OverloadedMethodInfo DrawingContextIsValidMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DrawingContext.drawingContextIsValid",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DrawingContext.html#v:drawingContextIsValid"
})
#endif