{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.GLContext
(
GLContext(..) ,
IsGLContext ,
toGLContext ,
#if defined(ENABLE_OVERLOADING)
ResolveGLContextMethod ,
#endif
gLContextClearCurrent ,
#if defined(ENABLE_OVERLOADING)
GLContextGetAllowedApisMethodInfo ,
#endif
gLContextGetAllowedApis ,
#if defined(ENABLE_OVERLOADING)
GLContextGetApiMethodInfo ,
#endif
gLContextGetApi ,
gLContextGetCurrent ,
#if defined(ENABLE_OVERLOADING)
GLContextGetDebugEnabledMethodInfo ,
#endif
gLContextGetDebugEnabled ,
#if defined(ENABLE_OVERLOADING)
GLContextGetDisplayMethodInfo ,
#endif
gLContextGetDisplay ,
#if defined(ENABLE_OVERLOADING)
GLContextGetForwardCompatibleMethodInfo ,
#endif
gLContextGetForwardCompatible ,
#if defined(ENABLE_OVERLOADING)
GLContextGetRequiredVersionMethodInfo ,
#endif
gLContextGetRequiredVersion ,
#if defined(ENABLE_OVERLOADING)
GLContextGetSharedContextMethodInfo ,
#endif
gLContextGetSharedContext ,
#if defined(ENABLE_OVERLOADING)
GLContextGetSurfaceMethodInfo ,
#endif
gLContextGetSurface ,
#if defined(ENABLE_OVERLOADING)
GLContextGetUseEsMethodInfo ,
#endif
gLContextGetUseEs ,
#if defined(ENABLE_OVERLOADING)
GLContextGetVersionMethodInfo ,
#endif
gLContextGetVersion ,
#if defined(ENABLE_OVERLOADING)
GLContextIsLegacyMethodInfo ,
#endif
gLContextIsLegacy ,
#if defined(ENABLE_OVERLOADING)
GLContextIsSharedMethodInfo ,
#endif
gLContextIsShared ,
#if defined(ENABLE_OVERLOADING)
GLContextMakeCurrentMethodInfo ,
#endif
gLContextMakeCurrent ,
#if defined(ENABLE_OVERLOADING)
GLContextRealizeMethodInfo ,
#endif
gLContextRealize ,
#if defined(ENABLE_OVERLOADING)
GLContextSetAllowedApisMethodInfo ,
#endif
gLContextSetAllowedApis ,
#if defined(ENABLE_OVERLOADING)
GLContextSetDebugEnabledMethodInfo ,
#endif
gLContextSetDebugEnabled ,
#if defined(ENABLE_OVERLOADING)
GLContextSetForwardCompatibleMethodInfo ,
#endif
gLContextSetForwardCompatible ,
#if defined(ENABLE_OVERLOADING)
GLContextSetRequiredVersionMethodInfo ,
#endif
gLContextSetRequiredVersion ,
#if defined(ENABLE_OVERLOADING)
GLContextSetUseEsMethodInfo ,
#endif
gLContextSetUseEs ,
#if defined(ENABLE_OVERLOADING)
GLContextAllowedApisPropertyInfo ,
#endif
constructGLContextAllowedApis ,
#if defined(ENABLE_OVERLOADING)
gLContextAllowedApis ,
#endif
getGLContextAllowedApis ,
setGLContextAllowedApis ,
#if defined(ENABLE_OVERLOADING)
GLContextApiPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
gLContextApi ,
#endif
getGLContextApi ,
#if defined(ENABLE_OVERLOADING)
GLContextSharedContextPropertyInfo ,
#endif
constructGLContextSharedContext ,
#if defined(ENABLE_OVERLOADING)
gLContextSharedContext ,
#endif
getGLContextSharedContext ,
) 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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.Cairo.Enums as Cairo.Enums
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Interfaces.Paintable as Gdk.Paintable
import {-# SOURCE #-} qualified GI.Gdk.Objects.AppLaunchContext as Gdk.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.CairoContext as Gdk.CairoContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Clipboard as Gdk.Clipboard
import {-# SOURCE #-} qualified GI.Gdk.Objects.ContentProvider as Gdk.ContentProvider
import {-# SOURCE #-} qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.DeviceTool as Gdk.DeviceTool
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.DrawContext as Gdk.DrawContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Event as Gdk.Event
import {-# SOURCE #-} qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import {-# SOURCE #-} qualified GI.Gdk.Objects.Monitor as Gdk.Monitor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Seat as Gdk.Seat
import {-# SOURCE #-} qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import {-# SOURCE #-} qualified GI.Gdk.Objects.Texture as Gdk.Texture
import {-# SOURCE #-} qualified GI.Gdk.Objects.VulkanContext as Gdk.VulkanContext
import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
import {-# SOURCE #-} qualified GI.Gdk.Structs.DmabufFormats as Gdk.DmabufFormats
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventSequence as Gdk.EventSequence
import {-# SOURCE #-} qualified GI.Gdk.Structs.FrameTimings as Gdk.FrameTimings
import {-# SOURCE #-} qualified GI.Gdk.Structs.KeymapKey as Gdk.KeymapKey
import {-# SOURCE #-} qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import {-# SOURCE #-} qualified GI.Gdk.Structs.TimeCoord as Gdk.TimeCoord
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.Gio.Interfaces.LoadableIcon as Gio.LoadableIcon
import qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.Pango.Enums as Pango.Enums
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.DrawContext as Gdk.DrawContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
#endif
newtype GLContext = GLContext (SP.ManagedPtr GLContext)
deriving (GLContext -> GLContext -> Bool
(GLContext -> GLContext -> Bool)
-> (GLContext -> GLContext -> Bool) -> Eq GLContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GLContext -> GLContext -> Bool
== :: GLContext -> GLContext -> Bool
$c/= :: GLContext -> GLContext -> Bool
/= :: GLContext -> GLContext -> Bool
Eq)
instance SP.ManagedPtrNewtype GLContext where
toManagedPtr :: GLContext -> ManagedPtr GLContext
toManagedPtr (GLContext ManagedPtr GLContext
p) = ManagedPtr GLContext
p
foreign import ccall "gdk_gl_context_get_type"
c_gdk_gl_context_get_type :: IO B.Types.GType
instance B.Types.TypedObject GLContext where
glibType :: IO GType
glibType = IO GType
c_gdk_gl_context_get_type
instance B.Types.GObject GLContext
class (SP.GObject o, O.IsDescendantOf GLContext o) => IsGLContext o
instance (SP.GObject o, O.IsDescendantOf GLContext o) => IsGLContext o
instance O.HasParentTypes GLContext
type instance O.ParentTypes GLContext = '[Gdk.DrawContext.DrawContext, GObject.Object.Object]
toGLContext :: (MIO.MonadIO m, IsGLContext o) => o -> m GLContext
toGLContext :: forall (m :: * -> *) o.
(MonadIO m, IsGLContext o) =>
o -> m GLContext
toGLContext = IO GLContext -> m GLContext
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO GLContext -> m GLContext)
-> (o -> IO GLContext) -> o -> m GLContext
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr GLContext -> GLContext) -> o -> IO GLContext
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr GLContext -> GLContext
GLContext
instance B.GValue.IsGValue (Maybe GLContext) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_gl_context_get_type
gvalueSet_ :: Ptr GValue -> Maybe GLContext -> IO ()
gvalueSet_ Ptr GValue
gv Maybe GLContext
P.Nothing = Ptr GValue -> Ptr GLContext -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr GLContext
forall a. Ptr a
FP.nullPtr :: FP.Ptr GLContext)
gvalueSet_ Ptr GValue
gv (P.Just GLContext
obj) = GLContext -> (Ptr GLContext -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr GLContext
obj (Ptr GValue -> Ptr GLContext -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe GLContext)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr GLContext)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr GLContext)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject GLContext ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveGLContextMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveGLContextMethod "beginFrame" o = Gdk.DrawContext.DrawContextBeginFrameMethodInfo
ResolveGLContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveGLContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveGLContextMethod "endFrame" o = Gdk.DrawContext.DrawContextEndFrameMethodInfo
ResolveGLContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveGLContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveGLContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveGLContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveGLContextMethod "isInFrame" o = Gdk.DrawContext.DrawContextIsInFrameMethodInfo
ResolveGLContextMethod "isLegacy" o = GLContextIsLegacyMethodInfo
ResolveGLContextMethod "isShared" o = GLContextIsSharedMethodInfo
ResolveGLContextMethod "makeCurrent" o = GLContextMakeCurrentMethodInfo
ResolveGLContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveGLContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveGLContextMethod "realize" o = GLContextRealizeMethodInfo
ResolveGLContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveGLContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveGLContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveGLContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveGLContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveGLContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveGLContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveGLContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveGLContextMethod "getAllowedApis" o = GLContextGetAllowedApisMethodInfo
ResolveGLContextMethod "getApi" o = GLContextGetApiMethodInfo
ResolveGLContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveGLContextMethod "getDebugEnabled" o = GLContextGetDebugEnabledMethodInfo
ResolveGLContextMethod "getDisplay" o = GLContextGetDisplayMethodInfo
ResolveGLContextMethod "getForwardCompatible" o = GLContextGetForwardCompatibleMethodInfo
ResolveGLContextMethod "getFrameRegion" o = Gdk.DrawContext.DrawContextGetFrameRegionMethodInfo
ResolveGLContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveGLContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveGLContextMethod "getRequiredVersion" o = GLContextGetRequiredVersionMethodInfo
ResolveGLContextMethod "getSharedContext" o = GLContextGetSharedContextMethodInfo
ResolveGLContextMethod "getSurface" o = GLContextGetSurfaceMethodInfo
ResolveGLContextMethod "getUseEs" o = GLContextGetUseEsMethodInfo
ResolveGLContextMethod "getVersion" o = GLContextGetVersionMethodInfo
ResolveGLContextMethod "setAllowedApis" o = GLContextSetAllowedApisMethodInfo
ResolveGLContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveGLContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveGLContextMethod "setDebugEnabled" o = GLContextSetDebugEnabledMethodInfo
ResolveGLContextMethod "setForwardCompatible" o = GLContextSetForwardCompatibleMethodInfo
ResolveGLContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveGLContextMethod "setRequiredVersion" o = GLContextSetRequiredVersionMethodInfo
ResolveGLContextMethod "setUseEs" o = GLContextSetUseEsMethodInfo
ResolveGLContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveGLContextMethod t GLContext, O.OverloadedMethod info GLContext p) => OL.IsLabel t (GLContext -> 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 ~ ResolveGLContextMethod t GLContext, O.OverloadedMethod info GLContext p, R.HasField t GLContext p) => R.HasField t GLContext p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveGLContextMethod t GLContext, O.OverloadedMethodInfo info GLContext) => OL.IsLabel t (O.MethodProxy info GLContext) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getGLContextAllowedApis :: (MonadIO m, IsGLContext o) => o -> m [Gdk.Flags.GLAPI]
getGLContextAllowedApis :: forall (m :: * -> *) o.
(MonadIO m, IsGLContext o) =>
o -> m [GLAPI]
getGLContextAllowedApis o
obj = IO [GLAPI] -> m [GLAPI]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO [GLAPI] -> m [GLAPI]) -> IO [GLAPI] -> m [GLAPI]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [GLAPI]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"allowed-apis"
setGLContextAllowedApis :: (MonadIO m, IsGLContext o) => o -> [Gdk.Flags.GLAPI] -> m ()
setGLContextAllowedApis :: forall (m :: * -> *) o.
(MonadIO m, IsGLContext o) =>
o -> [GLAPI] -> m ()
setGLContextAllowedApis o
obj [GLAPI]
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> [GLAPI] -> IO ()
forall a b.
(IsGFlag b, BoxedFlags b, GObject a) =>
a -> String -> [b] -> IO ()
B.Properties.setObjectPropertyFlags o
obj String
"allowed-apis" [GLAPI]
val
constructGLContextAllowedApis :: (IsGLContext o, MIO.MonadIO m) => [Gdk.Flags.GLAPI] -> m (GValueConstruct o)
constructGLContextAllowedApis :: forall o (m :: * -> *).
(IsGLContext o, MonadIO m) =>
[GLAPI] -> m (GValueConstruct o)
constructGLContextAllowedApis [GLAPI]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
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
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> [GLAPI] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"allowed-apis" [GLAPI]
val
#if defined(ENABLE_OVERLOADING)
data GLContextAllowedApisPropertyInfo
instance AttrInfo GLContextAllowedApisPropertyInfo where
type AttrAllowedOps GLContextAllowedApisPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint GLContextAllowedApisPropertyInfo = IsGLContext
type AttrSetTypeConstraint GLContextAllowedApisPropertyInfo = (~) [Gdk.Flags.GLAPI]
type AttrTransferTypeConstraint GLContextAllowedApisPropertyInfo = (~) [Gdk.Flags.GLAPI]
type AttrTransferType GLContextAllowedApisPropertyInfo = [Gdk.Flags.GLAPI]
type AttrGetType GLContextAllowedApisPropertyInfo = [Gdk.Flags.GLAPI]
type AttrLabel GLContextAllowedApisPropertyInfo = "allowed-apis"
type AttrOrigin GLContextAllowedApisPropertyInfo = GLContext
attrGet = getGLContextAllowedApis
attrSet = setGLContextAllowedApis
attrTransfer _ v = do
return v
attrConstruct = constructGLContextAllowedApis
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.allowedApis"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#g:attr:allowedApis"
})
#endif
getGLContextApi :: (MonadIO m, IsGLContext o) => o -> m [Gdk.Flags.GLAPI]
getGLContextApi :: forall (m :: * -> *) o.
(MonadIO m, IsGLContext o) =>
o -> m [GLAPI]
getGLContextApi o
obj = IO [GLAPI] -> m [GLAPI]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO [GLAPI] -> m [GLAPI]) -> IO [GLAPI] -> m [GLAPI]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [GLAPI]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"api"
#if defined(ENABLE_OVERLOADING)
data GLContextApiPropertyInfo
instance AttrInfo GLContextApiPropertyInfo where
type AttrAllowedOps GLContextApiPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint GLContextApiPropertyInfo = IsGLContext
type AttrSetTypeConstraint GLContextApiPropertyInfo = (~) ()
type AttrTransferTypeConstraint GLContextApiPropertyInfo = (~) ()
type AttrTransferType GLContextApiPropertyInfo = ()
type AttrGetType GLContextApiPropertyInfo = [Gdk.Flags.GLAPI]
type AttrLabel GLContextApiPropertyInfo = "api"
type AttrOrigin GLContextApiPropertyInfo = GLContext
attrGet = getGLContextApi
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.api"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#g:attr:api"
})
#endif
getGLContextSharedContext :: (MonadIO m, IsGLContext o) => o -> m (Maybe GLContext)
getGLContextSharedContext :: forall (m :: * -> *) o.
(MonadIO m, IsGLContext o) =>
o -> m (Maybe GLContext)
getGLContextSharedContext o
obj = IO (Maybe GLContext) -> m (Maybe GLContext)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe GLContext) -> m (Maybe GLContext))
-> IO (Maybe GLContext) -> m (Maybe GLContext)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr GLContext -> GLContext)
-> IO (Maybe GLContext)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"shared-context" ManagedPtr GLContext -> GLContext
GLContext
constructGLContextSharedContext :: (IsGLContext o, MIO.MonadIO m, IsGLContext a) => a -> m (GValueConstruct o)
constructGLContextSharedContext :: forall o (m :: * -> *) a.
(IsGLContext o, MonadIO m, IsGLContext a) =>
a -> m (GValueConstruct o)
constructGLContextSharedContext a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
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
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (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
"shared-context" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data GLContextSharedContextPropertyInfo
instance AttrInfo GLContextSharedContextPropertyInfo where
type AttrAllowedOps GLContextSharedContextPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint GLContextSharedContextPropertyInfo = IsGLContext
type AttrSetTypeConstraint GLContextSharedContextPropertyInfo = IsGLContext
type AttrTransferTypeConstraint GLContextSharedContextPropertyInfo = IsGLContext
type AttrTransferType GLContextSharedContextPropertyInfo = GLContext
type AttrGetType GLContextSharedContextPropertyInfo = (Maybe GLContext)
type AttrLabel GLContextSharedContextPropertyInfo = "shared-context"
type AttrOrigin GLContextSharedContextPropertyInfo = GLContext
attrGet = getGLContextSharedContext
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo GLContext v
attrConstruct = constructGLContextSharedContext
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.sharedContext"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#g:attr:sharedContext"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList GLContext
type instance O.AttributeList GLContext = GLContextAttributeList
type GLContextAttributeList = ('[ '("allowedApis", GLContextAllowedApisPropertyInfo), '("api", GLContextApiPropertyInfo), '("display", Gdk.DrawContext.DrawContextDisplayPropertyInfo), '("sharedContext", GLContextSharedContextPropertyInfo), '("surface", Gdk.DrawContext.DrawContextSurfacePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
gLContextAllowedApis :: AttrLabelProxy "allowedApis"
gLContextAllowedApis = AttrLabelProxy
gLContextApi :: AttrLabelProxy "api"
gLContextApi = AttrLabelProxy
gLContextSharedContext :: AttrLabelProxy "sharedContext"
gLContextSharedContext = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList GLContext = GLContextSignalList
type GLContextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gdk_gl_context_get_allowed_apis" gdk_gl_context_get_allowed_apis ::
Ptr GLContext ->
IO CUInt
gLContextGetAllowedApis ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m [Gdk.Flags.GLAPI]
gLContextGetAllowedApis :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m [GLAPI]
gLContextGetAllowedApis a
self = IO [GLAPI] -> m [GLAPI]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GLAPI] -> m [GLAPI]) -> IO [GLAPI] -> m [GLAPI]
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- gdk_gl_context_get_allowed_apis self'
let result' = CUInt -> [GLAPI]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
touchManagedPtr self
return result'
#if defined(ENABLE_OVERLOADING)
data GLContextGetAllowedApisMethodInfo
instance (signature ~ (m [Gdk.Flags.GLAPI]), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetAllowedApisMethodInfo a signature where
overloadedMethod = gLContextGetAllowedApis
instance O.OverloadedMethodInfo GLContextGetAllowedApisMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetAllowedApis",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetAllowedApis"
})
#endif
foreign import ccall "gdk_gl_context_get_api" gdk_gl_context_get_api ::
Ptr GLContext ->
IO CUInt
gLContextGetApi ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m [Gdk.Flags.GLAPI]
gLContextGetApi :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m [GLAPI]
gLContextGetApi a
self = IO [GLAPI] -> m [GLAPI]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GLAPI] -> m [GLAPI]) -> IO [GLAPI] -> m [GLAPI]
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- gdk_gl_context_get_api self'
let result' = CUInt -> [GLAPI]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
touchManagedPtr self
return result'
#if defined(ENABLE_OVERLOADING)
data GLContextGetApiMethodInfo
instance (signature ~ (m [Gdk.Flags.GLAPI]), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetApiMethodInfo a signature where
overloadedMethod = gLContextGetApi
instance O.OverloadedMethodInfo GLContextGetApiMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetApi",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetApi"
})
#endif
foreign import ccall "gdk_gl_context_get_debug_enabled" gdk_gl_context_get_debug_enabled ::
Ptr GLContext ->
IO CInt
gLContextGetDebugEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m Bool
gLContextGetDebugEnabled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m Bool
gLContextGetDebugEnabled a
context = IO Bool -> m Bool
forall a. IO a -> m a
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
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- gdk_gl_context_get_debug_enabled context'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data GLContextGetDebugEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetDebugEnabledMethodInfo a signature where
overloadedMethod = gLContextGetDebugEnabled
instance O.OverloadedMethodInfo GLContextGetDebugEnabledMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetDebugEnabled",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetDebugEnabled"
})
#endif
foreign import ccall "gdk_gl_context_get_display" gdk_gl_context_get_display ::
Ptr GLContext ->
IO (Ptr Gdk.Display.Display)
gLContextGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m (Maybe Gdk.Display.Display)
gLContextGetDisplay :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m (Maybe Display)
gLContextGetDisplay a
context = IO (Maybe Display) -> m (Maybe Display)
forall a. IO a -> m a
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
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- gdk_gl_context_get_display context'
maybeResult <- convertIfNonNull result $ \Ptr Display
result' -> do
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'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING)
data GLContextGetDisplayMethodInfo
instance (signature ~ (m (Maybe Gdk.Display.Display)), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetDisplayMethodInfo a signature where
overloadedMethod = gLContextGetDisplay
instance O.OverloadedMethodInfo GLContextGetDisplayMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetDisplay",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetDisplay"
})
#endif
foreign import ccall "gdk_gl_context_get_forward_compatible" gdk_gl_context_get_forward_compatible ::
Ptr GLContext ->
IO CInt
gLContextGetForwardCompatible ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m Bool
gLContextGetForwardCompatible :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m Bool
gLContextGetForwardCompatible a
context = IO Bool -> m Bool
forall a. IO a -> m a
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
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- gdk_gl_context_get_forward_compatible context'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data GLContextGetForwardCompatibleMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetForwardCompatibleMethodInfo a signature where
overloadedMethod = gLContextGetForwardCompatible
instance O.OverloadedMethodInfo GLContextGetForwardCompatibleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetForwardCompatible",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetForwardCompatible"
})
#endif
foreign import ccall "gdk_gl_context_get_required_version" gdk_gl_context_get_required_version ::
Ptr GLContext ->
Ptr Int32 ->
Ptr Int32 ->
IO ()
gLContextGetRequiredVersion ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m ((Int32, Int32))
gLContextGetRequiredVersion :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m (Int32, Int32)
gLContextGetRequiredVersion a
context = IO (Int32, Int32) -> m (Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
major <- allocMem :: IO (Ptr Int32)
minor <- allocMem :: IO (Ptr Int32)
gdk_gl_context_get_required_version context' major minor
major' <- peek major
minor' <- peek minor
touchManagedPtr context
freeMem major
freeMem minor
return (major', minor')
#if defined(ENABLE_OVERLOADING)
data GLContextGetRequiredVersionMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetRequiredVersionMethodInfo a signature where
overloadedMethod = gLContextGetRequiredVersion
instance O.OverloadedMethodInfo GLContextGetRequiredVersionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetRequiredVersion",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetRequiredVersion"
})
#endif
foreign import ccall "gdk_gl_context_get_shared_context" gdk_gl_context_get_shared_context ::
Ptr GLContext ->
IO (Ptr GLContext)
{-# DEPRECATED gLContextGetSharedContext ["(Since version 4.4)","Use 'GI.Gdk.Objects.GLContext.gLContextIsShared' to check if contexts"," can be shared."] #-}
gLContextGetSharedContext ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m (Maybe GLContext)
gLContextGetSharedContext :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m (Maybe GLContext)
gLContextGetSharedContext a
context = IO (Maybe GLContext) -> m (Maybe GLContext)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GLContext) -> m (Maybe GLContext))
-> IO (Maybe GLContext) -> m (Maybe GLContext)
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- gdk_gl_context_get_shared_context context'
maybeResult <- convertIfNonNull result $ \Ptr GLContext
result' -> do
result'' <- ((ManagedPtr GLContext -> GLContext)
-> Ptr GLContext -> IO GLContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr GLContext -> GLContext
GLContext) Ptr GLContext
result'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING)
data GLContextGetSharedContextMethodInfo
instance (signature ~ (m (Maybe GLContext)), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetSharedContextMethodInfo a signature where
overloadedMethod = gLContextGetSharedContext
instance O.OverloadedMethodInfo GLContextGetSharedContextMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetSharedContext",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetSharedContext"
})
#endif
foreign import ccall "gdk_gl_context_get_surface" gdk_gl_context_get_surface ::
Ptr GLContext ->
IO (Ptr Gdk.Surface.Surface)
gLContextGetSurface ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m (Maybe Gdk.Surface.Surface)
gLContextGetSurface :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m (Maybe Surface)
gLContextGetSurface a
context = IO (Maybe Surface) -> m (Maybe Surface)
forall a. IO a -> m a
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
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- gdk_gl_context_get_surface context'
maybeResult <- convertIfNonNull result $ \Ptr Surface
result' -> do
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'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING)
data GLContextGetSurfaceMethodInfo
instance (signature ~ (m (Maybe Gdk.Surface.Surface)), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetSurfaceMethodInfo a signature where
overloadedMethod = gLContextGetSurface
instance O.OverloadedMethodInfo GLContextGetSurfaceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetSurface",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetSurface"
})
#endif
foreign import ccall "gdk_gl_context_get_use_es" gdk_gl_context_get_use_es ::
Ptr GLContext ->
IO CInt
gLContextGetUseEs ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m Bool
gLContextGetUseEs :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m Bool
gLContextGetUseEs a
context = IO Bool -> m Bool
forall a. IO a -> m a
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
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- gdk_gl_context_get_use_es context'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data GLContextGetUseEsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetUseEsMethodInfo a signature where
overloadedMethod = gLContextGetUseEs
instance O.OverloadedMethodInfo GLContextGetUseEsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetUseEs",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetUseEs"
})
#endif
foreign import ccall "gdk_gl_context_get_version" gdk_gl_context_get_version ::
Ptr GLContext ->
Ptr Int32 ->
Ptr Int32 ->
IO ()
gLContextGetVersion ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m ((Int32, Int32))
gLContextGetVersion :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m (Int32, Int32)
gLContextGetVersion a
context = IO (Int32, Int32) -> m (Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
major <- allocMem :: IO (Ptr Int32)
minor <- allocMem :: IO (Ptr Int32)
gdk_gl_context_get_version context' major minor
major' <- peek major
minor' <- peek minor
touchManagedPtr context
freeMem major
freeMem minor
return (major', minor')
#if defined(ENABLE_OVERLOADING)
data GLContextGetVersionMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextGetVersionMethodInfo a signature where
overloadedMethod = gLContextGetVersion
instance O.OverloadedMethodInfo GLContextGetVersionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextGetVersion",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextGetVersion"
})
#endif
foreign import ccall "gdk_gl_context_is_legacy" gdk_gl_context_is_legacy ::
Ptr GLContext ->
IO CInt
gLContextIsLegacy ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m Bool
gLContextIsLegacy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m Bool
gLContextIsLegacy a
context = IO Bool -> m Bool
forall a. IO a -> m a
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
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
result <- gdk_gl_context_is_legacy context'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING)
data GLContextIsLegacyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextIsLegacyMethodInfo a signature where
overloadedMethod = gLContextIsLegacy
instance O.OverloadedMethodInfo GLContextIsLegacyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextIsLegacy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextIsLegacy"
})
#endif
foreign import ccall "gdk_gl_context_is_shared" gdk_gl_context_is_shared ::
Ptr GLContext ->
Ptr GLContext ->
IO CInt
gLContextIsShared ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a, IsGLContext b) =>
a
-> b
-> m Bool
gLContextIsShared :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsGLContext a, IsGLContext b) =>
a -> b -> m Bool
gLContextIsShared a
self b
other = IO Bool -> m Bool
forall a. IO a -> m a
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
self' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
other' <- unsafeManagedPtrCastPtr other
result <- gdk_gl_context_is_shared self' other'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr self
touchManagedPtr other
return result'
#if defined(ENABLE_OVERLOADING)
data GLContextIsSharedMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsGLContext a, IsGLContext b) => O.OverloadedMethod GLContextIsSharedMethodInfo a signature where
overloadedMethod = gLContextIsShared
instance O.OverloadedMethodInfo GLContextIsSharedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextIsShared",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextIsShared"
})
#endif
foreign import ccall "gdk_gl_context_make_current" gdk_gl_context_make_current ::
Ptr GLContext ->
IO ()
gLContextMakeCurrent ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m ()
gLContextMakeCurrent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m ()
gLContextMakeCurrent a
context = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
gdk_gl_context_make_current context'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data GLContextMakeCurrentMethodInfo
instance (signature ~ (m ()), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextMakeCurrentMethodInfo a signature where
overloadedMethod = gLContextMakeCurrent
instance O.OverloadedMethodInfo GLContextMakeCurrentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextMakeCurrent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextMakeCurrent"
})
#endif
foreign import ccall "gdk_gl_context_realize" gdk_gl_context_realize ::
Ptr GLContext ->
Ptr (Ptr GError) ->
IO CInt
gLContextRealize ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m ()
gLContextRealize :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> m ()
gLContextRealize a
context = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
onException (do
_ <- propagateGError $ gdk_gl_context_realize context'
touchManagedPtr context
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data GLContextRealizeMethodInfo
instance (signature ~ (m ()), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextRealizeMethodInfo a signature where
overloadedMethod = gLContextRealize
instance O.OverloadedMethodInfo GLContextRealizeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextRealize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextRealize"
})
#endif
foreign import ccall "gdk_gl_context_set_allowed_apis" gdk_gl_context_set_allowed_apis ::
Ptr GLContext ->
CUInt ->
IO ()
gLContextSetAllowedApis ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> [Gdk.Flags.GLAPI]
-> m ()
gLContextSetAllowedApis :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> [GLAPI] -> m ()
gLContextSetAllowedApis a
self [GLAPI]
apis = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let apis' = [GLAPI] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [GLAPI]
apis
gdk_gl_context_set_allowed_apis self' apis'
touchManagedPtr self
return ()
#if defined(ENABLE_OVERLOADING)
data GLContextSetAllowedApisMethodInfo
instance (signature ~ ([Gdk.Flags.GLAPI] -> m ()), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextSetAllowedApisMethodInfo a signature where
overloadedMethod = gLContextSetAllowedApis
instance O.OverloadedMethodInfo GLContextSetAllowedApisMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextSetAllowedApis",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextSetAllowedApis"
})
#endif
foreign import ccall "gdk_gl_context_set_debug_enabled" gdk_gl_context_set_debug_enabled ::
Ptr GLContext ->
CInt ->
IO ()
gLContextSetDebugEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> Bool
-> m ()
gLContextSetDebugEnabled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> Bool -> m ()
gLContextSetDebugEnabled a
context Bool
enabled = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
let enabled' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
enabled
gdk_gl_context_set_debug_enabled context' enabled'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data GLContextSetDebugEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextSetDebugEnabledMethodInfo a signature where
overloadedMethod = gLContextSetDebugEnabled
instance O.OverloadedMethodInfo GLContextSetDebugEnabledMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextSetDebugEnabled",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextSetDebugEnabled"
})
#endif
foreign import ccall "gdk_gl_context_set_forward_compatible" gdk_gl_context_set_forward_compatible ::
Ptr GLContext ->
CInt ->
IO ()
gLContextSetForwardCompatible ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> Bool
-> m ()
gLContextSetForwardCompatible :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> Bool -> m ()
gLContextSetForwardCompatible a
context Bool
compatible = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
let compatible' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
compatible
gdk_gl_context_set_forward_compatible context' compatible'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data GLContextSetForwardCompatibleMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextSetForwardCompatibleMethodInfo a signature where
overloadedMethod = gLContextSetForwardCompatible
instance O.OverloadedMethodInfo GLContextSetForwardCompatibleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextSetForwardCompatible",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextSetForwardCompatible"
})
#endif
foreign import ccall "gdk_gl_context_set_required_version" gdk_gl_context_set_required_version ::
Ptr GLContext ->
Int32 ->
Int32 ->
IO ()
gLContextSetRequiredVersion ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> Int32
-> Int32
-> m ()
gLContextSetRequiredVersion :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> Int32 -> Int32 -> m ()
gLContextSetRequiredVersion a
context Int32
major Int32
minor = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
gdk_gl_context_set_required_version context' major minor
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data GLContextSetRequiredVersionMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextSetRequiredVersionMethodInfo a signature where
overloadedMethod = gLContextSetRequiredVersion
instance O.OverloadedMethodInfo GLContextSetRequiredVersionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextSetRequiredVersion",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextSetRequiredVersion"
})
#endif
foreign import ccall "gdk_gl_context_set_use_es" gdk_gl_context_set_use_es ::
Ptr GLContext ->
Int32 ->
IO ()
gLContextSetUseEs ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> Int32
-> m ()
gLContextSetUseEs :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGLContext a) =>
a -> Int32 -> m ()
gLContextSetUseEs a
context Int32
useEs = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
context' <- a -> IO (Ptr GLContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
gdk_gl_context_set_use_es context' useEs
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING)
data GLContextSetUseEsMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsGLContext a) => O.OverloadedMethod GLContextSetUseEsMethodInfo a signature where
overloadedMethod = gLContextSetUseEs
instance O.OverloadedMethodInfo GLContextSetUseEsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.GLContext.gLContextSetUseEs",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-GLContext.html#v:gLContextSetUseEs"
})
#endif
foreign import ccall "gdk_gl_context_clear_current" gdk_gl_context_clear_current ::
IO ()
gLContextClearCurrent ::
(B.CallStack.HasCallStack, MonadIO m) =>
m ()
gLContextClearCurrent :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m ()
gLContextClearCurrent = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
IO ()
gdk_gl_context_clear_current
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_gl_context_get_current" gdk_gl_context_get_current ::
IO (Ptr GLContext)
gLContextGetCurrent ::
(B.CallStack.HasCallStack, MonadIO m) =>
m (Maybe GLContext)
gLContextGetCurrent :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m (Maybe GLContext)
gLContextGetCurrent = IO (Maybe GLContext) -> m (Maybe GLContext)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GLContext) -> m (Maybe GLContext))
-> IO (Maybe GLContext) -> m (Maybe GLContext)
forall a b. (a -> b) -> a -> b
$ do
result <- IO (Ptr GLContext)
gdk_gl_context_get_current
maybeResult <- convertIfNonNull result $ \Ptr GLContext
result' -> do
result'' <- ((ManagedPtr GLContext -> GLContext)
-> Ptr GLContext -> IO GLContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr GLContext -> GLContext
GLContext) Ptr GLContext
result'
return result''
return maybeResult
#if defined(ENABLE_OVERLOADING)
#endif