{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Surface
(
Surface(..) ,
IsSurface ,
toSurface ,
#if defined(ENABLE_OVERLOADING)
ResolveSurfaceMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SurfaceBeepMethodInfo ,
#endif
surfaceBeep ,
#if defined(ENABLE_OVERLOADING)
SurfaceCreateCairoContextMethodInfo ,
#endif
surfaceCreateCairoContext ,
#if defined(ENABLE_OVERLOADING)
SurfaceCreateGlContextMethodInfo ,
#endif
surfaceCreateGlContext ,
#if defined(ENABLE_OVERLOADING)
SurfaceCreateSimilarSurfaceMethodInfo ,
#endif
surfaceCreateSimilarSurface ,
#if defined(ENABLE_OVERLOADING)
SurfaceCreateVulkanContextMethodInfo ,
#endif
surfaceCreateVulkanContext ,
#if defined(ENABLE_OVERLOADING)
SurfaceDestroyMethodInfo ,
#endif
surfaceDestroy ,
#if defined(ENABLE_OVERLOADING)
SurfaceFreezeUpdatesMethodInfo ,
#endif
surfaceFreezeUpdates ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetCursorMethodInfo ,
#endif
surfaceGetCursor ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetDeviceCursorMethodInfo ,
#endif
surfaceGetDeviceCursor ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetDevicePositionMethodInfo ,
#endif
surfaceGetDevicePosition ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetDisplayMethodInfo ,
#endif
surfaceGetDisplay ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetFrameClockMethodInfo ,
#endif
surfaceGetFrameClock ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetHeightMethodInfo ,
#endif
surfaceGetHeight ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetMappedMethodInfo ,
#endif
surfaceGetMapped ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetScaleFactorMethodInfo ,
#endif
surfaceGetScaleFactor ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetSupportMultideviceMethodInfo ,
#endif
surfaceGetSupportMultidevice ,
#if defined(ENABLE_OVERLOADING)
SurfaceGetWidthMethodInfo ,
#endif
surfaceGetWidth ,
#if defined(ENABLE_OVERLOADING)
SurfaceHideMethodInfo ,
#endif
surfaceHide ,
#if defined(ENABLE_OVERLOADING)
SurfaceIsDestroyedMethodInfo ,
#endif
surfaceIsDestroyed ,
surfaceNewPopup ,
surfaceNewToplevel ,
#if defined(ENABLE_OVERLOADING)
SurfaceQueueExposeMethodInfo ,
#endif
surfaceQueueExpose ,
#if defined(ENABLE_OVERLOADING)
SurfaceSetCursorMethodInfo ,
#endif
surfaceSetCursor ,
#if defined(ENABLE_OVERLOADING)
SurfaceSetDeviceCursorMethodInfo ,
#endif
surfaceSetDeviceCursor ,
#if defined(ENABLE_OVERLOADING)
SurfaceSetInputRegionMethodInfo ,
#endif
surfaceSetInputRegion ,
#if defined(ENABLE_OVERLOADING)
SurfaceSetOpaqueRegionMethodInfo ,
#endif
surfaceSetOpaqueRegion ,
#if defined(ENABLE_OVERLOADING)
SurfaceSetShadowWidthMethodInfo ,
#endif
surfaceSetShadowWidth ,
#if defined(ENABLE_OVERLOADING)
SurfaceSetSupportMultideviceMethodInfo ,
#endif
surfaceSetSupportMultidevice ,
#if defined(ENABLE_OVERLOADING)
SurfaceThawUpdatesMethodInfo ,
#endif
surfaceThawUpdates ,
#if defined(ENABLE_OVERLOADING)
SurfaceTranslateCoordinatesMethodInfo ,
#endif
surfaceTranslateCoordinates ,
#if defined(ENABLE_OVERLOADING)
SurfaceCursorPropertyInfo ,
#endif
clearSurfaceCursor ,
constructSurfaceCursor ,
getSurfaceCursor ,
setSurfaceCursor ,
#if defined(ENABLE_OVERLOADING)
surfaceCursor ,
#endif
#if defined(ENABLE_OVERLOADING)
SurfaceDisplayPropertyInfo ,
#endif
constructSurfaceDisplay ,
getSurfaceDisplay ,
#if defined(ENABLE_OVERLOADING)
surfaceDisplay ,
#endif
#if defined(ENABLE_OVERLOADING)
SurfaceFrameClockPropertyInfo ,
#endif
constructSurfaceFrameClock ,
getSurfaceFrameClock ,
#if defined(ENABLE_OVERLOADING)
surfaceFrameClock ,
#endif
#if defined(ENABLE_OVERLOADING)
SurfaceMappedPropertyInfo ,
#endif
getSurfaceMapped ,
#if defined(ENABLE_OVERLOADING)
surfaceMapped ,
#endif
C_SurfaceEnterMonitorCallback ,
SurfaceEnterMonitorCallback ,
#if defined(ENABLE_OVERLOADING)
SurfaceEnterMonitorSignalInfo ,
#endif
afterSurfaceEnterMonitor ,
genClosure_SurfaceEnterMonitor ,
mk_SurfaceEnterMonitorCallback ,
noSurfaceEnterMonitorCallback ,
onSurfaceEnterMonitor ,
wrap_SurfaceEnterMonitorCallback ,
C_SurfaceEventCallback ,
SurfaceEventCallback ,
#if defined(ENABLE_OVERLOADING)
SurfaceEventSignalInfo ,
#endif
afterSurfaceEvent ,
genClosure_SurfaceEvent ,
mk_SurfaceEventCallback ,
noSurfaceEventCallback ,
onSurfaceEvent ,
wrap_SurfaceEventCallback ,
C_SurfaceLeaveMonitorCallback ,
SurfaceLeaveMonitorCallback ,
#if defined(ENABLE_OVERLOADING)
SurfaceLeaveMonitorSignalInfo ,
#endif
afterSurfaceLeaveMonitor ,
genClosure_SurfaceLeaveMonitor ,
mk_SurfaceLeaveMonitorCallback ,
noSurfaceLeaveMonitorCallback ,
onSurfaceLeaveMonitor ,
wrap_SurfaceLeaveMonitorCallback ,
C_SurfacePopupLayoutChangedCallback ,
SurfacePopupLayoutChangedCallback ,
#if defined(ENABLE_OVERLOADING)
SurfacePopupLayoutChangedSignalInfo ,
#endif
afterSurfacePopupLayoutChanged ,
genClosure_SurfacePopupLayoutChanged ,
mk_SurfacePopupLayoutChangedCallback ,
noSurfacePopupLayoutChangedCallback ,
onSurfacePopupLayoutChanged ,
wrap_SurfacePopupLayoutChangedCallback ,
C_SurfaceRenderCallback ,
SurfaceRenderCallback ,
#if defined(ENABLE_OVERLOADING)
SurfaceRenderSignalInfo ,
#endif
afterSurfaceRender ,
genClosure_SurfaceRender ,
mk_SurfaceRenderCallback ,
noSurfaceRenderCallback ,
onSurfaceRender ,
wrap_SurfaceRenderCallback ,
C_SurfaceSizeChangedCallback ,
SurfaceSizeChangedCallback ,
#if defined(ENABLE_OVERLOADING)
SurfaceSizeChangedSignalInfo ,
#endif
afterSurfaceSizeChanged ,
genClosure_SurfaceSizeChanged ,
mk_SurfaceSizeChangedCallback ,
noSurfaceSizeChangedCallback ,
onSurfaceSizeChanged ,
wrap_SurfaceSizeChangedCallback ,
) 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.Enums as Cairo.Enums
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.CairoContext as Gdk.CairoContext
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.Display as Gdk.Display
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.GLContext as Gdk.GLContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Monitor as Gdk.Monitor
import {-# SOURCE #-} qualified GI.Gdk.Objects.VulkanContext as Gdk.VulkanContext
newtype Surface = Surface (SP.ManagedPtr Surface)
deriving (Surface -> Surface -> Bool
(Surface -> Surface -> Bool)
-> (Surface -> Surface -> Bool) -> Eq Surface
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Surface -> Surface -> Bool
$c/= :: Surface -> Surface -> Bool
== :: Surface -> Surface -> Bool
$c== :: Surface -> Surface -> Bool
Eq)
instance SP.ManagedPtrNewtype Surface where
toManagedPtr :: Surface -> ManagedPtr Surface
toManagedPtr (Surface ManagedPtr Surface
p) = ManagedPtr Surface
p
foreign import ccall "gdk_surface_get_type"
c_gdk_surface_get_type :: IO B.Types.GType
instance B.Types.TypedObject Surface where
glibType :: IO GType
glibType = IO GType
c_gdk_surface_get_type
instance B.Types.GObject Surface
instance B.GValue.IsGValue Surface where
toGValue :: Surface -> IO GValue
toGValue Surface
o = do
GType
gtype <- IO GType
c_gdk_surface_get_type
Surface -> (Ptr Surface -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Surface
o (GType
-> (GValue -> Ptr Surface -> IO ()) -> Ptr Surface -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Surface -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Surface
fromGValue GValue
gv = do
Ptr Surface
ptr <- GValue -> IO (Ptr Surface)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Surface)
(ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Surface -> Surface
Surface Ptr Surface
ptr
class (SP.GObject o, O.IsDescendantOf Surface o) => IsSurface o
instance (SP.GObject o, O.IsDescendantOf Surface o) => IsSurface o
instance O.HasParentTypes Surface
type instance O.ParentTypes Surface = '[GObject.Object.Object]
toSurface :: (MonadIO m, IsSurface o) => o -> m Surface
toSurface :: o -> m Surface
toSurface = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> (o -> IO Surface) -> o -> m Surface
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Surface -> Surface) -> o -> IO Surface
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Surface -> Surface
Surface
#if defined(ENABLE_OVERLOADING)
type family ResolveSurfaceMethod (t :: Symbol) (o :: *) :: * where
ResolveSurfaceMethod "beep" o = SurfaceBeepMethodInfo
ResolveSurfaceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSurfaceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSurfaceMethod "createCairoContext" o = SurfaceCreateCairoContextMethodInfo
ResolveSurfaceMethod "createGlContext" o = SurfaceCreateGlContextMethodInfo
ResolveSurfaceMethod "createSimilarSurface" o = SurfaceCreateSimilarSurfaceMethodInfo
ResolveSurfaceMethod "createVulkanContext" o = SurfaceCreateVulkanContextMethodInfo
ResolveSurfaceMethod "destroy" o = SurfaceDestroyMethodInfo
ResolveSurfaceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSurfaceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSurfaceMethod "freezeUpdates" o = SurfaceFreezeUpdatesMethodInfo
ResolveSurfaceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSurfaceMethod "hide" o = SurfaceHideMethodInfo
ResolveSurfaceMethod "isDestroyed" o = SurfaceIsDestroyedMethodInfo
ResolveSurfaceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSurfaceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSurfaceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSurfaceMethod "queueExpose" o = SurfaceQueueExposeMethodInfo
ResolveSurfaceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSurfaceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSurfaceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSurfaceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSurfaceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSurfaceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSurfaceMethod "thawUpdates" o = SurfaceThawUpdatesMethodInfo
ResolveSurfaceMethod "translateCoordinates" o = SurfaceTranslateCoordinatesMethodInfo
ResolveSurfaceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSurfaceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSurfaceMethod "getCursor" o = SurfaceGetCursorMethodInfo
ResolveSurfaceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSurfaceMethod "getDeviceCursor" o = SurfaceGetDeviceCursorMethodInfo
ResolveSurfaceMethod "getDevicePosition" o = SurfaceGetDevicePositionMethodInfo
ResolveSurfaceMethod "getDisplay" o = SurfaceGetDisplayMethodInfo
ResolveSurfaceMethod "getFrameClock" o = SurfaceGetFrameClockMethodInfo
ResolveSurfaceMethod "getHeight" o = SurfaceGetHeightMethodInfo
ResolveSurfaceMethod "getMapped" o = SurfaceGetMappedMethodInfo
ResolveSurfaceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSurfaceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSurfaceMethod "getScaleFactor" o = SurfaceGetScaleFactorMethodInfo
ResolveSurfaceMethod "getSupportMultidevice" o = SurfaceGetSupportMultideviceMethodInfo
ResolveSurfaceMethod "getWidth" o = SurfaceGetWidthMethodInfo
ResolveSurfaceMethod "setCursor" o = SurfaceSetCursorMethodInfo
ResolveSurfaceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSurfaceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSurfaceMethod "setDeviceCursor" o = SurfaceSetDeviceCursorMethodInfo
ResolveSurfaceMethod "setInputRegion" o = SurfaceSetInputRegionMethodInfo
ResolveSurfaceMethod "setOpaqueRegion" o = SurfaceSetOpaqueRegionMethodInfo
ResolveSurfaceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSurfaceMethod "setShadowWidth" o = SurfaceSetShadowWidthMethodInfo
ResolveSurfaceMethod "setSupportMultidevice" o = SurfaceSetSupportMultideviceMethodInfo
ResolveSurfaceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSurfaceMethod t Surface, O.MethodInfo info Surface p) => OL.IsLabel t (Surface -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type SurfaceEnterMonitorCallback =
Gdk.Monitor.Monitor
-> IO ()
noSurfaceEnterMonitorCallback :: Maybe SurfaceEnterMonitorCallback
noSurfaceEnterMonitorCallback :: Maybe SurfaceEnterMonitorCallback
noSurfaceEnterMonitorCallback = Maybe SurfaceEnterMonitorCallback
forall a. Maybe a
Nothing
type C_SurfaceEnterMonitorCallback =
Ptr () ->
Ptr Gdk.Monitor.Monitor ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SurfaceEnterMonitorCallback :: C_SurfaceEnterMonitorCallback -> IO (FunPtr C_SurfaceEnterMonitorCallback)
genClosure_SurfaceEnterMonitor :: MonadIO m => SurfaceEnterMonitorCallback -> m (GClosure C_SurfaceEnterMonitorCallback)
genClosure_SurfaceEnterMonitor :: SurfaceEnterMonitorCallback
-> m (GClosure C_SurfaceEnterMonitorCallback)
genClosure_SurfaceEnterMonitor SurfaceEnterMonitorCallback
cb = IO (GClosure C_SurfaceEnterMonitorCallback)
-> m (GClosure C_SurfaceEnterMonitorCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceEnterMonitorCallback)
-> m (GClosure C_SurfaceEnterMonitorCallback))
-> IO (GClosure C_SurfaceEnterMonitorCallback)
-> m (GClosure C_SurfaceEnterMonitorCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEnterMonitorCallback
cb' = SurfaceEnterMonitorCallback -> C_SurfaceEnterMonitorCallback
wrap_SurfaceEnterMonitorCallback SurfaceEnterMonitorCallback
cb
C_SurfaceEnterMonitorCallback
-> IO (FunPtr C_SurfaceEnterMonitorCallback)
mk_SurfaceEnterMonitorCallback C_SurfaceEnterMonitorCallback
cb' IO (FunPtr C_SurfaceEnterMonitorCallback)
-> (FunPtr C_SurfaceEnterMonitorCallback
-> IO (GClosure C_SurfaceEnterMonitorCallback))
-> IO (GClosure C_SurfaceEnterMonitorCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceEnterMonitorCallback
-> IO (GClosure C_SurfaceEnterMonitorCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SurfaceEnterMonitorCallback ::
SurfaceEnterMonitorCallback ->
C_SurfaceEnterMonitorCallback
wrap_SurfaceEnterMonitorCallback :: SurfaceEnterMonitorCallback -> C_SurfaceEnterMonitorCallback
wrap_SurfaceEnterMonitorCallback SurfaceEnterMonitorCallback
_cb Ptr ()
_ Ptr Monitor
object Ptr ()
_ = do
Monitor
object' <- ((ManagedPtr Monitor -> Monitor) -> Ptr Monitor -> IO Monitor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Monitor -> Monitor
Gdk.Monitor.Monitor) Ptr Monitor
object
SurfaceEnterMonitorCallback
_cb Monitor
object'
onSurfaceEnterMonitor :: (IsSurface a, MonadIO m) => a -> SurfaceEnterMonitorCallback -> m SignalHandlerId
onSurfaceEnterMonitor :: a -> SurfaceEnterMonitorCallback -> m SignalHandlerId
onSurfaceEnterMonitor a
obj SurfaceEnterMonitorCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEnterMonitorCallback
cb' = SurfaceEnterMonitorCallback -> C_SurfaceEnterMonitorCallback
wrap_SurfaceEnterMonitorCallback SurfaceEnterMonitorCallback
cb
FunPtr C_SurfaceEnterMonitorCallback
cb'' <- C_SurfaceEnterMonitorCallback
-> IO (FunPtr C_SurfaceEnterMonitorCallback)
mk_SurfaceEnterMonitorCallback C_SurfaceEnterMonitorCallback
cb'
a
-> Text
-> FunPtr C_SurfaceEnterMonitorCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"enter-monitor" FunPtr C_SurfaceEnterMonitorCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSurfaceEnterMonitor :: (IsSurface a, MonadIO m) => a -> SurfaceEnterMonitorCallback -> m SignalHandlerId
afterSurfaceEnterMonitor :: a -> SurfaceEnterMonitorCallback -> m SignalHandlerId
afterSurfaceEnterMonitor a
obj SurfaceEnterMonitorCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEnterMonitorCallback
cb' = SurfaceEnterMonitorCallback -> C_SurfaceEnterMonitorCallback
wrap_SurfaceEnterMonitorCallback SurfaceEnterMonitorCallback
cb
FunPtr C_SurfaceEnterMonitorCallback
cb'' <- C_SurfaceEnterMonitorCallback
-> IO (FunPtr C_SurfaceEnterMonitorCallback)
mk_SurfaceEnterMonitorCallback C_SurfaceEnterMonitorCallback
cb'
a
-> Text
-> FunPtr C_SurfaceEnterMonitorCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"enter-monitor" FunPtr C_SurfaceEnterMonitorCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SurfaceEnterMonitorSignalInfo
instance SignalInfo SurfaceEnterMonitorSignalInfo where
type HaskellCallbackType SurfaceEnterMonitorSignalInfo = SurfaceEnterMonitorCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SurfaceEnterMonitorCallback cb
cb'' <- mk_SurfaceEnterMonitorCallback cb'
connectSignalFunPtr obj "enter-monitor" cb'' connectMode detail
#endif
type SurfaceEventCallback =
Gdk.Event.Event
-> IO Bool
noSurfaceEventCallback :: Maybe SurfaceEventCallback
noSurfaceEventCallback :: Maybe SurfaceEventCallback
noSurfaceEventCallback = Maybe SurfaceEventCallback
forall a. Maybe a
Nothing
type C_SurfaceEventCallback =
Ptr () ->
Ptr Gdk.Event.Event ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_SurfaceEventCallback :: C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback)
genClosure_SurfaceEvent :: MonadIO m => SurfaceEventCallback -> m (GClosure C_SurfaceEventCallback)
genClosure_SurfaceEvent :: SurfaceEventCallback -> m (GClosure C_SurfaceEventCallback)
genClosure_SurfaceEvent SurfaceEventCallback
cb = IO (GClosure C_SurfaceEventCallback)
-> m (GClosure C_SurfaceEventCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceEventCallback)
-> m (GClosure C_SurfaceEventCallback))
-> IO (GClosure C_SurfaceEventCallback)
-> m (GClosure C_SurfaceEventCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEventCallback
cb' = SurfaceEventCallback -> C_SurfaceEventCallback
wrap_SurfaceEventCallback SurfaceEventCallback
cb
C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback)
mk_SurfaceEventCallback C_SurfaceEventCallback
cb' IO (FunPtr C_SurfaceEventCallback)
-> (FunPtr C_SurfaceEventCallback
-> IO (GClosure C_SurfaceEventCallback))
-> IO (GClosure C_SurfaceEventCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceEventCallback
-> IO (GClosure C_SurfaceEventCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SurfaceEventCallback ::
SurfaceEventCallback ->
C_SurfaceEventCallback
wrap_SurfaceEventCallback :: SurfaceEventCallback -> C_SurfaceEventCallback
wrap_SurfaceEventCallback SurfaceEventCallback
_cb Ptr ()
_ Ptr Event
event Ptr ()
_ = do
Event
event' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Event -> Event
Gdk.Event.Event) Ptr Event
event
Bool
result <- SurfaceEventCallback
_cb Event
event'
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
onSurfaceEvent :: (IsSurface a, MonadIO m) => a -> SurfaceEventCallback -> m SignalHandlerId
onSurfaceEvent :: a -> SurfaceEventCallback -> m SignalHandlerId
onSurfaceEvent a
obj SurfaceEventCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEventCallback
cb' = SurfaceEventCallback -> C_SurfaceEventCallback
wrap_SurfaceEventCallback SurfaceEventCallback
cb
FunPtr C_SurfaceEventCallback
cb'' <- C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback)
mk_SurfaceEventCallback C_SurfaceEventCallback
cb'
a
-> Text
-> FunPtr C_SurfaceEventCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"event" FunPtr C_SurfaceEventCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSurfaceEvent :: (IsSurface a, MonadIO m) => a -> SurfaceEventCallback -> m SignalHandlerId
afterSurfaceEvent :: a -> SurfaceEventCallback -> m SignalHandlerId
afterSurfaceEvent a
obj SurfaceEventCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEventCallback
cb' = SurfaceEventCallback -> C_SurfaceEventCallback
wrap_SurfaceEventCallback SurfaceEventCallback
cb
FunPtr C_SurfaceEventCallback
cb'' <- C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback)
mk_SurfaceEventCallback C_SurfaceEventCallback
cb'
a
-> Text
-> FunPtr C_SurfaceEventCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"event" FunPtr C_SurfaceEventCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SurfaceEventSignalInfo
instance SignalInfo SurfaceEventSignalInfo where
type HaskellCallbackType SurfaceEventSignalInfo = SurfaceEventCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SurfaceEventCallback cb
cb'' <- mk_SurfaceEventCallback cb'
connectSignalFunPtr obj "event" cb'' connectMode detail
#endif
type SurfaceLeaveMonitorCallback =
Gdk.Monitor.Monitor
-> IO ()
noSurfaceLeaveMonitorCallback :: Maybe SurfaceLeaveMonitorCallback
noSurfaceLeaveMonitorCallback :: Maybe SurfaceEnterMonitorCallback
noSurfaceLeaveMonitorCallback = Maybe SurfaceEnterMonitorCallback
forall a. Maybe a
Nothing
type C_SurfaceLeaveMonitorCallback =
Ptr () ->
Ptr Gdk.Monitor.Monitor ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SurfaceLeaveMonitorCallback :: C_SurfaceLeaveMonitorCallback -> IO (FunPtr C_SurfaceLeaveMonitorCallback)
genClosure_SurfaceLeaveMonitor :: MonadIO m => SurfaceLeaveMonitorCallback -> m (GClosure C_SurfaceLeaveMonitorCallback)
genClosure_SurfaceLeaveMonitor :: SurfaceEnterMonitorCallback
-> m (GClosure C_SurfaceEnterMonitorCallback)
genClosure_SurfaceLeaveMonitor SurfaceEnterMonitorCallback
cb = IO (GClosure C_SurfaceEnterMonitorCallback)
-> m (GClosure C_SurfaceEnterMonitorCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceEnterMonitorCallback)
-> m (GClosure C_SurfaceEnterMonitorCallback))
-> IO (GClosure C_SurfaceEnterMonitorCallback)
-> m (GClosure C_SurfaceEnterMonitorCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEnterMonitorCallback
cb' = SurfaceEnterMonitorCallback -> C_SurfaceEnterMonitorCallback
wrap_SurfaceLeaveMonitorCallback SurfaceEnterMonitorCallback
cb
C_SurfaceEnterMonitorCallback
-> IO (FunPtr C_SurfaceEnterMonitorCallback)
mk_SurfaceLeaveMonitorCallback C_SurfaceEnterMonitorCallback
cb' IO (FunPtr C_SurfaceEnterMonitorCallback)
-> (FunPtr C_SurfaceEnterMonitorCallback
-> IO (GClosure C_SurfaceEnterMonitorCallback))
-> IO (GClosure C_SurfaceEnterMonitorCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceEnterMonitorCallback
-> IO (GClosure C_SurfaceEnterMonitorCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SurfaceLeaveMonitorCallback ::
SurfaceLeaveMonitorCallback ->
C_SurfaceLeaveMonitorCallback
wrap_SurfaceLeaveMonitorCallback :: SurfaceEnterMonitorCallback -> C_SurfaceEnterMonitorCallback
wrap_SurfaceLeaveMonitorCallback SurfaceEnterMonitorCallback
_cb Ptr ()
_ Ptr Monitor
object Ptr ()
_ = do
Monitor
object' <- ((ManagedPtr Monitor -> Monitor) -> Ptr Monitor -> IO Monitor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Monitor -> Monitor
Gdk.Monitor.Monitor) Ptr Monitor
object
SurfaceEnterMonitorCallback
_cb Monitor
object'
onSurfaceLeaveMonitor :: (IsSurface a, MonadIO m) => a -> SurfaceLeaveMonitorCallback -> m SignalHandlerId
onSurfaceLeaveMonitor :: a -> SurfaceEnterMonitorCallback -> m SignalHandlerId
onSurfaceLeaveMonitor a
obj SurfaceEnterMonitorCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEnterMonitorCallback
cb' = SurfaceEnterMonitorCallback -> C_SurfaceEnterMonitorCallback
wrap_SurfaceLeaveMonitorCallback SurfaceEnterMonitorCallback
cb
FunPtr C_SurfaceEnterMonitorCallback
cb'' <- C_SurfaceEnterMonitorCallback
-> IO (FunPtr C_SurfaceEnterMonitorCallback)
mk_SurfaceLeaveMonitorCallback C_SurfaceEnterMonitorCallback
cb'
a
-> Text
-> FunPtr C_SurfaceEnterMonitorCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"leave-monitor" FunPtr C_SurfaceEnterMonitorCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSurfaceLeaveMonitor :: (IsSurface a, MonadIO m) => a -> SurfaceLeaveMonitorCallback -> m SignalHandlerId
afterSurfaceLeaveMonitor :: a -> SurfaceEnterMonitorCallback -> m SignalHandlerId
afterSurfaceLeaveMonitor a
obj SurfaceEnterMonitorCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceEnterMonitorCallback
cb' = SurfaceEnterMonitorCallback -> C_SurfaceEnterMonitorCallback
wrap_SurfaceLeaveMonitorCallback SurfaceEnterMonitorCallback
cb
FunPtr C_SurfaceEnterMonitorCallback
cb'' <- C_SurfaceEnterMonitorCallback
-> IO (FunPtr C_SurfaceEnterMonitorCallback)
mk_SurfaceLeaveMonitorCallback C_SurfaceEnterMonitorCallback
cb'
a
-> Text
-> FunPtr C_SurfaceEnterMonitorCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"leave-monitor" FunPtr C_SurfaceEnterMonitorCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SurfaceLeaveMonitorSignalInfo
instance SignalInfo SurfaceLeaveMonitorSignalInfo where
type HaskellCallbackType SurfaceLeaveMonitorSignalInfo = SurfaceLeaveMonitorCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SurfaceLeaveMonitorCallback cb
cb'' <- mk_SurfaceLeaveMonitorCallback cb'
connectSignalFunPtr obj "leave-monitor" cb'' connectMode detail
#endif
type =
IO ()
noSurfacePopupLayoutChangedCallback :: Maybe SurfacePopupLayoutChangedCallback
= Maybe (IO ())
forall a. Maybe a
Nothing
type =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
:: C_SurfacePopupLayoutChangedCallback -> IO (FunPtr C_SurfacePopupLayoutChangedCallback)
genClosure_SurfacePopupLayoutChanged :: MonadIO m => SurfacePopupLayoutChangedCallback -> m (GClosure C_SurfacePopupLayoutChangedCallback)
IO ()
cb = IO (GClosure C_SurfacePopupLayoutChangedCallback)
-> m (GClosure C_SurfacePopupLayoutChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfacePopupLayoutChangedCallback)
-> m (GClosure C_SurfacePopupLayoutChangedCallback))
-> IO (GClosure C_SurfacePopupLayoutChangedCallback)
-> m (GClosure C_SurfacePopupLayoutChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfacePopupLayoutChangedCallback
cb' = IO () -> C_SurfacePopupLayoutChangedCallback
wrap_SurfacePopupLayoutChangedCallback IO ()
cb
C_SurfacePopupLayoutChangedCallback
-> IO (FunPtr C_SurfacePopupLayoutChangedCallback)
mk_SurfacePopupLayoutChangedCallback C_SurfacePopupLayoutChangedCallback
cb' IO (FunPtr C_SurfacePopupLayoutChangedCallback)
-> (FunPtr C_SurfacePopupLayoutChangedCallback
-> IO (GClosure C_SurfacePopupLayoutChangedCallback))
-> IO (GClosure C_SurfacePopupLayoutChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfacePopupLayoutChangedCallback
-> IO (GClosure C_SurfacePopupLayoutChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SurfacePopupLayoutChangedCallback ::
SurfacePopupLayoutChangedCallback ->
C_SurfacePopupLayoutChangedCallback
IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onSurfacePopupLayoutChanged :: (IsSurface a, MonadIO m) => a -> SurfacePopupLayoutChangedCallback -> m SignalHandlerId
a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfacePopupLayoutChangedCallback
cb' = IO () -> C_SurfacePopupLayoutChangedCallback
wrap_SurfacePopupLayoutChangedCallback IO ()
cb
FunPtr C_SurfacePopupLayoutChangedCallback
cb'' <- C_SurfacePopupLayoutChangedCallback
-> IO (FunPtr C_SurfacePopupLayoutChangedCallback)
mk_SurfacePopupLayoutChangedCallback C_SurfacePopupLayoutChangedCallback
cb'
a
-> Text
-> FunPtr C_SurfacePopupLayoutChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"popup-layout-changed" FunPtr C_SurfacePopupLayoutChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSurfacePopupLayoutChanged :: (IsSurface a, MonadIO m) => a -> SurfacePopupLayoutChangedCallback -> m SignalHandlerId
a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfacePopupLayoutChangedCallback
cb' = IO () -> C_SurfacePopupLayoutChangedCallback
wrap_SurfacePopupLayoutChangedCallback IO ()
cb
FunPtr C_SurfacePopupLayoutChangedCallback
cb'' <- C_SurfacePopupLayoutChangedCallback
-> IO (FunPtr C_SurfacePopupLayoutChangedCallback)
mk_SurfacePopupLayoutChangedCallback C_SurfacePopupLayoutChangedCallback
cb'
a
-> Text
-> FunPtr C_SurfacePopupLayoutChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"popup-layout-changed" FunPtr C_SurfacePopupLayoutChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SurfacePopupLayoutChangedSignalInfo
instance SignalInfo SurfacePopupLayoutChangedSignalInfo where
type HaskellCallbackType SurfacePopupLayoutChangedSignalInfo = SurfacePopupLayoutChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SurfacePopupLayoutChangedCallback cb
cb'' <- mk_SurfacePopupLayoutChangedCallback cb'
connectSignalFunPtr obj "popup-layout-changed" cb'' connectMode detail
#endif
type SurfaceRenderCallback =
Cairo.Region.Region
-> IO Bool
noSurfaceRenderCallback :: Maybe SurfaceRenderCallback
noSurfaceRenderCallback :: Maybe SurfaceRenderCallback
noSurfaceRenderCallback = Maybe SurfaceRenderCallback
forall a. Maybe a
Nothing
type C_SurfaceRenderCallback =
Ptr () ->
Ptr Cairo.Region.Region ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_SurfaceRenderCallback :: C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback)
genClosure_SurfaceRender :: MonadIO m => SurfaceRenderCallback -> m (GClosure C_SurfaceRenderCallback)
genClosure_SurfaceRender :: SurfaceRenderCallback -> m (GClosure C_SurfaceRenderCallback)
genClosure_SurfaceRender SurfaceRenderCallback
cb = IO (GClosure C_SurfaceRenderCallback)
-> m (GClosure C_SurfaceRenderCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceRenderCallback)
-> m (GClosure C_SurfaceRenderCallback))
-> IO (GClosure C_SurfaceRenderCallback)
-> m (GClosure C_SurfaceRenderCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceRenderCallback
cb' = SurfaceRenderCallback -> C_SurfaceRenderCallback
wrap_SurfaceRenderCallback SurfaceRenderCallback
cb
C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback)
mk_SurfaceRenderCallback C_SurfaceRenderCallback
cb' IO (FunPtr C_SurfaceRenderCallback)
-> (FunPtr C_SurfaceRenderCallback
-> IO (GClosure C_SurfaceRenderCallback))
-> IO (GClosure C_SurfaceRenderCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceRenderCallback
-> IO (GClosure C_SurfaceRenderCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SurfaceRenderCallback ::
SurfaceRenderCallback ->
C_SurfaceRenderCallback
wrap_SurfaceRenderCallback :: SurfaceRenderCallback -> C_SurfaceRenderCallback
wrap_SurfaceRenderCallback SurfaceRenderCallback
_cb Ptr ()
_ Ptr Region
region Ptr ()
_ = do
(ManagedPtr Region -> Region)
-> Ptr Region -> (Region -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Region -> Region
Cairo.Region.Region Ptr Region
region ((Region -> IO CInt) -> IO CInt) -> (Region -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Region
region' -> do
Bool
result <- SurfaceRenderCallback
_cb Region
region'
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
onSurfaceRender :: (IsSurface a, MonadIO m) => a -> SurfaceRenderCallback -> m SignalHandlerId
onSurfaceRender :: a -> SurfaceRenderCallback -> m SignalHandlerId
onSurfaceRender a
obj SurfaceRenderCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceRenderCallback
cb' = SurfaceRenderCallback -> C_SurfaceRenderCallback
wrap_SurfaceRenderCallback SurfaceRenderCallback
cb
FunPtr C_SurfaceRenderCallback
cb'' <- C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback)
mk_SurfaceRenderCallback C_SurfaceRenderCallback
cb'
a
-> Text
-> FunPtr C_SurfaceRenderCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"render" FunPtr C_SurfaceRenderCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSurfaceRender :: (IsSurface a, MonadIO m) => a -> SurfaceRenderCallback -> m SignalHandlerId
afterSurfaceRender :: a -> SurfaceRenderCallback -> m SignalHandlerId
afterSurfaceRender a
obj SurfaceRenderCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceRenderCallback
cb' = SurfaceRenderCallback -> C_SurfaceRenderCallback
wrap_SurfaceRenderCallback SurfaceRenderCallback
cb
FunPtr C_SurfaceRenderCallback
cb'' <- C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback)
mk_SurfaceRenderCallback C_SurfaceRenderCallback
cb'
a
-> Text
-> FunPtr C_SurfaceRenderCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"render" FunPtr C_SurfaceRenderCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SurfaceRenderSignalInfo
instance SignalInfo SurfaceRenderSignalInfo where
type HaskellCallbackType SurfaceRenderSignalInfo = SurfaceRenderCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SurfaceRenderCallback cb
cb'' <- mk_SurfaceRenderCallback cb'
connectSignalFunPtr obj "render" cb'' connectMode detail
#endif
type SurfaceSizeChangedCallback =
Int32
-> Int32
-> IO ()
noSurfaceSizeChangedCallback :: Maybe SurfaceSizeChangedCallback
noSurfaceSizeChangedCallback :: Maybe SurfaceSizeChangedCallback
noSurfaceSizeChangedCallback = Maybe SurfaceSizeChangedCallback
forall a. Maybe a
Nothing
type C_SurfaceSizeChangedCallback =
Ptr () ->
Int32 ->
Int32 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SurfaceSizeChangedCallback :: C_SurfaceSizeChangedCallback -> IO (FunPtr C_SurfaceSizeChangedCallback)
genClosure_SurfaceSizeChanged :: MonadIO m => SurfaceSizeChangedCallback -> m (GClosure C_SurfaceSizeChangedCallback)
genClosure_SurfaceSizeChanged :: SurfaceSizeChangedCallback
-> m (GClosure C_SurfaceSizeChangedCallback)
genClosure_SurfaceSizeChanged SurfaceSizeChangedCallback
cb = IO (GClosure C_SurfaceSizeChangedCallback)
-> m (GClosure C_SurfaceSizeChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceSizeChangedCallback)
-> m (GClosure C_SurfaceSizeChangedCallback))
-> IO (GClosure C_SurfaceSizeChangedCallback)
-> m (GClosure C_SurfaceSizeChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceSizeChangedCallback
cb' = SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback SurfaceSizeChangedCallback
cb
C_SurfaceSizeChangedCallback
-> IO (FunPtr C_SurfaceSizeChangedCallback)
mk_SurfaceSizeChangedCallback C_SurfaceSizeChangedCallback
cb' IO (FunPtr C_SurfaceSizeChangedCallback)
-> (FunPtr C_SurfaceSizeChangedCallback
-> IO (GClosure C_SurfaceSizeChangedCallback))
-> IO (GClosure C_SurfaceSizeChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceSizeChangedCallback
-> IO (GClosure C_SurfaceSizeChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SurfaceSizeChangedCallback ::
SurfaceSizeChangedCallback ->
C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback :: SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback SurfaceSizeChangedCallback
_cb Ptr ()
_ Int32
width Int32
height Ptr ()
_ = do
SurfaceSizeChangedCallback
_cb Int32
width Int32
height
onSurfaceSizeChanged :: (IsSurface a, MonadIO m) => a -> SurfaceSizeChangedCallback -> m SignalHandlerId
onSurfaceSizeChanged :: a -> SurfaceSizeChangedCallback -> m SignalHandlerId
onSurfaceSizeChanged a
obj SurfaceSizeChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceSizeChangedCallback
cb' = SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback SurfaceSizeChangedCallback
cb
FunPtr C_SurfaceSizeChangedCallback
cb'' <- C_SurfaceSizeChangedCallback
-> IO (FunPtr C_SurfaceSizeChangedCallback)
mk_SurfaceSizeChangedCallback C_SurfaceSizeChangedCallback
cb'
a
-> Text
-> FunPtr C_SurfaceSizeChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"size-changed" FunPtr C_SurfaceSizeChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSurfaceSizeChanged :: (IsSurface a, MonadIO m) => a -> SurfaceSizeChangedCallback -> m SignalHandlerId
afterSurfaceSizeChanged :: a -> SurfaceSizeChangedCallback -> m SignalHandlerId
afterSurfaceSizeChanged a
obj SurfaceSizeChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SurfaceSizeChangedCallback
cb' = SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback SurfaceSizeChangedCallback
cb
FunPtr C_SurfaceSizeChangedCallback
cb'' <- C_SurfaceSizeChangedCallback
-> IO (FunPtr C_SurfaceSizeChangedCallback)
mk_SurfaceSizeChangedCallback C_SurfaceSizeChangedCallback
cb'
a
-> Text
-> FunPtr C_SurfaceSizeChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"size-changed" FunPtr C_SurfaceSizeChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SurfaceSizeChangedSignalInfo
instance SignalInfo SurfaceSizeChangedSignalInfo where
type HaskellCallbackType SurfaceSizeChangedSignalInfo = SurfaceSizeChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SurfaceSizeChangedCallback cb
cb'' <- mk_SurfaceSizeChangedCallback cb'
connectSignalFunPtr obj "size-changed" cb'' connectMode detail
#endif
getSurfaceCursor :: (MonadIO m, IsSurface o) => o -> m (Maybe Gdk.Cursor.Cursor)
getSurfaceCursor :: o -> m (Maybe Cursor)
getSurfaceCursor o
obj = IO (Maybe Cursor) -> m (Maybe Cursor)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Cursor -> Cursor) -> IO (Maybe Cursor)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"cursor" ManagedPtr Cursor -> Cursor
Gdk.Cursor.Cursor
setSurfaceCursor :: (MonadIO m, IsSurface o, Gdk.Cursor.IsCursor a) => o -> a -> m ()
setSurfaceCursor :: o -> a -> m ()
setSurfaceCursor o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"cursor" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructSurfaceCursor :: (IsSurface o, MIO.MonadIO m, Gdk.Cursor.IsCursor a) => a -> m (GValueConstruct o)
constructSurfaceCursor :: a -> m (GValueConstruct o)
constructSurfaceCursor 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
"cursor" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
clearSurfaceCursor :: (MonadIO m, IsSurface o) => o -> m ()
clearSurfaceCursor :: o -> m ()
clearSurfaceCursor o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Cursor -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"cursor" (Maybe Cursor
forall a. Maybe a
Nothing :: Maybe Gdk.Cursor.Cursor)
#if defined(ENABLE_OVERLOADING)
data SurfaceCursorPropertyInfo
instance AttrInfo SurfaceCursorPropertyInfo where
type AttrAllowedOps SurfaceCursorPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SurfaceCursorPropertyInfo = IsSurface
type AttrSetTypeConstraint SurfaceCursorPropertyInfo = Gdk.Cursor.IsCursor
type AttrTransferTypeConstraint SurfaceCursorPropertyInfo = Gdk.Cursor.IsCursor
type AttrTransferType SurfaceCursorPropertyInfo = Gdk.Cursor.Cursor
type AttrGetType SurfaceCursorPropertyInfo = (Maybe Gdk.Cursor.Cursor)
type AttrLabel SurfaceCursorPropertyInfo = "cursor"
type AttrOrigin SurfaceCursorPropertyInfo = Surface
attrGet = getSurfaceCursor
attrSet = setSurfaceCursor
attrTransfer _ v = do
unsafeCastTo Gdk.Cursor.Cursor v
attrConstruct = constructSurfaceCursor
attrClear = clearSurfaceCursor
#endif
getSurfaceDisplay :: (MonadIO m, IsSurface o) => o -> m Gdk.Display.Display
getSurfaceDisplay :: o -> m Display
getSurfaceDisplay o
obj = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Display) -> IO Display
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getSurfaceDisplay" (IO (Maybe Display) -> IO Display)
-> IO (Maybe Display) -> IO 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
constructSurfaceDisplay :: (IsSurface o, MIO.MonadIO m, Gdk.Display.IsDisplay a) => a -> m (GValueConstruct o)
constructSurfaceDisplay :: a -> m (GValueConstruct o)
constructSurfaceDisplay 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
"display" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data SurfaceDisplayPropertyInfo
instance AttrInfo SurfaceDisplayPropertyInfo where
type AttrAllowedOps SurfaceDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SurfaceDisplayPropertyInfo = IsSurface
type AttrSetTypeConstraint SurfaceDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferTypeConstraint SurfaceDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferType SurfaceDisplayPropertyInfo = Gdk.Display.Display
type AttrGetType SurfaceDisplayPropertyInfo = Gdk.Display.Display
type AttrLabel SurfaceDisplayPropertyInfo = "display"
type AttrOrigin SurfaceDisplayPropertyInfo = Surface
attrGet = getSurfaceDisplay
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Display.Display v
attrConstruct = constructSurfaceDisplay
attrClear = undefined
#endif
getSurfaceFrameClock :: (MonadIO m, IsSurface o) => o -> m Gdk.FrameClock.FrameClock
getSurfaceFrameClock :: o -> m FrameClock
getSurfaceFrameClock o
obj = IO FrameClock -> m FrameClock
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FrameClock -> m FrameClock) -> IO FrameClock -> m FrameClock
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe FrameClock) -> IO FrameClock
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getSurfaceFrameClock" (IO (Maybe FrameClock) -> IO FrameClock)
-> IO (Maybe FrameClock) -> IO FrameClock
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr FrameClock -> FrameClock)
-> IO (Maybe FrameClock)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"frame-clock" ManagedPtr FrameClock -> FrameClock
Gdk.FrameClock.FrameClock
constructSurfaceFrameClock :: (IsSurface o, MIO.MonadIO m, Gdk.FrameClock.IsFrameClock a) => a -> m (GValueConstruct o)
constructSurfaceFrameClock :: a -> m (GValueConstruct o)
constructSurfaceFrameClock 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
"frame-clock" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data SurfaceFrameClockPropertyInfo
instance AttrInfo SurfaceFrameClockPropertyInfo where
type AttrAllowedOps SurfaceFrameClockPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SurfaceFrameClockPropertyInfo = IsSurface
type AttrSetTypeConstraint SurfaceFrameClockPropertyInfo = Gdk.FrameClock.IsFrameClock
type AttrTransferTypeConstraint SurfaceFrameClockPropertyInfo = Gdk.FrameClock.IsFrameClock
type AttrTransferType SurfaceFrameClockPropertyInfo = Gdk.FrameClock.FrameClock
type AttrGetType SurfaceFrameClockPropertyInfo = Gdk.FrameClock.FrameClock
type AttrLabel SurfaceFrameClockPropertyInfo = "frame-clock"
type AttrOrigin SurfaceFrameClockPropertyInfo = Surface
attrGet = getSurfaceFrameClock
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.FrameClock.FrameClock v
attrConstruct = constructSurfaceFrameClock
attrClear = undefined
#endif
getSurfaceMapped :: (MonadIO m, IsSurface o) => o -> m Bool
getSurfaceMapped :: o -> m Bool
getSurfaceMapped o
obj = 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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"mapped"
#if defined(ENABLE_OVERLOADING)
data SurfaceMappedPropertyInfo
instance AttrInfo SurfaceMappedPropertyInfo where
type AttrAllowedOps SurfaceMappedPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint SurfaceMappedPropertyInfo = IsSurface
type AttrSetTypeConstraint SurfaceMappedPropertyInfo = (~) ()
type AttrTransferTypeConstraint SurfaceMappedPropertyInfo = (~) ()
type AttrTransferType SurfaceMappedPropertyInfo = ()
type AttrGetType SurfaceMappedPropertyInfo = Bool
type AttrLabel SurfaceMappedPropertyInfo = "mapped"
type AttrOrigin SurfaceMappedPropertyInfo = Surface
attrGet = getSurfaceMapped
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Surface
type instance O.AttributeList Surface = SurfaceAttributeList
type SurfaceAttributeList = ('[ '("cursor", SurfaceCursorPropertyInfo), '("display", SurfaceDisplayPropertyInfo), '("frameClock", SurfaceFrameClockPropertyInfo), '("mapped", SurfaceMappedPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
surfaceCursor :: AttrLabelProxy "cursor"
surfaceCursor = AttrLabelProxy
surfaceDisplay :: AttrLabelProxy "display"
surfaceDisplay = AttrLabelProxy
surfaceFrameClock :: AttrLabelProxy "frameClock"
surfaceFrameClock = AttrLabelProxy
surfaceMapped :: AttrLabelProxy "mapped"
surfaceMapped = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Surface = SurfaceSignalList
type SurfaceSignalList = ('[ '("enterMonitor", SurfaceEnterMonitorSignalInfo), '("event", SurfaceEventSignalInfo), '("leaveMonitor", SurfaceLeaveMonitorSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("popupLayoutChanged", SurfacePopupLayoutChangedSignalInfo), '("render", SurfaceRenderSignalInfo), '("sizeChanged", SurfaceSizeChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_surface_new_popup" ::
Ptr Surface ->
CInt ->
IO (Ptr Surface)
surfaceNewPopup ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> Bool
-> m Surface
a
parent Bool
autohide = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
parent' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
parent
let autohide' :: CInt
autohide' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
autohide
Ptr Surface
result <- Ptr Surface -> CInt -> IO (Ptr Surface)
gdk_surface_new_popup Ptr Surface
parent' CInt
autohide'
Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"surfaceNewPopup" Ptr Surface
result
Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
parent
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_surface_new_toplevel" gdk_surface_new_toplevel ::
Ptr Gdk.Display.Display ->
Int32 ->
Int32 ->
IO (Ptr Surface)
surfaceNewToplevel ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
a
-> Int32
-> Int32
-> m Surface
surfaceNewToplevel :: a -> Int32 -> Int32 -> m Surface
surfaceNewToplevel a
display Int32
width Int32
height = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
Ptr Surface
result <- Ptr Display -> Int32 -> Int32 -> IO (Ptr Surface)
gdk_surface_new_toplevel Ptr Display
display' Int32
width Int32
height
Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"surfaceNewToplevel" Ptr Surface
result
Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_surface_beep" gdk_surface_beep ::
Ptr Surface ->
IO ()
surfaceBeep ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m ()
surfaceBeep :: a -> m ()
surfaceBeep a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Surface -> IO ()
gdk_surface_beep Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceBeepMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceBeepMethodInfo a signature where
overloadedMethod = surfaceBeep
#endif
foreign import ccall "gdk_surface_create_cairo_context" gdk_surface_create_cairo_context ::
Ptr Surface ->
IO (Ptr Gdk.CairoContext.CairoContext)
surfaceCreateCairoContext ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Gdk.CairoContext.CairoContext
surfaceCreateCairoContext :: a -> m CairoContext
surfaceCreateCairoContext a
surface = IO CairoContext -> m CairoContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CairoContext -> m CairoContext)
-> IO CairoContext -> m CairoContext
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr CairoContext
result <- Ptr Surface -> IO (Ptr CairoContext)
gdk_surface_create_cairo_context Ptr Surface
surface'
Text -> Ptr CairoContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"surfaceCreateCairoContext" Ptr CairoContext
result
CairoContext
result' <- ((ManagedPtr CairoContext -> CairoContext)
-> Ptr CairoContext -> IO CairoContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr CairoContext -> CairoContext
Gdk.CairoContext.CairoContext) Ptr CairoContext
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
CairoContext -> IO CairoContext
forall (m :: * -> *) a. Monad m => a -> m a
return CairoContext
result'
#if defined(ENABLE_OVERLOADING)
data SurfaceCreateCairoContextMethodInfo
instance (signature ~ (m Gdk.CairoContext.CairoContext), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCreateCairoContextMethodInfo a signature where
overloadedMethod = surfaceCreateCairoContext
#endif
foreign import ccall "gdk_surface_create_gl_context" gdk_surface_create_gl_context ::
Ptr Surface ->
Ptr (Ptr GError) ->
IO (Ptr Gdk.GLContext.GLContext)
surfaceCreateGlContext ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Gdk.GLContext.GLContext
surfaceCreateGlContext :: a -> m GLContext
surfaceCreateGlContext a
surface = IO GLContext -> m GLContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GLContext -> m GLContext) -> IO GLContext -> m GLContext
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
IO GLContext -> IO () -> IO GLContext
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GLContext
result <- (Ptr (Ptr GError) -> IO (Ptr GLContext)) -> IO (Ptr GLContext)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GLContext)) -> IO (Ptr GLContext))
-> (Ptr (Ptr GError) -> IO (Ptr GLContext)) -> IO (Ptr GLContext)
forall a b. (a -> b) -> a -> b
$ Ptr Surface -> Ptr (Ptr GError) -> IO (Ptr GLContext)
gdk_surface_create_gl_context Ptr Surface
surface'
Text -> Ptr GLContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"surfaceCreateGlContext" Ptr GLContext
result
GLContext
result' <- ((ManagedPtr GLContext -> GLContext)
-> Ptr GLContext -> IO GLContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr GLContext -> GLContext
Gdk.GLContext.GLContext) Ptr GLContext
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
GLContext -> IO GLContext
forall (m :: * -> *) a. Monad m => a -> m a
return GLContext
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SurfaceCreateGlContextMethodInfo
instance (signature ~ (m Gdk.GLContext.GLContext), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCreateGlContextMethodInfo a signature where
overloadedMethod = surfaceCreateGlContext
#endif
foreign import ccall "gdk_surface_create_similar_surface" gdk_surface_create_similar_surface ::
Ptr Surface ->
CUInt ->
Int32 ->
Int32 ->
IO (Ptr Cairo.Surface.Surface)
surfaceCreateSimilarSurface ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> Cairo.Enums.Content
-> Int32
-> Int32
-> m Cairo.Surface.Surface
surfaceCreateSimilarSurface :: a -> Content -> Int32 -> Int32 -> m Surface
surfaceCreateSimilarSurface a
surface Content
content Int32
width Int32
height = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
let content' :: CUInt
content' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Content -> Int) -> Content -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Content -> Int
forall a. Enum a => a -> Int
fromEnum) Content
content
Ptr Surface
result <- Ptr Surface -> CUInt -> Int32 -> Int32 -> IO (Ptr Surface)
gdk_surface_create_similar_surface Ptr Surface
surface' CUInt
content' Int32
width Int32
height
Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"surfaceCreateSimilarSurface" Ptr Surface
result
Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Surface -> Surface
Cairo.Surface.Surface) Ptr Surface
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'
#if defined(ENABLE_OVERLOADING)
data SurfaceCreateSimilarSurfaceMethodInfo
instance (signature ~ (Cairo.Enums.Content -> Int32 -> Int32 -> m Cairo.Surface.Surface), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCreateSimilarSurfaceMethodInfo a signature where
overloadedMethod = surfaceCreateSimilarSurface
#endif
foreign import ccall "gdk_surface_create_vulkan_context" gdk_surface_create_vulkan_context ::
Ptr Surface ->
Ptr (Ptr GError) ->
IO (Ptr Gdk.VulkanContext.VulkanContext)
surfaceCreateVulkanContext ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Gdk.VulkanContext.VulkanContext
surfaceCreateVulkanContext :: a -> m VulkanContext
surfaceCreateVulkanContext a
surface = IO VulkanContext -> m VulkanContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VulkanContext -> m VulkanContext)
-> IO VulkanContext -> m VulkanContext
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
IO VulkanContext -> IO () -> IO VulkanContext
forall a b. IO a -> IO b -> IO a
onException (do
Ptr VulkanContext
result <- (Ptr (Ptr GError) -> IO (Ptr VulkanContext))
-> IO (Ptr VulkanContext)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr VulkanContext))
-> IO (Ptr VulkanContext))
-> (Ptr (Ptr GError) -> IO (Ptr VulkanContext))
-> IO (Ptr VulkanContext)
forall a b. (a -> b) -> a -> b
$ Ptr Surface -> Ptr (Ptr GError) -> IO (Ptr VulkanContext)
gdk_surface_create_vulkan_context Ptr Surface
surface'
Text -> Ptr VulkanContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"surfaceCreateVulkanContext" Ptr VulkanContext
result
VulkanContext
result' <- ((ManagedPtr VulkanContext -> VulkanContext)
-> Ptr VulkanContext -> IO VulkanContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr VulkanContext -> VulkanContext
Gdk.VulkanContext.VulkanContext) Ptr VulkanContext
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
VulkanContext -> IO VulkanContext
forall (m :: * -> *) a. Monad m => a -> m a
return VulkanContext
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SurfaceCreateVulkanContextMethodInfo
instance (signature ~ (m Gdk.VulkanContext.VulkanContext), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCreateVulkanContextMethodInfo a signature where
overloadedMethod = surfaceCreateVulkanContext
#endif
foreign import ccall "gdk_surface_destroy" gdk_surface_destroy ::
Ptr Surface ->
IO ()
surfaceDestroy ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m ()
surfaceDestroy :: a -> m ()
surfaceDestroy a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Surface -> IO ()
gdk_surface_destroy Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceDestroyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceDestroyMethodInfo a signature where
overloadedMethod = surfaceDestroy
#endif
foreign import ccall "gdk_surface_freeze_updates" gdk_surface_freeze_updates ::
Ptr Surface ->
IO ()
surfaceFreezeUpdates ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m ()
surfaceFreezeUpdates :: a -> m ()
surfaceFreezeUpdates a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Surface -> IO ()
gdk_surface_freeze_updates Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceFreezeUpdatesMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceFreezeUpdatesMethodInfo a signature where
overloadedMethod = surfaceFreezeUpdates
#endif
foreign import ccall "gdk_surface_get_cursor" gdk_surface_get_cursor ::
Ptr Surface ->
IO (Ptr Gdk.Cursor.Cursor)
surfaceGetCursor ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m (Maybe Gdk.Cursor.Cursor)
surfaceGetCursor :: a -> m (Maybe Cursor)
surfaceGetCursor a
surface = IO (Maybe Cursor) -> m (Maybe Cursor)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Cursor
result <- Ptr Surface -> IO (Ptr Cursor)
gdk_surface_get_cursor Ptr Surface
surface'
Maybe Cursor
maybeResult <- Ptr Cursor -> (Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Cursor
result ((Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor))
-> (Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ \Ptr Cursor
result' -> do
Cursor
result'' <- ((ManagedPtr Cursor -> Cursor) -> Ptr Cursor -> IO Cursor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Cursor -> Cursor
Gdk.Cursor.Cursor) Ptr Cursor
result'
Cursor -> IO Cursor
forall (m :: * -> *) a. Monad m => a -> m a
return Cursor
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
Maybe Cursor -> IO (Maybe Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Cursor
maybeResult
#if defined(ENABLE_OVERLOADING)
data SurfaceGetCursorMethodInfo
instance (signature ~ (m (Maybe Gdk.Cursor.Cursor)), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetCursorMethodInfo a signature where
overloadedMethod = surfaceGetCursor
#endif
foreign import ccall "gdk_surface_get_device_cursor" gdk_surface_get_device_cursor ::
Ptr Surface ->
Ptr Gdk.Device.Device ->
IO (Ptr Gdk.Cursor.Cursor)
surfaceGetDeviceCursor ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Device.IsDevice b) =>
a
-> b
-> m (Maybe Gdk.Cursor.Cursor)
surfaceGetDeviceCursor :: a -> b -> m (Maybe Cursor)
surfaceGetDeviceCursor a
surface b
device = IO (Maybe Cursor) -> m (Maybe Cursor)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
Ptr Cursor
result <- Ptr Surface -> Ptr Device -> IO (Ptr Cursor)
gdk_surface_get_device_cursor Ptr Surface
surface' Ptr Device
device'
Maybe Cursor
maybeResult <- Ptr Cursor -> (Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Cursor
result ((Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor))
-> (Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ \Ptr Cursor
result' -> do
Cursor
result'' <- ((ManagedPtr Cursor -> Cursor) -> Ptr Cursor -> IO Cursor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Cursor -> Cursor
Gdk.Cursor.Cursor) Ptr Cursor
result'
Cursor -> IO Cursor
forall (m :: * -> *) a. Monad m => a -> m a
return Cursor
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
Maybe Cursor -> IO (Maybe Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Cursor
maybeResult
#if defined(ENABLE_OVERLOADING)
data SurfaceGetDeviceCursorMethodInfo
instance (signature ~ (b -> m (Maybe Gdk.Cursor.Cursor)), MonadIO m, IsSurface a, Gdk.Device.IsDevice b) => O.MethodInfo SurfaceGetDeviceCursorMethodInfo a signature where
overloadedMethod = surfaceGetDeviceCursor
#endif
foreign import ccall "gdk_surface_get_device_position" gdk_surface_get_device_position ::
Ptr Surface ->
Ptr Gdk.Device.Device ->
Ptr CDouble ->
Ptr CDouble ->
Ptr CUInt ->
IO ()
surfaceGetDevicePosition ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Device.IsDevice b) =>
a
-> b
-> m ((Double, Double, [Gdk.Flags.ModifierType]))
surfaceGetDevicePosition :: a -> b -> m (Double, Double, [ModifierType])
surfaceGetDevicePosition a
surface b
device = IO (Double, Double, [ModifierType])
-> m (Double, Double, [ModifierType])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Double, Double, [ModifierType])
-> m (Double, Double, [ModifierType]))
-> IO (Double, Double, [ModifierType])
-> m (Double, Double, [ModifierType])
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
Ptr CDouble
x <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
y <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CUInt
mask <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
Ptr Surface
-> Ptr Device -> Ptr CDouble -> Ptr CDouble -> Ptr CUInt -> IO ()
gdk_surface_get_device_position Ptr Surface
surface' Ptr Device
device' Ptr CDouble
x Ptr CDouble
y Ptr CUInt
mask
CDouble
x' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
x
let x'' :: Double
x'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
x'
CDouble
y' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
y
let y'' :: Double
y'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
y'
CUInt
mask' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
mask
let mask'' :: [ModifierType]
mask'' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
mask'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
x
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
y
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
mask
(Double, Double, [ModifierType])
-> IO (Double, Double, [ModifierType])
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
x'', Double
y'', [ModifierType]
mask'')
#if defined(ENABLE_OVERLOADING)
data SurfaceGetDevicePositionMethodInfo
instance (signature ~ (b -> m ((Double, Double, [Gdk.Flags.ModifierType]))), MonadIO m, IsSurface a, Gdk.Device.IsDevice b) => O.MethodInfo SurfaceGetDevicePositionMethodInfo a signature where
overloadedMethod = surfaceGetDevicePosition
#endif
foreign import ccall "gdk_surface_get_display" gdk_surface_get_display ::
Ptr Surface ->
IO (Ptr Gdk.Display.Display)
surfaceGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Gdk.Display.Display
surfaceGetDisplay :: a -> m Display
surfaceGetDisplay a
surface = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Display
result <- Ptr Surface -> IO (Ptr Display)
gdk_surface_get_display Ptr Surface
surface'
Text -> Ptr Display -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"surfaceGetDisplay" Ptr Display
result
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
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result'
#if defined(ENABLE_OVERLOADING)
data SurfaceGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetDisplayMethodInfo a signature where
overloadedMethod = surfaceGetDisplay
#endif
foreign import ccall "gdk_surface_get_frame_clock" gdk_surface_get_frame_clock ::
Ptr Surface ->
IO (Ptr Gdk.FrameClock.FrameClock)
surfaceGetFrameClock ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Gdk.FrameClock.FrameClock
surfaceGetFrameClock :: a -> m FrameClock
surfaceGetFrameClock a
surface = IO FrameClock -> m FrameClock
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FrameClock -> m FrameClock) -> IO FrameClock -> m FrameClock
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr FrameClock
result <- Ptr Surface -> IO (Ptr FrameClock)
gdk_surface_get_frame_clock Ptr Surface
surface'
Text -> Ptr FrameClock -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"surfaceGetFrameClock" Ptr FrameClock
result
FrameClock
result' <- ((ManagedPtr FrameClock -> FrameClock)
-> Ptr FrameClock -> IO FrameClock
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr FrameClock -> FrameClock
Gdk.FrameClock.FrameClock) Ptr FrameClock
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
FrameClock -> IO FrameClock
forall (m :: * -> *) a. Monad m => a -> m a
return FrameClock
result'
#if defined(ENABLE_OVERLOADING)
data SurfaceGetFrameClockMethodInfo
instance (signature ~ (m Gdk.FrameClock.FrameClock), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetFrameClockMethodInfo a signature where
overloadedMethod = surfaceGetFrameClock
#endif
foreign import ccall "gdk_surface_get_height" gdk_surface_get_height ::
Ptr Surface ->
IO Int32
surfaceGetHeight ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Int32
surfaceGetHeight :: a -> m Int32
surfaceGetHeight a
surface = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Int32
result <- Ptr Surface -> IO Int32
gdk_surface_get_height Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data SurfaceGetHeightMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetHeightMethodInfo a signature where
overloadedMethod = surfaceGetHeight
#endif
foreign import ccall "gdk_surface_get_mapped" gdk_surface_get_mapped ::
Ptr Surface ->
IO CInt
surfaceGetMapped ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Bool
surfaceGetMapped :: a -> m Bool
surfaceGetMapped a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
CInt
result <- Ptr Surface -> IO CInt
gdk_surface_get_mapped Ptr Surface
surface'
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
surface
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SurfaceGetMappedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetMappedMethodInfo a signature where
overloadedMethod = surfaceGetMapped
#endif
foreign import ccall "gdk_surface_get_scale_factor" gdk_surface_get_scale_factor ::
Ptr Surface ->
IO Int32
surfaceGetScaleFactor ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Int32
surfaceGetScaleFactor :: a -> m Int32
surfaceGetScaleFactor a
surface = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Int32
result <- Ptr Surface -> IO Int32
gdk_surface_get_scale_factor Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data SurfaceGetScaleFactorMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetScaleFactorMethodInfo a signature where
overloadedMethod = surfaceGetScaleFactor
#endif
foreign import ccall "gdk_surface_get_support_multidevice" gdk_surface_get_support_multidevice ::
Ptr Surface ->
IO CInt
surfaceGetSupportMultidevice ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Bool
surfaceGetSupportMultidevice :: a -> m Bool
surfaceGetSupportMultidevice a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
CInt
result <- Ptr Surface -> IO CInt
gdk_surface_get_support_multidevice Ptr Surface
surface'
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
surface
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SurfaceGetSupportMultideviceMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetSupportMultideviceMethodInfo a signature where
overloadedMethod = surfaceGetSupportMultidevice
#endif
foreign import ccall "gdk_surface_get_width" gdk_surface_get_width ::
Ptr Surface ->
IO Int32
surfaceGetWidth ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Int32
surfaceGetWidth :: a -> m Int32
surfaceGetWidth a
surface = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Int32
result <- Ptr Surface -> IO Int32
gdk_surface_get_width Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data SurfaceGetWidthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetWidthMethodInfo a signature where
overloadedMethod = surfaceGetWidth
#endif
foreign import ccall "gdk_surface_hide" gdk_surface_hide ::
Ptr Surface ->
IO ()
surfaceHide ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m ()
surfaceHide :: a -> m ()
surfaceHide a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Surface -> IO ()
gdk_surface_hide Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceHideMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceHideMethodInfo a signature where
overloadedMethod = surfaceHide
#endif
foreign import ccall "gdk_surface_is_destroyed" gdk_surface_is_destroyed ::
Ptr Surface ->
IO CInt
surfaceIsDestroyed ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m Bool
surfaceIsDestroyed :: a -> m Bool
surfaceIsDestroyed a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
CInt
result <- Ptr Surface -> IO CInt
gdk_surface_is_destroyed Ptr Surface
surface'
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
surface
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SurfaceIsDestroyedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceIsDestroyedMethodInfo a signature where
overloadedMethod = surfaceIsDestroyed
#endif
foreign import ccall "gdk_surface_queue_expose" gdk_surface_queue_expose ::
Ptr Surface ->
IO ()
surfaceQueueExpose ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m ()
surfaceQueueExpose :: a -> m ()
surfaceQueueExpose a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Surface -> IO ()
gdk_surface_queue_expose Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceQueueExposeMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceQueueExposeMethodInfo a signature where
overloadedMethod = surfaceQueueExpose
#endif
foreign import ccall "gdk_surface_set_cursor" gdk_surface_set_cursor ::
Ptr Surface ->
Ptr Gdk.Cursor.Cursor ->
IO ()
surfaceSetCursor ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Cursor.IsCursor b) =>
a
-> Maybe (b)
-> m ()
surfaceSetCursor :: a -> Maybe b -> m ()
surfaceSetCursor a
surface Maybe b
cursor = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Cursor
maybeCursor <- case Maybe b
cursor of
Maybe b
Nothing -> Ptr Cursor -> IO (Ptr Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cursor
forall a. Ptr a
nullPtr
Just b
jCursor -> do
Ptr Cursor
jCursor' <- b -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCursor
Ptr Cursor -> IO (Ptr Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cursor
jCursor'
Ptr Surface -> Ptr Cursor -> IO ()
gdk_surface_set_cursor Ptr Surface
surface' Ptr Cursor
maybeCursor
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cursor b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceSetCursorMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSurface a, Gdk.Cursor.IsCursor b) => O.MethodInfo SurfaceSetCursorMethodInfo a signature where
overloadedMethod = surfaceSetCursor
#endif
foreign import ccall "gdk_surface_set_device_cursor" gdk_surface_set_device_cursor ::
Ptr Surface ->
Ptr Gdk.Device.Device ->
Ptr Gdk.Cursor.Cursor ->
IO ()
surfaceSetDeviceCursor ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Device.IsDevice b, Gdk.Cursor.IsCursor c) =>
a
-> b
-> c
-> m ()
surfaceSetDeviceCursor :: a -> b -> c -> m ()
surfaceSetDeviceCursor a
surface b
device c
cursor = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
Ptr Cursor
cursor' <- c -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
cursor
Ptr Surface -> Ptr Device -> Ptr Cursor -> IO ()
gdk_surface_set_device_cursor Ptr Surface
surface' Ptr Device
device' Ptr Cursor
cursor'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
cursor
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceSetDeviceCursorMethodInfo
instance (signature ~ (b -> c -> m ()), MonadIO m, IsSurface a, Gdk.Device.IsDevice b, Gdk.Cursor.IsCursor c) => O.MethodInfo SurfaceSetDeviceCursorMethodInfo a signature where
overloadedMethod = surfaceSetDeviceCursor
#endif
foreign import ccall "gdk_surface_set_input_region" gdk_surface_set_input_region ::
Ptr Surface ->
Ptr Cairo.Region.Region ->
IO ()
surfaceSetInputRegion ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> Cairo.Region.Region
-> m ()
surfaceSetInputRegion :: a -> Region -> m ()
surfaceSetInputRegion a
surface 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Region
region' <- Region -> IO (Ptr Region)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Region
region
Ptr Surface -> Ptr Region -> IO ()
gdk_surface_set_input_region Ptr Surface
surface' Ptr Region
region'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
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 SurfaceSetInputRegionMethodInfo
instance (signature ~ (Cairo.Region.Region -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetInputRegionMethodInfo a signature where
overloadedMethod = surfaceSetInputRegion
#endif
foreign import ccall "gdk_surface_set_opaque_region" gdk_surface_set_opaque_region ::
Ptr Surface ->
Ptr Cairo.Region.Region ->
IO ()
surfaceSetOpaqueRegion ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> Maybe (Cairo.Region.Region)
-> m ()
surfaceSetOpaqueRegion :: a -> Maybe Region -> m ()
surfaceSetOpaqueRegion a
surface Maybe 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Region
maybeRegion <- case Maybe Region
region of
Maybe Region
Nothing -> Ptr Region -> IO (Ptr Region)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Region
forall a. Ptr a
nullPtr
Just Region
jRegion -> do
Ptr Region
jRegion' <- Region -> IO (Ptr Region)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Region
jRegion
Ptr Region -> IO (Ptr Region)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Region
jRegion'
Ptr Surface -> Ptr Region -> IO ()
gdk_surface_set_opaque_region Ptr Surface
surface' Ptr Region
maybeRegion
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
Maybe Region -> (Region -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Region
region Region -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceSetOpaqueRegionMethodInfo
instance (signature ~ (Maybe (Cairo.Region.Region) -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetOpaqueRegionMethodInfo a signature where
overloadedMethod = surfaceSetOpaqueRegion
#endif
foreign import ccall "gdk_surface_set_shadow_width" gdk_surface_set_shadow_width ::
Ptr Surface ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
IO ()
surfaceSetShadowWidth ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> Int32
-> Int32
-> Int32
-> Int32
-> m ()
surfaceSetShadowWidth :: a -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
surfaceSetShadowWidth a
surface Int32
left Int32
right Int32
top Int32
bottom = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Surface -> Int32 -> Int32 -> SurfaceSizeChangedCallback
gdk_surface_set_shadow_width Ptr Surface
surface' Int32
left Int32
right Int32
top Int32
bottom
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceSetShadowWidthMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetShadowWidthMethodInfo a signature where
overloadedMethod = surfaceSetShadowWidth
#endif
foreign import ccall "gdk_surface_set_support_multidevice" gdk_surface_set_support_multidevice ::
Ptr Surface ->
CInt ->
IO ()
surfaceSetSupportMultidevice ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> Bool
-> m ()
surfaceSetSupportMultidevice :: a -> Bool -> m ()
surfaceSetSupportMultidevice a
surface Bool
supportMultidevice = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
let supportMultidevice' :: CInt
supportMultidevice' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
supportMultidevice
Ptr Surface -> CInt -> IO ()
gdk_surface_set_support_multidevice Ptr Surface
surface' CInt
supportMultidevice'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceSetSupportMultideviceMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetSupportMultideviceMethodInfo a signature where
overloadedMethod = surfaceSetSupportMultidevice
#endif
foreign import ccall "gdk_surface_thaw_updates" gdk_surface_thaw_updates ::
Ptr Surface ->
IO ()
surfaceThawUpdates ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
a
-> m ()
surfaceThawUpdates :: a -> m ()
surfaceThawUpdates a
surface = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Surface -> IO ()
gdk_surface_thaw_updates Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SurfaceThawUpdatesMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceThawUpdatesMethodInfo a signature where
overloadedMethod = surfaceThawUpdates
#endif
foreign import ccall "gdk_surface_translate_coordinates" gdk_surface_translate_coordinates ::
Ptr Surface ->
Ptr Surface ->
CDouble ->
CDouble ->
IO CInt
surfaceTranslateCoordinates ::
(B.CallStack.HasCallStack, MonadIO m, IsSurface a, IsSurface b) =>
a
-> b
-> Double
-> Double
-> m Bool
surfaceTranslateCoordinates :: a -> b -> Double -> Double -> m Bool
surfaceTranslateCoordinates a
from b
to Double
x Double
y = 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 Surface
from' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
from
Ptr Surface
to' <- b -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
to
let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
CInt
result <- Ptr Surface -> Ptr Surface -> CDouble -> CDouble -> IO CInt
gdk_surface_translate_coordinates Ptr Surface
from' Ptr Surface
to' CDouble
x' CDouble
y'
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
from
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
to
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SurfaceTranslateCoordinatesMethodInfo
instance (signature ~ (b -> Double -> Double -> m Bool), MonadIO m, IsSurface a, IsSurface b) => O.MethodInfo SurfaceTranslateCoordinatesMethodInfo a signature where
overloadedMethod = surfaceTranslateCoordinates
#endif