-- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte -- License : LGPL-2.1 -- Maintainer : Iñaki García Etxebarria #if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__)) #define ENABLE_OVERLOADING #endif module GI.Gdk.Functions ( -- * Methods -- ** addOptionEntriesLibgtkOnly #method:addOptionEntriesLibgtkOnly# addOptionEntriesLibgtkOnly , -- ** beep #method:beep# beep , -- ** cairoCreate #method:cairoCreate# cairoCreate , -- ** cairoDrawFromGl #method:cairoDrawFromGl# cairoDrawFromGl , -- ** cairoGetClipRectangle #method:cairoGetClipRectangle# cairoGetClipRectangle , -- ** cairoGetDrawingContext #method:cairoGetDrawingContext# cairoGetDrawingContext , -- ** cairoRectangle #method:cairoRectangle# cairoRectangle , -- ** cairoRegion #method:cairoRegion# cairoRegion , -- ** cairoRegionCreateFromSurface #method:cairoRegionCreateFromSurface# cairoRegionCreateFromSurface , -- ** cairoSetSourceColor #method:cairoSetSourceColor# cairoSetSourceColor , -- ** cairoSetSourcePixbuf #method:cairoSetSourcePixbuf# cairoSetSourcePixbuf , -- ** cairoSetSourceRgba #method:cairoSetSourceRgba# cairoSetSourceRgba , -- ** cairoSetSourceWindow #method:cairoSetSourceWindow# cairoSetSourceWindow , -- ** cairoSurfaceCreateFromPixbuf #method:cairoSurfaceCreateFromPixbuf# cairoSurfaceCreateFromPixbuf , -- ** disableMultidevice #method:disableMultidevice# disableMultidevice , -- ** dragAbort #method:dragAbort# dragAbort , -- ** dragBegin #method:dragBegin# dragBegin , -- ** dragBeginForDevice #method:dragBeginForDevice# dragBeginForDevice , -- ** dragBeginFromPoint #method:dragBeginFromPoint# dragBeginFromPoint , -- ** dragDrop #method:dragDrop# dragDrop , -- ** dragDropDone #method:dragDropDone# dragDropDone , -- ** dragDropSucceeded #method:dragDropSucceeded# dragDropSucceeded , -- ** dragFindWindowForScreen #method:dragFindWindowForScreen# dragFindWindowForScreen , -- ** dragGetSelection #method:dragGetSelection# dragGetSelection , -- ** dragMotion #method:dragMotion# dragMotion , -- ** dragStatus #method:dragStatus# dragStatus , -- ** dropFinish #method:dropFinish# dropFinish , -- ** dropReply #method:dropReply# dropReply , -- ** errorTrapPop #method:errorTrapPop# errorTrapPop , -- ** errorTrapPopIgnored #method:errorTrapPopIgnored# errorTrapPopIgnored , -- ** errorTrapPush #method:errorTrapPush# errorTrapPush , -- ** eventsGetAngle #method:eventsGetAngle# eventsGetAngle , -- ** eventsGetCenter #method:eventsGetCenter# eventsGetCenter , -- ** eventsGetDistance #method:eventsGetDistance# eventsGetDistance , -- ** eventsPending #method:eventsPending# eventsPending , -- ** flush #method:flush# flush , -- ** getDefaultRootWindow #method:getDefaultRootWindow# getDefaultRootWindow , -- ** getDisplay #method:getDisplay# getDisplay , -- ** getDisplayArgName #method:getDisplayArgName# getDisplayArgName , -- ** getProgramClass #method:getProgramClass# getProgramClass , -- ** getShowEvents #method:getShowEvents# getShowEvents , -- ** init #method:init# init , -- ** initCheck #method:initCheck# initCheck , -- ** keyboardGrab #method:keyboardGrab# keyboardGrab , -- ** keyboardUngrab #method:keyboardUngrab# keyboardUngrab , -- ** keyvalConvertCase #method:keyvalConvertCase# keyvalConvertCase , -- ** keyvalFromName #method:keyvalFromName# keyvalFromName , -- ** keyvalIsLower #method:keyvalIsLower# keyvalIsLower , -- ** keyvalIsUpper #method:keyvalIsUpper# keyvalIsUpper , -- ** keyvalName #method:keyvalName# keyvalName , -- ** keyvalToLower #method:keyvalToLower# keyvalToLower , -- ** keyvalToUnicode #method:keyvalToUnicode# keyvalToUnicode , -- ** keyvalToUpper #method:keyvalToUpper# keyvalToUpper , -- ** listVisuals #method:listVisuals# listVisuals , -- ** notifyStartupComplete #method:notifyStartupComplete# notifyStartupComplete , -- ** notifyStartupCompleteWithId #method:notifyStartupCompleteWithId# notifyStartupCompleteWithId , -- ** offscreenWindowGetEmbedder #method:offscreenWindowGetEmbedder# offscreenWindowGetEmbedder , -- ** offscreenWindowGetSurface #method:offscreenWindowGetSurface# offscreenWindowGetSurface , -- ** offscreenWindowSetEmbedder #method:offscreenWindowSetEmbedder# offscreenWindowSetEmbedder , -- ** pangoContextGet #method:pangoContextGet# pangoContextGet , -- ** pangoContextGetForDisplay #method:pangoContextGetForDisplay# pangoContextGetForDisplay , -- ** pangoContextGetForScreen #method:pangoContextGetForScreen# pangoContextGetForScreen , -- ** parseArgs #method:parseArgs# parseArgs , -- ** pixbufGetFromSurface #method:pixbufGetFromSurface# pixbufGetFromSurface , -- ** pixbufGetFromWindow #method:pixbufGetFromWindow# pixbufGetFromWindow , -- ** pointerGrab #method:pointerGrab# pointerGrab , -- ** pointerIsGrabbed #method:pointerIsGrabbed# pointerIsGrabbed , -- ** pointerUngrab #method:pointerUngrab# pointerUngrab , -- ** preParseLibgtkOnly #method:preParseLibgtkOnly# preParseLibgtkOnly , -- ** propertyDelete #method:propertyDelete# propertyDelete , -- ** queryDepths #method:queryDepths# queryDepths , -- ** queryVisualTypes #method:queryVisualTypes# queryVisualTypes , -- ** selectionConvert #method:selectionConvert# selectionConvert , -- ** selectionOwnerGet #method:selectionOwnerGet# selectionOwnerGet , -- ** selectionOwnerGetForDisplay #method:selectionOwnerGetForDisplay# selectionOwnerGetForDisplay , -- ** selectionOwnerSet #method:selectionOwnerSet# selectionOwnerSet , -- ** selectionOwnerSetForDisplay #method:selectionOwnerSetForDisplay# selectionOwnerSetForDisplay , -- ** selectionSendNotify #method:selectionSendNotify# selectionSendNotify , -- ** selectionSendNotifyForDisplay #method:selectionSendNotifyForDisplay# selectionSendNotifyForDisplay , -- ** setAllowedBackends #method:setAllowedBackends# setAllowedBackends , -- ** setDoubleClickTime #method:setDoubleClickTime# setDoubleClickTime , -- ** setProgramClass #method:setProgramClass# setProgramClass , -- ** setShowEvents #method:setShowEvents# setShowEvents , -- ** settingGet #method:settingGet# settingGet , -- ** synthesizeWindowState #method:synthesizeWindowState# synthesizeWindowState , -- ** testRenderSync #method:testRenderSync# testRenderSync , -- ** testSimulateButton #method:testSimulateButton# testSimulateButton , -- ** testSimulateKey #method:testSimulateKey# testSimulateKey , -- ** textPropertyToUtf8ListForDisplay #method:textPropertyToUtf8ListForDisplay# textPropertyToUtf8ListForDisplay , -- ** threadsAddIdle #method:threadsAddIdle# threadsAddIdle , -- ** threadsAddTimeout #method:threadsAddTimeout# threadsAddTimeout , -- ** threadsAddTimeoutSeconds #method:threadsAddTimeoutSeconds# threadsAddTimeoutSeconds , -- ** threadsEnter #method:threadsEnter# threadsEnter , -- ** threadsInit #method:threadsInit# threadsInit , -- ** threadsLeave #method:threadsLeave# threadsLeave , -- ** unicodeToKeyval #method:unicodeToKeyval# unicodeToKeyval , -- ** utf8ToStringTarget #method:utf8ToStringTarget# utf8ToStringTarget , ) where import Data.GI.Base.ShortPrelude import qualified Data.GI.Base.ShortPrelude as SP import qualified Data.GI.Base.Overloading as O import qualified Prelude as P import qualified Data.GI.Base.Attributes as GI.Attributes import qualified Data.GI.Base.BasicTypes as B.Types import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr import qualified Data.GI.Base.GClosure as B.GClosure import qualified Data.GI.Base.GError as B.GError import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GValue as B.GValue import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack import qualified Data.GI.Base.Properties as B.Properties import qualified Data.GI.Base.Signals as B.Signals import qualified Control.Monad.IO.Class as MIO import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import qualified Foreign.Ptr as FP import qualified GHC.OverloadedLabels as OL import qualified GI.Cairo.Structs.Context as Cairo.Context import qualified GI.Cairo.Structs.Region as Cairo.Region import qualified GI.Cairo.Structs.Surface as Cairo.Surface import qualified GI.GLib.Callbacks as GLib.Callbacks import qualified GI.GLib.Structs.OptionGroup as GLib.OptionGroup import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags 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.DragContext as Gdk.DragContext import {-# SOURCE #-} qualified GI.Gdk.Objects.DrawingContext as Gdk.DrawingContext import {-# SOURCE #-} qualified GI.Gdk.Objects.Screen as Gdk.Screen import {-# SOURCE #-} qualified GI.Gdk.Objects.Visual as Gdk.Visual import {-# SOURCE #-} qualified GI.Gdk.Objects.Window as Gdk.Window import {-# SOURCE #-} qualified GI.Gdk.Structs.Atom as Gdk.Atom import {-# SOURCE #-} qualified GI.Gdk.Structs.Color as Gdk.Color import {-# SOURCE #-} qualified GI.Gdk.Structs.RGBA as Gdk.RGBA import {-# SOURCE #-} qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle import {-# SOURCE #-} qualified GI.Gdk.Unions.Event as Gdk.Event import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf import qualified GI.Pango.Objects.Context as Pango.Context -- function utf8_to_string_target -- Args: [ Arg -- { argCName = "str" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a UTF-8 string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gdk_utf8_to_string_target" gdk_utf8_to_string_target :: CString -> -- str : TBasicType TUTF8 IO CString -- | Converts an UTF-8 string into the best possible representation -- as a STRING. The representation of characters not in STRING -- is not specified; it may be as pseudo-escape sequences -- \\x{ABCD}, or it may be in some other form of approximation. utf8ToStringTarget :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@str@/: a UTF-8 string -> m (Maybe T.Text) -- ^ __Returns:__ the newly-allocated string, or 'P.Nothing' if the -- conversion failed. (It should not fail for any properly -- formed UTF-8 string unless system limits like memory or -- file descriptors are exceeded.) utf8ToStringTarget :: Text -> m (Maybe Text) utf8ToStringTarget Text str = IO (Maybe Text) -> m (Maybe Text) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Text) -> m (Maybe Text)) -> IO (Maybe Text) -> m (Maybe Text) forall a b. (a -> b) -> a -> b $ do CString str' <- Text -> IO CString textToCString Text str CString result <- CString -> IO CString gdk_utf8_to_string_target CString str' Maybe Text maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString result ((CString -> IO Text) -> IO (Maybe Text)) -> (CString -> IO Text) -> IO (Maybe Text) forall a b. (a -> b) -> a -> b $ \CString result' -> do Text result'' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result' CString -> IO () forall a. Ptr a -> IO () freeMem CString result' Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result'' CString -> IO () forall a. Ptr a -> IO () freeMem CString str' Maybe Text -> IO (Maybe Text) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Text maybeResult -- function unicode_to_keyval -- Args: [ Arg -- { argCName = "wc" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a ISO10646 encoded character" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gdk_unicode_to_keyval" gdk_unicode_to_keyval :: Word32 -> -- wc : TBasicType TUInt32 IO Word32 -- | Convert from a ISO10646 character to a key symbol. unicodeToKeyval :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@wc@/: a ISO10646 encoded character -> m Word32 -- ^ __Returns:__ the corresponding GDK key symbol, if one exists. -- or, if there is no corresponding symbol, -- wc | 0x01000000 unicodeToKeyval :: Word32 -> m Word32 unicodeToKeyval Word32 wc = IO Word32 -> m Word32 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do Word32 result <- Word32 -> IO Word32 gdk_unicode_to_keyval Word32 wc Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function threads_leave -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_threads_leave" gdk_threads_leave :: IO () {-# DEPRECATED threadsLeave ["(Since version 3.6)","All GDK and GTK+ calls should be made from the main"," thread"] #-} -- | Leaves a critical region begun with 'GI.Gdk.Functions.threadsEnter'. threadsLeave :: (B.CallStack.HasCallStack, MonadIO m) => m () threadsLeave :: m () threadsLeave = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gdk_threads_leave () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function threads_init -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_threads_init" gdk_threads_init :: IO () {-# DEPRECATED threadsInit ["(Since version 3.6)","All GDK and GTK+ calls should be made from the main"," thread"] #-} -- | Initializes GDK so that it can be used from multiple threads -- in conjunction with 'GI.Gdk.Functions.threadsEnter' and 'GI.Gdk.Functions.threadsLeave'. -- -- This call must be made before any use of the main loop from -- GTK+; to be safe, call it before @/gtk_init()/@. threadsInit :: (B.CallStack.HasCallStack, MonadIO m) => m () threadsInit :: m () threadsInit = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gdk_threads_init () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function threads_enter -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_threads_enter" gdk_threads_enter :: IO () {-# DEPRECATED threadsEnter ["(Since version 3.6)","All GDK and GTK+ calls should be made from the main"," thread"] #-} -- | This function marks the beginning of a critical section in which -- GDK and GTK+ functions can be called safely and without causing race -- conditions. Only one thread at a time can be in such a critial -- section. threadsEnter :: (B.CallStack.HasCallStack, MonadIO m) => m () threadsEnter :: m () threadsEnter = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gdk_threads_enter () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function threads_add_timeout_seconds -- Args: [ Arg -- { argCName = "priority" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the priority of the timeout source. Typically this will be in the\n range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "interval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the time between calls to the function, in seconds" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "function" -- , argType = -- TInterface Name { namespace = "GLib" , name = "SourceFunc" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "function to call" , sinceVersion = Nothing } -- , argScope = ScopeTypeNotified -- , argClosure = 3 -- , argDestroy = 4 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "data to pass to @function" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "notify" -- , argType = -- TInterface Name { namespace = "GLib" , name = "DestroyNotify" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "function to call when the timeout is removed, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gdk_threads_add_timeout_seconds_full" gdk_threads_add_timeout_seconds_full :: Int32 -> -- priority : TBasicType TInt Word32 -> -- interval : TBasicType TUInt FunPtr GLib.Callbacks.C_SourceFunc -> -- function : TInterface (Name {namespace = "GLib", name = "SourceFunc"}) Ptr () -> -- data : TBasicType TPtr FunPtr GLib.Callbacks.C_DestroyNotify -> -- notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"}) IO Word32 -- | A variant of 'GI.Gdk.Functions.threadsAddTimeout' with second-granularity. -- See 'GI.GLib.Functions.timeoutAddSeconds' for a discussion of why it is -- a good idea to use this function if you don’t need finer granularity. -- -- /Since: 2.14/ threadsAddTimeoutSeconds :: (B.CallStack.HasCallStack, MonadIO m) => Int32 -- ^ /@priority@/: the priority of the timeout source. Typically this will be in the -- range between 'GI.GLib.Constants.PRIORITY_DEFAULT_IDLE' and 'GI.GLib.Constants.PRIORITY_HIGH_IDLE'. -> Word32 -- ^ /@interval@/: the time between calls to the function, in seconds -> GLib.Callbacks.SourceFunc -- ^ /@function@/: function to call -> m Word32 -- ^ __Returns:__ the ID (greater than 0) of the event source. threadsAddTimeoutSeconds :: Int32 -> Word32 -> SourceFunc -> m Word32 threadsAddTimeoutSeconds Int32 priority Word32 interval SourceFunc function = IO Word32 -> m Word32 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do FunPtr C_SourceFunc function' <- C_SourceFunc -> IO (FunPtr C_SourceFunc) GLib.Callbacks.mk_SourceFunc (Maybe (Ptr (FunPtr C_SourceFunc)) -> SourceFunc_WithClosures -> C_SourceFunc GLib.Callbacks.wrap_SourceFunc Maybe (Ptr (FunPtr C_SourceFunc)) forall a. Maybe a Nothing (SourceFunc -> SourceFunc_WithClosures GLib.Callbacks.drop_closures_SourceFunc SourceFunc function)) let data_ :: Ptr () data_ = FunPtr C_SourceFunc -> Ptr () forall a b. FunPtr a -> Ptr b castFunPtrToPtr FunPtr C_SourceFunc function' let notify :: FunPtr (Ptr a -> IO ()) notify = FunPtr (Ptr a -> IO ()) forall a. FunPtr (Ptr a -> IO ()) safeFreeFunPtrPtr Word32 result <- Int32 -> Word32 -> FunPtr C_SourceFunc -> Ptr () -> FunPtr C_DestroyNotify -> IO Word32 gdk_threads_add_timeout_seconds_full Int32 priority Word32 interval FunPtr C_SourceFunc function' Ptr () data_ FunPtr C_DestroyNotify forall a. FunPtr (Ptr a -> IO ()) notify Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function threads_add_timeout -- Args: [ Arg -- { argCName = "priority" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the priority of the timeout source. Typically this will be in the\n range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "interval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the time between calls to the function, in milliseconds\n (1/1000ths of a second)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "function" -- , argType = -- TInterface Name { namespace = "GLib" , name = "SourceFunc" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "function to call" , sinceVersion = Nothing } -- , argScope = ScopeTypeNotified -- , argClosure = 3 -- , argDestroy = 4 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "data to pass to @function" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "notify" -- , argType = -- TInterface Name { namespace = "GLib" , name = "DestroyNotify" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "function to call when the timeout is removed, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gdk_threads_add_timeout_full" gdk_threads_add_timeout_full :: Int32 -> -- priority : TBasicType TInt Word32 -> -- interval : TBasicType TUInt FunPtr GLib.Callbacks.C_SourceFunc -> -- function : TInterface (Name {namespace = "GLib", name = "SourceFunc"}) Ptr () -> -- data : TBasicType TPtr FunPtr GLib.Callbacks.C_DestroyNotify -> -- notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"}) IO Word32 -- | Sets a function to be called at regular intervals holding the GDK lock, -- with the given priority. The function is called repeatedly until it -- returns 'P.False', at which point the timeout is automatically destroyed -- and the function will not be called again. The /@notify@/ function is -- called when the timeout is destroyed. The first call to the -- function will be at the end of the first /@interval@/. -- -- Note that timeout functions may be delayed, due to the processing of other -- event sources. Thus they should not be relied on for precise timing. -- After each call to the timeout function, the time of the next -- timeout is recalculated based on the current time and the given interval -- (it does not try to “catch up” time lost in delays). -- -- This variant of 'GI.GLib.Functions.timeoutAdd' can be thought of a MT-safe version -- for GTK+ widgets for the following use case: -- -- -- === /C code/ -- > -- >static gboolean timeout_callback (gpointer data) -- >{ -- > SomeWidget *self = data; -- > -- > // do stuff with self -- > -- > self->timeout_id = 0; -- > -- > return G_SOURCE_REMOVE; -- >} -- > -- >static void some_widget_do_stuff_later (SomeWidget *self) -- >{ -- > self->timeout_id = g_timeout_add (timeout_callback, self) -- >} -- > -- >static void some_widget_finalize (GObject *object) -- >{ -- > SomeWidget *self = SOME_WIDGET (object); -- > -- > if (self->timeout_id) -- > g_source_remove (self->timeout_id); -- > -- > G_OBJECT_CLASS (parent_class)->finalize (object); -- >} -- -- -- /Since: 2.12/ threadsAddTimeout :: (B.CallStack.HasCallStack, MonadIO m) => Int32 -- ^ /@priority@/: the priority of the timeout source. Typically this will be in the -- range between 'GI.GLib.Constants.PRIORITY_DEFAULT_IDLE' and 'GI.GLib.Constants.PRIORITY_HIGH_IDLE'. -> Word32 -- ^ /@interval@/: the time between calls to the function, in milliseconds -- (1\/1000ths of a second) -> GLib.Callbacks.SourceFunc -- ^ /@function@/: function to call -> m Word32 -- ^ __Returns:__ the ID (greater than 0) of the event source. threadsAddTimeout :: Int32 -> Word32 -> SourceFunc -> m Word32 threadsAddTimeout Int32 priority Word32 interval SourceFunc function = IO Word32 -> m Word32 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do FunPtr C_SourceFunc function' <- C_SourceFunc -> IO (FunPtr C_SourceFunc) GLib.Callbacks.mk_SourceFunc (Maybe (Ptr (FunPtr C_SourceFunc)) -> SourceFunc_WithClosures -> C_SourceFunc GLib.Callbacks.wrap_SourceFunc Maybe (Ptr (FunPtr C_SourceFunc)) forall a. Maybe a Nothing (SourceFunc -> SourceFunc_WithClosures GLib.Callbacks.drop_closures_SourceFunc SourceFunc function)) let data_ :: Ptr () data_ = FunPtr C_SourceFunc -> Ptr () forall a b. FunPtr a -> Ptr b castFunPtrToPtr FunPtr C_SourceFunc function' let notify :: FunPtr (Ptr a -> IO ()) notify = FunPtr (Ptr a -> IO ()) forall a. FunPtr (Ptr a -> IO ()) safeFreeFunPtrPtr Word32 result <- Int32 -> Word32 -> FunPtr C_SourceFunc -> Ptr () -> FunPtr C_DestroyNotify -> IO Word32 gdk_threads_add_timeout_full Int32 priority Word32 interval FunPtr C_SourceFunc function' Ptr () data_ FunPtr C_DestroyNotify forall a. FunPtr (Ptr a -> IO ()) notify Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function threads_add_idle -- Args: [ Arg -- { argCName = "priority" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the priority of the idle source. Typically this will be in the\n range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "function" -- , argType = -- TInterface Name { namespace = "GLib" , name = "SourceFunc" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "function to call" , sinceVersion = Nothing } -- , argScope = ScopeTypeNotified -- , argClosure = 2 -- , argDestroy = 3 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "data to pass to @function" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "notify" -- , argType = -- TInterface Name { namespace = "GLib" , name = "DestroyNotify" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "function to call when the idle is removed, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gdk_threads_add_idle_full" gdk_threads_add_idle_full :: Int32 -> -- priority : TBasicType TInt FunPtr GLib.Callbacks.C_SourceFunc -> -- function : TInterface (Name {namespace = "GLib", name = "SourceFunc"}) Ptr () -> -- data : TBasicType TPtr FunPtr GLib.Callbacks.C_DestroyNotify -> -- notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"}) IO Word32 -- | Adds a function to be called whenever there are no higher priority -- events pending. If the function returns 'P.False' it is automatically -- removed from the list of event sources and will not be called again. -- -- This variant of 'GI.GLib.Functions.idleAdd' calls /@function@/ with the GDK lock -- held. It can be thought of a MT-safe version for GTK+ widgets for the -- following use case, where you have to worry about @/idle_callback()/@ -- running in thread A and accessing /@self@/ after it has been finalized -- in thread B: -- -- -- === /C code/ -- > -- >static gboolean -- >idle_callback (gpointer data) -- >{ -- > // gdk_threads_enter(); would be needed for g_idle_add() -- > -- > SomeWidget *self = data; -- > // do stuff with self -- > -- > self->idle_id = 0; -- > -- > // gdk_threads_leave(); would be needed for g_idle_add() -- > return FALSE; -- >} -- > -- >static void -- >some_widget_do_stuff_later (SomeWidget *self) -- >{ -- > self->idle_id = gdk_threads_add_idle (idle_callback, self) -- > // using g_idle_add() here would require thread protection in the callback -- >} -- > -- >static void -- >some_widget_finalize (GObject *object) -- >{ -- > SomeWidget *self = SOME_WIDGET (object); -- > if (self->idle_id) -- > g_source_remove (self->idle_id); -- > G_OBJECT_CLASS (parent_class)->finalize (object); -- >} -- -- -- /Since: 2.12/ threadsAddIdle :: (B.CallStack.HasCallStack, MonadIO m) => Int32 -- ^ /@priority@/: the priority of the idle source. Typically this will be in the -- range between 'GI.GLib.Constants.PRIORITY_DEFAULT_IDLE' and 'GI.GLib.Constants.PRIORITY_HIGH_IDLE' -> GLib.Callbacks.SourceFunc -- ^ /@function@/: function to call -> m Word32 -- ^ __Returns:__ the ID (greater than 0) of the event source. threadsAddIdle :: Int32 -> SourceFunc -> m Word32 threadsAddIdle Int32 priority SourceFunc function = IO Word32 -> m Word32 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do FunPtr C_SourceFunc function' <- C_SourceFunc -> IO (FunPtr C_SourceFunc) GLib.Callbacks.mk_SourceFunc (Maybe (Ptr (FunPtr C_SourceFunc)) -> SourceFunc_WithClosures -> C_SourceFunc GLib.Callbacks.wrap_SourceFunc Maybe (Ptr (FunPtr C_SourceFunc)) forall a. Maybe a Nothing (SourceFunc -> SourceFunc_WithClosures GLib.Callbacks.drop_closures_SourceFunc SourceFunc function)) let data_ :: Ptr () data_ = FunPtr C_SourceFunc -> Ptr () forall a b. FunPtr a -> Ptr b castFunPtrToPtr FunPtr C_SourceFunc function' let notify :: FunPtr (Ptr a -> IO ()) notify = FunPtr (Ptr a -> IO ()) forall a. FunPtr (Ptr a -> IO ()) safeFreeFunPtrPtr Word32 result <- Int32 -> FunPtr C_SourceFunc -> Ptr () -> FunPtr C_DestroyNotify -> IO Word32 gdk_threads_add_idle_full Int32 priority FunPtr C_SourceFunc function' Ptr () data_ FunPtr C_DestroyNotify forall a. FunPtr (Ptr a -> IO ()) notify Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function text_property_to_utf8_list_for_display -- Args: [ Arg -- { argCName = "display" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "Display" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkDisplay" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "encoding" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an atom representing the encoding of the text" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "format" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the format of the property" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 4 (TBasicType TUInt8) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the text to convert" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @text, in bytes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "list" -- , argType = TCArray True (-1) (-1) (TBasicType TUTF8) -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "location to store the list\n of strings or %NULL. The list should be freed with\n g_strfreev()." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "length" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @text, in bytes" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "gdk_text_property_to_utf8_list_for_display" gdk_text_property_to_utf8_list_for_display :: Ptr Gdk.Display.Display -> -- display : TInterface (Name {namespace = "Gdk", name = "Display"}) Ptr Gdk.Atom.Atom -> -- encoding : TInterface (Name {namespace = "Gdk", name = "Atom"}) Int32 -> -- format : TBasicType TInt Ptr Word8 -> -- text : TCArray False (-1) 4 (TBasicType TUInt8) Int32 -> -- length : TBasicType TInt Ptr (Ptr CString) -> -- list : TCArray True (-1) (-1) (TBasicType TUTF8) IO Int32 -- | Converts a text property in the given encoding to -- a list of UTF-8 strings. -- -- /Since: 2.2/ textPropertyToUtf8ListForDisplay :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) => a -- ^ /@display@/: a t'GI.Gdk.Objects.Display.Display' -> Gdk.Atom.Atom -- ^ /@encoding@/: an atom representing the encoding of the text -> Int32 -- ^ /@format@/: the format of the property -> ByteString -- ^ /@text@/: the text to convert -> m ((Int32, [T.Text])) -- ^ __Returns:__ the number of strings in the resulting list textPropertyToUtf8ListForDisplay :: a -> Atom -> Int32 -> ByteString -> m (Int32, [Text]) textPropertyToUtf8ListForDisplay a display Atom encoding Int32 format ByteString text = IO (Int32, [Text]) -> m (Int32, [Text]) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, [Text]) -> m (Int32, [Text])) -> IO (Int32, [Text]) -> m (Int32, [Text]) forall a b. (a -> b) -> a -> b $ do let length_ :: Int32 length_ = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString text Ptr Display display' <- a -> IO (Ptr Display) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a display Ptr Atom encoding' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom encoding Ptr Word8 text' <- ByteString -> IO (Ptr Word8) packByteString ByteString text Ptr (Ptr CString) list <- IO (Ptr (Ptr CString)) forall a. Storable a => IO (Ptr a) callocMem :: IO (Ptr (Ptr CString)) Int32 result <- Ptr Display -> Ptr Atom -> Int32 -> Ptr Word8 -> Int32 -> Ptr (Ptr CString) -> IO Int32 gdk_text_property_to_utf8_list_for_display Ptr Display display' Ptr Atom encoding' Int32 format Ptr Word8 text' Int32 length_ Ptr (Ptr CString) list Ptr CString list' <- Ptr (Ptr CString) -> IO (Ptr CString) forall a. Storable a => Ptr a -> IO a peek Ptr (Ptr CString) list [Text] list'' <- HasCallStack => Ptr CString -> IO [Text] Ptr CString -> IO [Text] unpackZeroTerminatedUTF8CArray Ptr CString list' (CString -> IO ()) -> Ptr CString -> IO () forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO () mapZeroTerminatedCArray CString -> IO () forall a. Ptr a -> IO () freeMem Ptr CString list' Ptr CString -> IO () forall a. Ptr a -> IO () freeMem Ptr CString list' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a display Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom encoding Ptr Word8 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word8 text' Ptr (Ptr CString) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr CString) list (Int32, [Text]) -> IO (Int32, [Text]) forall (m :: * -> *) a. Monad m => a -> m a return (Int32 result, [Text] list'') -- function test_simulate_key -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkWindow to simulate a key event for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "x coordinate within @window for the key event" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "y coordinate within @window for the key event" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "keyval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A GDK keyboard value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "modifiers" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "ModifierType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Keyboard modifiers the event is setup with" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "key_pressrelease" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "EventType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "either %GDK_KEY_PRESS or %GDK_KEY_RELEASE" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_test_simulate_key" gdk_test_simulate_key :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) Int32 -> -- x : TBasicType TInt Int32 -> -- y : TBasicType TInt Word32 -> -- keyval : TBasicType TUInt CUInt -> -- modifiers : TInterface (Name {namespace = "Gdk", name = "ModifierType"}) CInt -> -- key_pressrelease : TInterface (Name {namespace = "Gdk", name = "EventType"}) IO CInt -- | This function is intended to be used in GTK+ test programs. -- If (/@x@/,/@y@/) are > (-1,-1), it will warp the mouse pointer to -- the given (/@x@/,/@y@/) coordinates within /@window@/ and simulate a -- key press or release event. -- -- When the mouse pointer is warped to the target location, use -- of this function outside of test programs that run in their -- own virtual windowing system (e.g. Xvfb) is not recommended. -- If (/@x@/,/@y@/) are passed as (-1,-1), the mouse pointer will not -- be warped and /@window@/ origin will be used as mouse pointer -- location for the event. -- -- Also, 'GI.Gdk.Functions.testSimulateKey' is a fairly low level function, -- for most testing purposes, @/gtk_test_widget_send_key()/@ is the -- right function to call which will generate a key press event -- followed by its accompanying key release event. -- -- /Since: 2.14/ testSimulateKey :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@window@/: a t'GI.Gdk.Objects.Window.Window' to simulate a key event for -> Int32 -- ^ /@x@/: x coordinate within /@window@/ for the key event -> Int32 -- ^ /@y@/: y coordinate within /@window@/ for the key event -> Word32 -- ^ /@keyval@/: A GDK keyboard value -> [Gdk.Flags.ModifierType] -- ^ /@modifiers@/: Keyboard modifiers the event is setup with -> Gdk.Enums.EventType -- ^ /@keyPressrelease@/: either 'GI.Gdk.Enums.EventTypeKeyPress' or 'GI.Gdk.Enums.EventTypeKeyRelease' -> m Bool -- ^ __Returns:__ whether all actions necessary for a key event simulation -- were carried out successfully testSimulateKey :: a -> Int32 -> Int32 -> Word32 -> [ModifierType] -> EventType -> m Bool testSimulateKey a window Int32 x Int32 y Word32 keyval [ModifierType] modifiers EventType keyPressrelease = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window let modifiers' :: CUInt modifiers' = [ModifierType] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ModifierType] modifiers let keyPressrelease' :: CInt keyPressrelease' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CInt) -> (EventType -> Int) -> EventType -> CInt forall b c a. (b -> c) -> (a -> b) -> a -> c . EventType -> Int forall a. Enum a => a -> Int fromEnum) EventType keyPressrelease CInt result <- Ptr Window -> Int32 -> Int32 -> Word32 -> CUInt -> CInt -> IO CInt gdk_test_simulate_key Ptr Window window' Int32 x Int32 y Word32 keyval CUInt modifiers' CInt keyPressrelease' 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 window Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function test_simulate_button -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkWindow to simulate a button event for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "x coordinate within @window for the button event" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "y coordinate within @window for the button event" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "button" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Number of the pointer button for the event, usually 1, 2 or 3" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "modifiers" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "ModifierType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Keyboard modifiers the event is setup with" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "button_pressrelease" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "EventType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "either %GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_test_simulate_button" :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) Int32 -> -- x : TBasicType TInt Int32 -> -- y : TBasicType TInt Word32 -> -- button : TBasicType TUInt CUInt -> -- modifiers : TInterface (Name {namespace = "Gdk", name = "ModifierType"}) CInt -> -- button_pressrelease : TInterface (Name {namespace = "Gdk", name = "EventType"}) IO CInt -- | This function is intended to be used in GTK+ test programs. -- It will warp the mouse pointer to the given (/@x@/,/@y@/) coordinates -- within /@window@/ and simulate a button press or release event. -- Because the mouse pointer needs to be warped to the target -- location, use of this function outside of test programs that -- run in their own virtual windowing system (e.g. Xvfb) is not -- recommended. -- -- Also, 'GI.Gdk.Functions.testSimulateButton' is a fairly low level function, -- for most testing purposes, @/gtk_test_widget_click()/@ is the right -- function to call which will generate a button press event followed -- by its accompanying button release event. -- -- /Since: 2.14/ testSimulateButton :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@window@/: a t'GI.Gdk.Objects.Window.Window' to simulate a button event for -> Int32 -- ^ /@x@/: x coordinate within /@window@/ for the button event -> Int32 -- ^ /@y@/: y coordinate within /@window@/ for the button event -> Word32 -- ^ /@button@/: Number of the pointer button for the event, usually 1, 2 or 3 -> [Gdk.Flags.ModifierType] -- ^ /@modifiers@/: Keyboard modifiers the event is setup with -> Gdk.Enums.EventType -- ^ /@buttonPressrelease@/: either 'GI.Gdk.Enums.EventTypeButtonPress' or 'GI.Gdk.Enums.EventTypeButtonRelease' -> m Bool -- ^ __Returns:__ whether all actions necessary for a button event simulation -- were carried out successfully testSimulateButton :: a -> Int32 -> Int32 -> Word32 -> [ModifierType] -> EventType -> m Bool testSimulateButton a window Int32 x Int32 y Word32 button [ModifierType] modifiers EventType buttonPressrelease = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window let modifiers' :: CUInt modifiers' = [ModifierType] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ModifierType] modifiers let buttonPressrelease' :: CInt buttonPressrelease' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CInt) -> (EventType -> Int) -> EventType -> CInt forall b c a. (b -> c) -> (a -> b) -> a -> c . EventType -> Int forall a. Enum a => a -> Int fromEnum) EventType buttonPressrelease CInt result <- Ptr Window -> Int32 -> Int32 -> Word32 -> CUInt -> CInt -> IO CInt gdk_test_simulate_button Ptr Window window' Int32 x Int32 y Word32 button CUInt modifiers' CInt buttonPressrelease' 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 window Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function test_render_sync -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a mapped #GdkWindow" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_test_render_sync" gdk_test_render_sync :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) IO () -- | Retrieves a pixel from /@window@/ to force the windowing -- system to carry out any pending rendering commands. -- -- This function is intended to be used to synchronize with rendering -- pipelines, to benchmark windowing system rendering operations. -- -- /Since: 2.14/ testRenderSync :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@window@/: a mapped t'GI.Gdk.Objects.Window.Window' -> m () testRenderSync :: a -> m () testRenderSync a window = 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 Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window Ptr Window -> IO () gdk_test_render_sync Ptr Window window' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function synthesize_window_state -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unset_flags" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "WindowState" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "set_flags" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "WindowState" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Nothing , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_synthesize_window_state" gdk_synthesize_window_state :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) CUInt -> -- unset_flags : TInterface (Name {namespace = "Gdk", name = "WindowState"}) CUInt -> -- set_flags : TInterface (Name {namespace = "Gdk", name = "WindowState"}) IO () -- | /No description available in the introspection data./ synthesizeWindowState :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -> [Gdk.Flags.WindowState] -> [Gdk.Flags.WindowState] -> m () synthesizeWindowState :: a -> [WindowState] -> [WindowState] -> m () synthesizeWindowState a window [WindowState] unsetFlags [WindowState] setFlags = 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 Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window let unsetFlags' :: CUInt unsetFlags' = [WindowState] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [WindowState] unsetFlags let setFlags' :: CUInt setFlags' = [WindowState] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [WindowState] setFlags Ptr Window -> CUInt -> CUInt -> IO () gdk_synthesize_window_state Ptr Window window' CUInt unsetFlags' CUInt setFlags' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function setting_get -- Args: [ Arg -- { argCName = "name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the name of the setting." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "value" -- , argType = TGValue -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "location to store the value of the setting." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_setting_get" gdk_setting_get :: CString -> -- name : TBasicType TUTF8 Ptr GValue -> -- value : TGValue IO CInt -- | Obtains a desktop-wide setting, such as the double-click time, -- for the default screen. See 'GI.Gdk.Objects.Screen.screenGetSetting'. settingGet :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@name@/: the name of the setting. -> GValue -- ^ /@value@/: location to store the value of the setting. -> m Bool -- ^ __Returns:__ 'P.True' if the setting existed and a value was stored -- in /@value@/, 'P.False' otherwise. settingGet :: Text -> GValue -> m Bool settingGet Text name GValue value = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do CString name' <- Text -> IO CString textToCString Text name Ptr GValue value' <- GValue -> IO (Ptr GValue) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GValue value CInt result <- CString -> Ptr GValue -> IO CInt gdk_setting_get CString name' Ptr GValue value' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result GValue -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GValue value CString -> IO () forall a. Ptr a -> IO () freeMem CString name' Ptr GValue -> IO () B.GValue.unsetGValue Ptr GValue value' Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function set_show_events -- Args: [ Arg -- { argCName = "show_events" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "%TRUE to output event debugging information." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_set_show_events" gdk_set_show_events :: CInt -> -- show_events : TBasicType TBoolean IO () -- | Sets whether a trace of received events is output. -- Note that GTK+ must be compiled with debugging (that is, -- configured using the @--enable-debug@ option) -- to use this option. setShowEvents :: (B.CallStack.HasCallStack, MonadIO m) => Bool -- ^ /@showEvents@/: 'P.True' to output event debugging information. -> m () setShowEvents :: Bool -> m () setShowEvents Bool showEvents = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let showEvents' :: CInt showEvents' = (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 showEvents CInt -> IO () gdk_set_show_events CInt showEvents' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function set_program_class -- Args: [ Arg -- { argCName = "program_class" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a string." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_set_program_class" gdk_set_program_class :: CString -> -- program_class : TBasicType TUTF8 IO () -- | Sets the program class. The X11 backend uses the program class to set -- the class name part of the @WM_CLASS@ property on -- toplevel windows; see the ICCCM. -- -- The program class can still be overridden with the --class command -- line option. setProgramClass :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@programClass@/: a string. -> m () setProgramClass :: Text -> m () setProgramClass Text programClass = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do CString programClass' <- Text -> IO CString textToCString Text programClass CString -> IO () gdk_set_program_class CString programClass' CString -> IO () forall a. Ptr a -> IO () freeMem CString programClass' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function set_double_click_time -- Args: [ Arg -- { argCName = "msec" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "double click time in milliseconds (thousandths of a second)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_set_double_click_time" gdk_set_double_click_time :: Word32 -> -- msec : TBasicType TUInt IO () -- | Set the double click time for the default display. See -- 'GI.Gdk.Objects.Display.displaySetDoubleClickTime'. -- See also 'GI.Gdk.Objects.Display.displaySetDoubleClickDistance'. -- Applications should not set this, it is a -- global user-configured setting. setDoubleClickTime :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@msec@/: double click time in milliseconds (thousandths of a second) -> m () setDoubleClickTime :: Word32 -> m () setDoubleClickTime Word32 msec = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do Word32 -> IO () gdk_set_double_click_time Word32 msec () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function set_allowed_backends -- Args: [ Arg -- { argCName = "backends" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a comma-separated list of backends" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_set_allowed_backends" gdk_set_allowed_backends :: CString -> -- backends : TBasicType TUTF8 IO () -- | Sets a list of backends that GDK should try to use. -- -- This can be be useful if your application does not -- work with certain GDK backends. -- -- By default, GDK tries all included backends. -- -- For example, -- -- === /C code/ -- > -- >gdk_set_allowed_backends ("wayland,quartz,*"); -- -- instructs GDK to try the Wayland backend first, -- followed by the Quartz backend, and then all -- others. -- -- If the @GDK_BACKEND@ environment variable -- is set, it determines what backends are tried in what -- order, while still respecting the set of allowed backends -- that are specified by this function. -- -- The possible backend names are x11, win32, quartz, -- broadway, wayland. You can also include a * in the -- list to try all remaining backends. -- -- This call must happen prior to 'GI.Gdk.Objects.Display.displayOpen', -- @/gtk_init()/@, @/gtk_init_with_args()/@ or @/gtk_init_check()/@ -- in order to take effect. -- -- /Since: 3.10/ setAllowedBackends :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@backends@/: a comma-separated list of backends -> m () setAllowedBackends :: Text -> m () setAllowedBackends Text backends = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do CString backends' <- Text -> IO CString textToCString Text backends CString -> IO () gdk_set_allowed_backends CString backends' CString -> IO () forall a. Ptr a -> IO () freeMem CString backends' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function selection_send_notify_for_display -- Args: [ Arg -- { argCName = "display" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "Display" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the #GdkDisplay where @requestor is realized" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "requestor" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "window to which to deliver response" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "selection" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "selection that was requested" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "target" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "target that was selected" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "property" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "property in which the selection owner stored the data,\n or %GDK_NONE to indicate that the request was rejected" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "timestamp" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_selection_send_notify_for_display" gdk_selection_send_notify_for_display :: Ptr Gdk.Display.Display -> -- display : TInterface (Name {namespace = "Gdk", name = "Display"}) Ptr Gdk.Window.Window -> -- requestor : TInterface (Name {namespace = "Gdk", name = "Window"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Ptr Gdk.Atom.Atom -> -- target : TInterface (Name {namespace = "Gdk", name = "Atom"}) Ptr Gdk.Atom.Atom -> -- property : TInterface (Name {namespace = "Gdk", name = "Atom"}) Word32 -> -- time_ : TBasicType TUInt32 IO () -- | Send a response to SelectionRequest event. -- -- /Since: 2.2/ selectionSendNotifyForDisplay :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a, Gdk.Window.IsWindow b) => a -- ^ /@display@/: the t'GI.Gdk.Objects.Display.Display' where /@requestor@/ is realized -> b -- ^ /@requestor@/: window to which to deliver response -> Gdk.Atom.Atom -- ^ /@selection@/: selection that was requested -> Gdk.Atom.Atom -- ^ /@target@/: target that was selected -> Gdk.Atom.Atom -- ^ /@property@/: property in which the selection owner stored the data, -- or @/GDK_NONE/@ to indicate that the request was rejected -> Word32 -- ^ /@time_@/: timestamp -> m () selectionSendNotifyForDisplay :: a -> b -> Atom -> Atom -> Atom -> Word32 -> m () selectionSendNotifyForDisplay a display b requestor Atom selection Atom target Atom property Word32 time_ = 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 Display display' <- a -> IO (Ptr Display) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a display Ptr Window requestor' <- b -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b requestor Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection Ptr Atom target' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom target Ptr Atom property' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom property Ptr Display -> Ptr Window -> Ptr Atom -> Ptr Atom -> Ptr Atom -> Word32 -> IO () gdk_selection_send_notify_for_display Ptr Display display' Ptr Window requestor' Ptr Atom selection' Ptr Atom target' Ptr Atom property' Word32 time_ a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a display b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr b requestor Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom target Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom property () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function selection_send_notify -- Args: [ Arg -- { argCName = "requestor" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "window to which to deliver response." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "selection" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "selection that was requested." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "target" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "target that was selected." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "property" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "property in which the selection owner stored the\n data, or %GDK_NONE to indicate that the request\n was rejected." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "timestamp." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_selection_send_notify" gdk_selection_send_notify :: Ptr Gdk.Window.Window -> -- requestor : TInterface (Name {namespace = "Gdk", name = "Window"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Ptr Gdk.Atom.Atom -> -- target : TInterface (Name {namespace = "Gdk", name = "Atom"}) Ptr Gdk.Atom.Atom -> -- property : TInterface (Name {namespace = "Gdk", name = "Atom"}) Word32 -> -- time_ : TBasicType TUInt32 IO () -- | Sends a response to SelectionRequest event. selectionSendNotify :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@requestor@/: window to which to deliver response. -> Gdk.Atom.Atom -- ^ /@selection@/: selection that was requested. -> Gdk.Atom.Atom -- ^ /@target@/: target that was selected. -> Gdk.Atom.Atom -- ^ /@property@/: property in which the selection owner stored the -- data, or @/GDK_NONE/@ to indicate that the request -- was rejected. -> Word32 -- ^ /@time_@/: timestamp. -> m () selectionSendNotify :: a -> Atom -> Atom -> Atom -> Word32 -> m () selectionSendNotify a requestor Atom selection Atom target Atom property Word32 time_ = 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 Window requestor' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a requestor Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection Ptr Atom target' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom target Ptr Atom property' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom property Ptr Window -> Ptr Atom -> Ptr Atom -> Ptr Atom -> Word32 -> IO () gdk_selection_send_notify Ptr Window requestor' Ptr Atom selection' Ptr Atom target' Ptr Atom property' Word32 time_ a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a requestor Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom target Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom property () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function selection_owner_set_for_display -- Args: [ Arg -- { argCName = "display" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "Display" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the #GdkDisplay" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "owner" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a #GdkWindow or %NULL to indicate that the owner for\n the given should be unset" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "selection" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an atom identifying a selection" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "timestamp to use when setting the selection\n If this is older than the timestamp given last time the owner was\n set for the given selection, the request will be ignored" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "send_event" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "if %TRUE, and the new owner is different from the current\n owner, the current owner will be sent a SelectionClear event" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_selection_owner_set_for_display" gdk_selection_owner_set_for_display :: Ptr Gdk.Display.Display -> -- display : TInterface (Name {namespace = "Gdk", name = "Display"}) Ptr Gdk.Window.Window -> -- owner : TInterface (Name {namespace = "Gdk", name = "Window"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Word32 -> -- time_ : TBasicType TUInt32 CInt -> -- send_event : TBasicType TBoolean IO CInt -- | Sets the t'GI.Gdk.Objects.Window.Window' /@owner@/ as the current owner of the selection /@selection@/. -- -- /Since: 2.2/ selectionOwnerSetForDisplay :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a, Gdk.Window.IsWindow b) => a -- ^ /@display@/: the t'GI.Gdk.Objects.Display.Display' -> Maybe (b) -- ^ /@owner@/: a t'GI.Gdk.Objects.Window.Window' or 'P.Nothing' to indicate that the owner for -- the given should be unset -> Gdk.Atom.Atom -- ^ /@selection@/: an atom identifying a selection -> Word32 -- ^ /@time_@/: timestamp to use when setting the selection -- If this is older than the timestamp given last time the owner was -- set for the given selection, the request will be ignored -> Bool -- ^ /@sendEvent@/: if 'P.True', and the new owner is different from the current -- owner, the current owner will be sent a SelectionClear event -> m Bool -- ^ __Returns:__ 'P.True' if the selection owner was successfully changed to owner, -- otherwise 'P.False'. selectionOwnerSetForDisplay :: a -> Maybe b -> Atom -> Word32 -> Bool -> m Bool selectionOwnerSetForDisplay a display Maybe b owner Atom selection Word32 time_ Bool sendEvent = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool 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 Window maybeOwner <- case Maybe b owner of Maybe b Nothing -> Ptr Window -> IO (Ptr Window) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Window forall a. Ptr a nullPtr Just b jOwner -> do Ptr Window jOwner' <- b -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jOwner Ptr Window -> IO (Ptr Window) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Window jOwner' Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection let sendEvent' :: CInt sendEvent' = (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 sendEvent CInt result <- Ptr Display -> Ptr Window -> Ptr Atom -> Word32 -> CInt -> IO CInt gdk_selection_owner_set_for_display Ptr Display display' Ptr Window maybeOwner Ptr Atom selection' Word32 time_ CInt sendEvent' 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 display Maybe b -> (b -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe b owner b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function selection_owner_set -- Args: [ Arg -- { argCName = "owner" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a #GdkWindow or %NULL to indicate that the\n the owner for the given should be unset." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "selection" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an atom identifying a selection." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "timestamp to use when setting the selection.\n If this is older than the timestamp given last\n time the owner was set for the given selection, the\n request will be ignored." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "send_event" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "if %TRUE, and the new owner is different\n from the current owner, the current owner\n will be sent a SelectionClear event." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_selection_owner_set" gdk_selection_owner_set :: Ptr Gdk.Window.Window -> -- owner : TInterface (Name {namespace = "Gdk", name = "Window"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Word32 -> -- time_ : TBasicType TUInt32 CInt -> -- send_event : TBasicType TBoolean IO CInt -- | Sets the owner of the given selection. selectionOwnerSet :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => Maybe (a) -- ^ /@owner@/: a t'GI.Gdk.Objects.Window.Window' or 'P.Nothing' to indicate that the -- the owner for the given should be unset. -> Gdk.Atom.Atom -- ^ /@selection@/: an atom identifying a selection. -> Word32 -- ^ /@time_@/: timestamp to use when setting the selection. -- If this is older than the timestamp given last -- time the owner was set for the given selection, the -- request will be ignored. -> Bool -- ^ /@sendEvent@/: if 'P.True', and the new owner is different -- from the current owner, the current owner -- will be sent a SelectionClear event. -> m Bool -- ^ __Returns:__ 'P.True' if the selection owner was successfully -- changed to /@owner@/, otherwise 'P.False'. selectionOwnerSet :: Maybe a -> Atom -> Word32 -> Bool -> m Bool selectionOwnerSet Maybe a owner Atom selection Word32 time_ Bool sendEvent = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr Window maybeOwner <- case Maybe a owner of Maybe a Nothing -> Ptr Window -> IO (Ptr Window) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Window forall a. Ptr a nullPtr Just a jOwner -> do Ptr Window jOwner' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jOwner Ptr Window -> IO (Ptr Window) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Window jOwner' Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection let sendEvent' :: CInt sendEvent' = (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 sendEvent CInt result <- Ptr Window -> Ptr Atom -> Word32 -> CInt -> IO CInt gdk_selection_owner_set Ptr Window maybeOwner Ptr Atom selection' Word32 time_ CInt sendEvent' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result Maybe a -> (a -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a owner a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function selection_owner_get_for_display -- Args: [ Arg -- { argCName = "display" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "Display" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkDisplay" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "selection" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an atom indentifying a selection" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Window" }) -- throws : False -- Skip return : False foreign import ccall "gdk_selection_owner_get_for_display" gdk_selection_owner_get_for_display :: Ptr Gdk.Display.Display -> -- display : TInterface (Name {namespace = "Gdk", name = "Display"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) IO (Ptr Gdk.Window.Window) -- | Determine the owner of the given selection. -- -- Note that the return value may be owned by a different -- process if a foreign window was previously created for that -- window, but a new foreign window will never be created by this call. -- -- /Since: 2.2/ selectionOwnerGetForDisplay :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) => a -- ^ /@display@/: a t'GI.Gdk.Objects.Display.Display' -> Gdk.Atom.Atom -- ^ /@selection@/: an atom indentifying a selection -> m (Maybe Gdk.Window.Window) -- ^ __Returns:__ if there is a selection owner -- for this window, and it is a window known to the current -- process, the t'GI.Gdk.Objects.Window.Window' that owns the selection, otherwise -- 'P.Nothing'. selectionOwnerGetForDisplay :: a -> Atom -> m (Maybe Window) selectionOwnerGetForDisplay a display Atom selection = IO (Maybe Window) -> m (Maybe Window) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Window) -> m (Maybe Window)) -> IO (Maybe Window) -> m (Maybe Window) 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 Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection Ptr Window result <- Ptr Display -> Ptr Atom -> IO (Ptr Window) gdk_selection_owner_get_for_display Ptr Display display' Ptr Atom selection' Maybe Window maybeResult <- Ptr Window -> (Ptr Window -> IO Window) -> IO (Maybe Window) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr Window result ((Ptr Window -> IO Window) -> IO (Maybe Window)) -> (Ptr Window -> IO Window) -> IO (Maybe Window) forall a b. (a -> b) -> a -> b $ \Ptr Window result' -> do Window result'' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Window -> Window Gdk.Window.Window) Ptr Window result' Window -> IO Window forall (m :: * -> *) a. Monad m => a -> m a return Window result'' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a display Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Maybe Window -> IO (Maybe Window) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Window maybeResult -- function selection_owner_get -- Args: [ Arg -- { argCName = "selection" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an atom indentifying a selection." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Window" }) -- throws : False -- Skip return : False foreign import ccall "gdk_selection_owner_get" gdk_selection_owner_get :: Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) IO (Ptr Gdk.Window.Window) -- | Determines the owner of the given selection. selectionOwnerGet :: (B.CallStack.HasCallStack, MonadIO m) => Gdk.Atom.Atom -- ^ /@selection@/: an atom indentifying a selection. -> m (Maybe Gdk.Window.Window) -- ^ __Returns:__ if there is a selection owner -- for this window, and it is a window known to the current process, -- the t'GI.Gdk.Objects.Window.Window' that owns the selection, otherwise 'P.Nothing'. Note -- that the return value may be owned by a different process if a -- foreign window was previously created for that window, but a new -- foreign window will never be created by this call. selectionOwnerGet :: Atom -> m (Maybe Window) selectionOwnerGet Atom selection = IO (Maybe Window) -> m (Maybe Window) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Window) -> m (Maybe Window)) -> IO (Maybe Window) -> m (Maybe Window) forall a b. (a -> b) -> a -> b $ do Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection Ptr Window result <- Ptr Atom -> IO (Ptr Window) gdk_selection_owner_get Ptr Atom selection' Maybe Window maybeResult <- Ptr Window -> (Ptr Window -> IO Window) -> IO (Maybe Window) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr Window result ((Ptr Window -> IO Window) -> IO (Maybe Window)) -> (Ptr Window -> IO Window) -> IO (Maybe Window) forall a b. (a -> b) -> a -> b $ \Ptr Window result' -> do Window result'' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Window -> Window Gdk.Window.Window) Ptr Window result' Window -> IO Window forall (m :: * -> *) a. Monad m => a -> m a return Window result'' Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Maybe Window -> IO (Maybe Window) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Window maybeResult -- function selection_convert -- Args: [ Arg -- { argCName = "requestor" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkWindow." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "selection" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "an atom identifying the selection to get the\n contents of." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "target" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the form in which to retrieve the selection." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the timestamp to use when retrieving the\n selection. The selection owner may refuse the\n request if it did not own the selection at\n the time indicated by the timestamp." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_selection_convert" gdk_selection_convert :: Ptr Gdk.Window.Window -> -- requestor : TInterface (Name {namespace = "Gdk", name = "Window"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Ptr Gdk.Atom.Atom -> -- target : TInterface (Name {namespace = "Gdk", name = "Atom"}) Word32 -> -- time_ : TBasicType TUInt32 IO () -- | Retrieves the contents of a selection in a given -- form. selectionConvert :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@requestor@/: a t'GI.Gdk.Objects.Window.Window'. -> Gdk.Atom.Atom -- ^ /@selection@/: an atom identifying the selection to get the -- contents of. -> Gdk.Atom.Atom -- ^ /@target@/: the form in which to retrieve the selection. -> Word32 -- ^ /@time_@/: the timestamp to use when retrieving the -- selection. The selection owner may refuse the -- request if it did not own the selection at -- the time indicated by the timestamp. -> m () selectionConvert :: a -> Atom -> Atom -> Word32 -> m () selectionConvert a requestor Atom selection Atom target Word32 time_ = 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 Window requestor' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a requestor Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection Ptr Atom target' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom target Ptr Window -> Ptr Atom -> Ptr Atom -> Word32 -> IO () gdk_selection_convert Ptr Window requestor' Ptr Atom selection' Ptr Atom target' Word32 time_ a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a requestor Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom target () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function query_visual_types -- Args: [ Arg -- { argCName = "visual_types" -- , argType = -- TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gdk" , name = "VisualType" }) -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return\n location for the available visual types" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for the number of available visual types" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "count" -- , argType = TBasicType TInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for the number of available visual types" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_query_visual_types" gdk_query_visual_types :: Ptr (Ptr CUInt) -> -- visual_types : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "VisualType"})) Ptr Int32 -> -- count : TBasicType TInt IO () {-# DEPRECATED queryVisualTypes ["(Since version 3.22)","Visual selection should be done using"," 'GI.Gdk.Objects.Screen.screenGetSystemVisual' and 'GI.Gdk.Objects.Screen.screenGetRgbaVisual'"] #-} -- | This function returns the available visual types for the default -- screen. It’s equivalent to listing the visuals -- ('GI.Gdk.Functions.listVisuals') and then looking at the type field in each -- visual, removing duplicates. -- -- The array returned by this function should not be freed. queryVisualTypes :: (B.CallStack.HasCallStack, MonadIO m) => m ([Gdk.Enums.VisualType]) queryVisualTypes :: m [VisualType] queryVisualTypes = IO [VisualType] -> m [VisualType] forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [VisualType] -> m [VisualType]) -> IO [VisualType] -> m [VisualType] forall a b. (a -> b) -> a -> b $ do Ptr (Ptr CUInt) visualTypes <- IO (Ptr (Ptr CUInt)) forall a. Storable a => IO (Ptr a) callocMem :: IO (Ptr (Ptr CUInt)) Ptr Int32 count <- IO (Ptr Int32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Int32) Ptr (Ptr CUInt) -> Ptr Int32 -> IO () gdk_query_visual_types Ptr (Ptr CUInt) visualTypes Ptr Int32 count Int32 count' <- Ptr Int32 -> IO Int32 forall a. Storable a => Ptr a -> IO a peek Ptr Int32 count Ptr CUInt visualTypes' <- Ptr (Ptr CUInt) -> IO (Ptr CUInt) forall a. Storable a => Ptr a -> IO a peek Ptr (Ptr CUInt) visualTypes [CUInt] visualTypes'' <- (Int32 -> Ptr CUInt -> IO [CUInt] forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b] unpackStorableArrayWithLength Int32 count') Ptr CUInt visualTypes' let visualTypes''' :: [VisualType] visualTypes''' = (CUInt -> VisualType) -> [CUInt] -> [VisualType] forall a b. (a -> b) -> [a] -> [b] map (Int -> VisualType forall a. Enum a => Int -> a toEnum (Int -> VisualType) -> (CUInt -> Int) -> CUInt -> VisualType forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) [CUInt] visualTypes'' Ptr (Ptr CUInt) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr CUInt) visualTypes Ptr Int32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Int32 count [VisualType] -> IO [VisualType] forall (m :: * -> *) a. Monad m => a -> m a return [VisualType] visualTypes''' -- function query_depths -- Args: [ Arg -- { argCName = "depths" -- , argType = TCArray False (-1) 1 (TBasicType TInt) -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "return\n location for available depths" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for number of available depths" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "count" -- , argType = TBasicType TInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for number of available depths" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_query_depths" gdk_query_depths :: Ptr (Ptr Int32) -> -- depths : TCArray False (-1) 1 (TBasicType TInt) Ptr Int32 -> -- count : TBasicType TInt IO () {-# DEPRECATED queryDepths ["(Since version 3.22)","Visual selection should be done using"," 'GI.Gdk.Objects.Screen.screenGetSystemVisual' and 'GI.Gdk.Objects.Screen.screenGetRgbaVisual'"] #-} -- | This function returns the available bit depths for the default -- screen. It’s equivalent to listing the visuals -- ('GI.Gdk.Functions.listVisuals') and then looking at the depth field in each -- visual, removing duplicates. -- -- The array returned by this function should not be freed. queryDepths :: (B.CallStack.HasCallStack, MonadIO m) => m ([Int32]) queryDepths :: m [Int32] queryDepths = 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 (Ptr Int32) depths <- IO (Ptr (Ptr Int32)) forall a. Storable a => IO (Ptr a) callocMem :: IO (Ptr (Ptr Int32)) Ptr Int32 count <- IO (Ptr Int32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Int32) Ptr (Ptr Int32) -> Ptr Int32 -> IO () gdk_query_depths Ptr (Ptr Int32) depths Ptr Int32 count Int32 count' <- Ptr Int32 -> IO Int32 forall a. Storable a => Ptr a -> IO a peek Ptr Int32 count Ptr Int32 depths' <- Ptr (Ptr Int32) -> IO (Ptr Int32) forall a. Storable a => Ptr a -> IO a peek Ptr (Ptr Int32) depths [Int32] depths'' <- (Int32 -> Ptr Int32 -> IO [Int32] forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b] unpackStorableArrayWithLength Int32 count') Ptr Int32 depths' Ptr (Ptr Int32) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr Int32) depths Ptr Int32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Int32 count [Int32] -> IO [Int32] forall (m :: * -> *) a. Monad m => a -> m a return [Int32] depths'' -- function property_get -- XXX Could not generate function property_get -- Not implemented: Don't know how to allocate "actual_property_type" of type TInterface (Name {namespace = "Gdk", name = "Atom"}) -- function property_delete -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkWindow" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "property" -- , argType = TInterface Name { namespace = "Gdk" , name = "Atom" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the property to delete" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_property_delete" gdk_property_delete :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) Ptr Gdk.Atom.Atom -> -- property : TInterface (Name {namespace = "Gdk", name = "Atom"}) IO () -- | Deletes a property from a window. propertyDelete :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@window@/: a t'GI.Gdk.Objects.Window.Window' -> Gdk.Atom.Atom -- ^ /@property@/: the property to delete -> m () propertyDelete :: a -> Atom -> m () propertyDelete a window Atom property = 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 Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window Ptr Atom property' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom property Ptr Window -> Ptr Atom -> IO () gdk_property_delete Ptr Window window' Ptr Atom property' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom property () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function pre_parse_libgtk_only -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_pre_parse_libgtk_only" gdk_pre_parse_libgtk_only :: IO () {-# DEPRECATED preParseLibgtkOnly ["(Since version 3.16)","This symbol was never meant to be used outside"," of GTK+"] #-} -- | Prepare for parsing command line arguments for GDK. This is not -- public API and should not be used in application code. preParseLibgtkOnly :: (B.CallStack.HasCallStack, MonadIO m) => m () preParseLibgtkOnly :: m () preParseLibgtkOnly = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gdk_pre_parse_libgtk_only () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function pointer_ungrab -- Args: [ Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no\n timestamp is available." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_pointer_ungrab" gdk_pointer_ungrab :: Word32 -> -- time_ : TBasicType TUInt32 IO () {-# DEPRECATED pointerUngrab ["(Since version 3.0)","Use 'GI.Gdk.Objects.Device.deviceUngrab', together with 'GI.Gdk.Objects.Device.deviceGrab'"," instead."] #-} -- | Ungrabs the pointer on the default display, if it is grabbed by this -- application. pointerUngrab :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@time_@/: a timestamp from a t'GI.Gdk.Unions.Event.Event', or 'GI.Gdk.Constants.CURRENT_TIME' if no -- timestamp is available. -> m () pointerUngrab :: Word32 -> m () pointerUngrab Word32 time_ = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do Word32 -> IO () gdk_pointer_ungrab Word32 time_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function pointer_is_grabbed -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_pointer_is_grabbed" gdk_pointer_is_grabbed :: IO CInt {-# DEPRECATED pointerIsGrabbed ["(Since version 3.0)","Use 'GI.Gdk.Objects.Display.displayDeviceIsGrabbed' instead."] #-} -- | Returns 'P.True' if the pointer on the default display is currently -- grabbed by this application. -- -- Note that this does not take the inmplicit pointer grab on button -- presses into account. pointerIsGrabbed :: (B.CallStack.HasCallStack, MonadIO m) => m Bool -- ^ __Returns:__ 'P.True' if the pointer is currently grabbed by this application. pointerIsGrabbed :: m Bool pointerIsGrabbed = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do CInt result <- IO CInt gdk_pointer_is_grabbed let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function pointer_grab -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #GdkWindow which will own the grab (the grab window)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "owner_events" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "if %FALSE then all pointer events are reported with respect to\n @window and are only reported if selected by @event_mask. If %TRUE then pointer\n events for this application are reported as normal, but pointer events outside\n this application are reported with respect to @window and only if selected by\n @event_mask. In either mode, unreported events are discarded." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "event_mask" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "EventMask" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "specifies the event mask, which is used in accordance with\n @owner_events. Note that only pointer events (i.e. button and motion events)\n may be selected." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "confine_to" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "If non-%NULL, the pointer will be confined to this\n window during the grab. If the pointer is outside @confine_to, it will\n automatically be moved to the closest edge of @confine_to and enter\n and leave events will be generated as necessary." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cursor" -- , argType = TInterface Name { namespace = "Gdk" , name = "Cursor" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the cursor to display while the grab is active. If this is %NULL then\n the normal cursors are used for @window and its descendants, and the cursor\n for @window is used for all other windows." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the timestamp of the event which led to this pointer grab. This usually\n comes from a #GdkEventButton struct, though %GDK_CURRENT_TIME can be used if\n the time isn\8217t known." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gdk" , name = "GrabStatus" }) -- throws : False -- Skip return : False foreign import ccall "gdk_pointer_grab" gdk_pointer_grab :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) CInt -> -- owner_events : TBasicType TBoolean CUInt -> -- event_mask : TInterface (Name {namespace = "Gdk", name = "EventMask"}) Ptr Gdk.Window.Window -> -- confine_to : TInterface (Name {namespace = "Gdk", name = "Window"}) Ptr Gdk.Cursor.Cursor -> -- cursor : TInterface (Name {namespace = "Gdk", name = "Cursor"}) Word32 -> -- time_ : TBasicType TUInt32 IO CUInt {-# DEPRECATED pointerGrab ["(Since version 3.0)","Use 'GI.Gdk.Objects.Device.deviceGrab' instead."] #-} -- | Grabs the pointer (usually a mouse) so that all events are passed to this -- application until the pointer is ungrabbed with 'GI.Gdk.Functions.pointerUngrab', or -- the grab window becomes unviewable. -- This overrides any previous pointer grab by this client. -- -- Pointer grabs are used for operations which need complete control over mouse -- events, even if the mouse leaves the application. -- For example in GTK+ it is used for Drag and Drop, for dragging the handle in -- the @/GtkHPaned/@ and @/GtkVPaned/@ widgets. -- -- Note that if the event mask of an X window has selected both button press and -- button release events, then a button press event will cause an automatic -- pointer grab until the button is released. -- X does this automatically since most applications expect to receive button -- press and release events in pairs. -- It is equivalent to a pointer grab on the window with /@ownerEvents@/ set to -- 'P.True'. -- -- If you set up anything at the time you take the grab that needs to be cleaned -- up when the grab ends, you should handle the t'GI.Gdk.Structs.EventGrabBroken.EventGrabBroken' events that -- are emitted when the grab ends unvoluntarily. pointerGrab :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a, Gdk.Window.IsWindow b, Gdk.Cursor.IsCursor c) => a -- ^ /@window@/: the t'GI.Gdk.Objects.Window.Window' which will own the grab (the grab window). -> Bool -- ^ /@ownerEvents@/: if 'P.False' then all pointer events are reported with respect to -- /@window@/ and are only reported if selected by /@eventMask@/. If 'P.True' then pointer -- events for this application are reported as normal, but pointer events outside -- this application are reported with respect to /@window@/ and only if selected by -- /@eventMask@/. In either mode, unreported events are discarded. -> [Gdk.Flags.EventMask] -- ^ /@eventMask@/: specifies the event mask, which is used in accordance with -- /@ownerEvents@/. Note that only pointer events (i.e. button and motion events) -- may be selected. -> Maybe (b) -- ^ /@confineTo@/: If non-'P.Nothing', the pointer will be confined to this -- window during the grab. If the pointer is outside /@confineTo@/, it will -- automatically be moved to the closest edge of /@confineTo@/ and enter -- and leave events will be generated as necessary. -> Maybe (c) -- ^ /@cursor@/: the cursor to display while the grab is active. If this is 'P.Nothing' then -- the normal cursors are used for /@window@/ and its descendants, and the cursor -- for /@window@/ is used for all other windows. -> Word32 -- ^ /@time_@/: the timestamp of the event which led to this pointer grab. This usually -- comes from a t'GI.Gdk.Structs.EventButton.EventButton' struct, though 'GI.Gdk.Constants.CURRENT_TIME' can be used if -- the time isn’t known. -> m Gdk.Enums.GrabStatus -- ^ __Returns:__ 'GI.Gdk.Enums.GrabStatusSuccess' if the grab was successful. pointerGrab :: a -> Bool -> [EventMask] -> Maybe b -> Maybe c -> Word32 -> m GrabStatus pointerGrab a window Bool ownerEvents [EventMask] eventMask Maybe b confineTo Maybe c cursor Word32 time_ = IO GrabStatus -> m GrabStatus forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GrabStatus -> m GrabStatus) -> IO GrabStatus -> m GrabStatus forall a b. (a -> b) -> a -> b $ do Ptr Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window let ownerEvents' :: CInt ownerEvents' = (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 ownerEvents let eventMask' :: CUInt eventMask' = [EventMask] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [EventMask] eventMask Ptr Window maybeConfineTo <- case Maybe b confineTo of Maybe b Nothing -> Ptr Window -> IO (Ptr Window) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Window forall a. Ptr a nullPtr Just b jConfineTo -> do Ptr Window jConfineTo' <- b -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jConfineTo Ptr Window -> IO (Ptr Window) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Window jConfineTo' Ptr Cursor maybeCursor <- case Maybe c cursor of Maybe c Nothing -> Ptr Cursor -> IO (Ptr Cursor) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cursor forall a. Ptr a nullPtr Just c jCursor -> do Ptr Cursor jCursor' <- c -> IO (Ptr Cursor) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr c jCursor Ptr Cursor -> IO (Ptr Cursor) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cursor jCursor' CUInt result <- Ptr Window -> CInt -> CUInt -> Ptr Window -> Ptr Cursor -> Word32 -> IO CUInt gdk_pointer_grab Ptr Window window' CInt ownerEvents' CUInt eventMask' Ptr Window maybeConfineTo Ptr Cursor maybeCursor Word32 time_ let result' :: GrabStatus result' = (Int -> GrabStatus forall a. Enum a => Int -> a toEnum (Int -> GrabStatus) -> (CUInt -> Int) -> CUInt -> GrabStatus forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window Maybe b -> (b -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe b confineTo b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Maybe c -> (c -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe c cursor c -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GrabStatus -> IO GrabStatus forall (m :: * -> *) a. Monad m => a -> m a return GrabStatus result' -- function pixbuf_get_from_window -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Source window" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "src_x" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Source X coordinate within @window" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "src_y" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Source Y coordinate within @window" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "width" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Width in pixels of region to get" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "height" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Height in pixels of region to get" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" }) -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_get_from_window" gdk_pixbuf_get_from_window :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) Int32 -> -- src_x : TBasicType TInt Int32 -> -- src_y : TBasicType TInt Int32 -> -- width : TBasicType TInt Int32 -> -- height : TBasicType TInt IO (Ptr GdkPixbuf.Pixbuf.Pixbuf) -- | Transfers image data from a t'GI.Gdk.Objects.Window.Window' and converts it to an RGB(A) -- representation inside a t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf'. In other words, copies -- image data from a server-side drawable to a client-side RGB(A) buffer. -- This allows you to efficiently read individual pixels on the client side. -- -- This function will create an RGB pixbuf with 8 bits per channel with -- the size specified by the /@width@/ and /@height@/ arguments scaled by the -- scale factor of /@window@/. The pixbuf will contain an alpha channel if -- the /@window@/ contains one. -- -- If the window is off the screen, then there is no image data in the -- obscured\/offscreen regions to be placed in the pixbuf. The contents of -- portions of the pixbuf corresponding to the offscreen region are undefined. -- -- If the window you’re obtaining data from is partially obscured by -- other windows, then the contents of the pixbuf areas corresponding -- to the obscured regions are undefined. -- -- If the window is not mapped (typically because it’s iconified\/minimized -- or not on the current workspace), then 'P.Nothing' will be returned. -- -- If memory can’t be allocated for the return value, 'P.Nothing' will be returned -- instead. -- -- (In short, there are several ways this function can fail, and if it fails -- it returns 'P.Nothing'; so check the return value.) pixbufGetFromWindow :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@window@/: Source window -> Int32 -- ^ /@srcX@/: Source X coordinate within /@window@/ -> Int32 -- ^ /@srcY@/: Source Y coordinate within /@window@/ -> Int32 -- ^ /@width@/: Width in pixels of region to get -> Int32 -- ^ /@height@/: Height in pixels of region to get -> m (Maybe GdkPixbuf.Pixbuf.Pixbuf) -- ^ __Returns:__ A newly-created pixbuf with a -- reference count of 1, or 'P.Nothing' on error pixbufGetFromWindow :: a -> Int32 -> Int32 -> Int32 -> Int32 -> m (Maybe Pixbuf) pixbufGetFromWindow a window Int32 srcX Int32 srcY Int32 width Int32 height = IO (Maybe Pixbuf) -> m (Maybe Pixbuf) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf)) -> IO (Maybe Pixbuf) -> m (Maybe Pixbuf) forall a b. (a -> b) -> a -> b $ do Ptr Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window Ptr Pixbuf result <- Ptr Window -> Int32 -> Int32 -> Int32 -> Int32 -> IO (Ptr Pixbuf) gdk_pixbuf_get_from_window Ptr Window window' Int32 srcX Int32 srcY Int32 width Int32 height Maybe Pixbuf maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr Pixbuf result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)) -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf) forall a b. (a -> b) -> a -> b $ \Ptr Pixbuf result' -> do Pixbuf result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr Pixbuf -> Pixbuf GdkPixbuf.Pixbuf.Pixbuf) Ptr Pixbuf result' Pixbuf -> IO Pixbuf forall (m :: * -> *) a. Monad m => a -> m a return Pixbuf result'' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window Maybe Pixbuf -> IO (Maybe Pixbuf) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Pixbuf maybeResult -- function pixbuf_get_from_surface -- Args: [ Arg -- { argCName = "surface" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Surface" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "surface to copy from" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "src_x" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Source X coordinate within @surface" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "src_y" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Source Y coordinate within @surface" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "width" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Width in pixels of region to get" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "height" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Height in pixels of region to get" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" }) -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_get_from_surface" gdk_pixbuf_get_from_surface :: Ptr Cairo.Surface.Surface -> -- surface : TInterface (Name {namespace = "cairo", name = "Surface"}) Int32 -> -- src_x : TBasicType TInt Int32 -> -- src_y : TBasicType TInt Int32 -> -- width : TBasicType TInt Int32 -> -- height : TBasicType TInt IO (Ptr GdkPixbuf.Pixbuf.Pixbuf) -- | Transfers image data from a t'GI.Cairo.Structs.Surface.Surface' and converts it to an RGB(A) -- representation inside a t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf'. This allows you to efficiently read -- individual pixels from cairo surfaces. For @/GdkWindows/@, use -- 'GI.Gdk.Functions.pixbufGetFromWindow' instead. -- -- This function will create an RGB pixbuf with 8 bits per channel. -- The pixbuf will contain an alpha channel if the /@surface@/ contains one. pixbufGetFromSurface :: (B.CallStack.HasCallStack, MonadIO m) => Cairo.Surface.Surface -- ^ /@surface@/: surface to copy from -> Int32 -- ^ /@srcX@/: Source X coordinate within /@surface@/ -> Int32 -- ^ /@srcY@/: Source Y coordinate within /@surface@/ -> Int32 -- ^ /@width@/: Width in pixels of region to get -> Int32 -- ^ /@height@/: Height in pixels of region to get -> m (Maybe GdkPixbuf.Pixbuf.Pixbuf) -- ^ __Returns:__ A newly-created pixbuf with a -- reference count of 1, or 'P.Nothing' on error pixbufGetFromSurface :: Surface -> Int32 -> Int32 -> Int32 -> Int32 -> m (Maybe Pixbuf) pixbufGetFromSurface Surface surface Int32 srcX Int32 srcY Int32 width Int32 height = IO (Maybe Pixbuf) -> m (Maybe Pixbuf) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf)) -> IO (Maybe Pixbuf) -> m (Maybe Pixbuf) forall a b. (a -> b) -> a -> b $ do Ptr Surface surface' <- Surface -> IO (Ptr Surface) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Surface surface Ptr Pixbuf result <- Ptr Surface -> Int32 -> Int32 -> Int32 -> Int32 -> IO (Ptr Pixbuf) gdk_pixbuf_get_from_surface Ptr Surface surface' Int32 srcX Int32 srcY Int32 width Int32 height Maybe Pixbuf maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr Pixbuf result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)) -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf) forall a b. (a -> b) -> a -> b $ \Ptr Pixbuf result' -> do Pixbuf result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr Pixbuf -> Pixbuf GdkPixbuf.Pixbuf.Pixbuf) Ptr Pixbuf result' Pixbuf -> IO Pixbuf forall (m :: * -> *) a. Monad m => a -> m a return Pixbuf result'' Surface -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Surface surface Maybe Pixbuf -> IO (Maybe Pixbuf) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Pixbuf maybeResult -- function parse_args -- Args: [ Arg -- { argCName = "argc" -- , argType = TBasicType TInt -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "argv" -- , argType = TCArray False (-1) 0 (TBasicType TUTF8) -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the array of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "argc" -- , argType = TBasicType TInt -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_parse_args" gdk_parse_args :: Ptr Int32 -> -- argc : TBasicType TInt Ptr (Ptr CString) -> -- argv : TCArray False (-1) 0 (TBasicType TUTF8) IO () -- | Parse command line arguments, and store for future -- use by calls to 'GI.Gdk.Objects.Display.displayOpen'. -- -- Any arguments used by GDK are removed from the array and /@argc@/ and /@argv@/ are -- updated accordingly. -- -- You shouldn’t call this function explicitly if you are using -- @/gtk_init()/@, @/gtk_init_check()/@, 'GI.Gdk.Functions.init', or 'GI.Gdk.Functions.initCheck'. -- -- /Since: 2.2/ parseArgs :: (B.CallStack.HasCallStack, MonadIO m) => [T.Text] -- ^ /@argv@/: the array of command line arguments. -> m ([T.Text]) parseArgs :: [Text] -> m [Text] parseArgs [Text] argv = IO [Text] -> m [Text] forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do let argc :: Int32 argc = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Text] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Text] argv Ptr Int32 argc' <- IO (Ptr Int32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Int32) Ptr Int32 -> Int32 -> IO () forall a. Storable a => Ptr a -> a -> IO () poke Ptr Int32 argc' Int32 argc Ptr CString argv' <- [Text] -> IO (Ptr CString) packUTF8CArray [Text] argv Ptr (Ptr CString) argv'' <- IO (Ptr (Ptr CString)) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr (Ptr CString)) Ptr (Ptr CString) -> Ptr CString -> IO () forall a. Storable a => Ptr a -> a -> IO () poke Ptr (Ptr CString) argv'' Ptr CString argv' Ptr Int32 -> Ptr (Ptr CString) -> IO () gdk_parse_args Ptr Int32 argc' Ptr (Ptr CString) argv'' Int32 argc'' <- Ptr Int32 -> IO Int32 forall a. Storable a => Ptr a -> IO a peek Ptr Int32 argc' Ptr CString argv''' <- Ptr (Ptr CString) -> IO (Ptr CString) forall a. Storable a => Ptr a -> IO a peek Ptr (Ptr CString) argv'' [Text] argv'''' <- (Int32 -> Ptr CString -> IO [Text] forall a. (HasCallStack, Integral a) => a -> Ptr CString -> IO [Text] unpackUTF8CArrayWithLength Int32 argc'') Ptr CString argv''' (Int32 -> (CString -> IO ()) -> Ptr CString -> IO () forall a b c. (Storable a, Integral b) => b -> (a -> IO c) -> Ptr a -> IO () mapCArrayWithLength Int32 argc'') CString -> IO () forall a. Ptr a -> IO () freeMem Ptr CString argv''' Ptr CString -> IO () forall a. Ptr a -> IO () freeMem Ptr CString argv''' Ptr Int32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Int32 argc' Ptr (Ptr CString) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr CString) argv'' [Text] -> IO [Text] forall (m :: * -> *) a. Monad m => a -> m a return [Text] argv'''' -- function pango_context_get_for_screen -- Args: [ Arg -- { argCName = "screen" -- , argType = TInterface Name { namespace = "Gdk" , name = "Screen" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #GdkScreen for which the context is to be created." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Pango" , name = "Context" }) -- throws : False -- Skip return : False foreign import ccall "gdk_pango_context_get_for_screen" gdk_pango_context_get_for_screen :: Ptr Gdk.Screen.Screen -> -- screen : TInterface (Name {namespace = "Gdk", name = "Screen"}) IO (Ptr Pango.Context.Context) -- | Creates a t'GI.Pango.Objects.Context.Context' for /@screen@/. -- -- The context must be freed when you’re finished with it. -- -- When using GTK+, normally you should use @/gtk_widget_get_pango_context()/@ -- instead of this function, to get the appropriate context for -- the widget you intend to render text onto. -- -- The newly created context will have the default font options -- (see t'GI.Cairo.Structs.FontOptions.FontOptions') for the screen; if these options -- change it will not be updated. Using @/gtk_widget_get_pango_context()/@ -- is more convenient if you want to keep a context around and track -- changes to the screen’s font rendering settings. -- -- /Since: 2.2/ pangoContextGetForScreen :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Screen.IsScreen a) => a -- ^ /@screen@/: the t'GI.Gdk.Objects.Screen.Screen' for which the context is to be created. -> m Pango.Context.Context -- ^ __Returns:__ a new t'GI.Pango.Objects.Context.Context' for /@screen@/ pangoContextGetForScreen :: a -> m Context pangoContextGetForScreen a screen = IO Context -> m Context forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Context -> m Context) -> IO Context -> m Context forall a b. (a -> b) -> a -> b $ do Ptr Screen screen' <- a -> IO (Ptr Screen) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a screen Ptr Context result <- Ptr Screen -> IO (Ptr Context) gdk_pango_context_get_for_screen Ptr Screen screen' Text -> Ptr Context -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "pangoContextGetForScreen" Ptr Context result Context result' <- ((ManagedPtr Context -> Context) -> Ptr Context -> IO Context forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr Context -> Context Pango.Context.Context) Ptr Context result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a screen Context -> IO Context forall (m :: * -> *) a. Monad m => a -> m a return Context result' -- function pango_context_get_for_display -- Args: [ Arg -- { argCName = "display" -- , argType = -- TInterface Name { namespace = "Gdk" , name = "Display" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #GdkDisplay for which the context is to be created" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Pango" , name = "Context" }) -- throws : False -- Skip return : False foreign import ccall "gdk_pango_context_get_for_display" gdk_pango_context_get_for_display :: Ptr Gdk.Display.Display -> -- display : TInterface (Name {namespace = "Gdk", name = "Display"}) IO (Ptr Pango.Context.Context) -- | Creates a t'GI.Pango.Objects.Context.Context' for /@display@/. -- -- The context must be freed when you’re finished with it. -- -- When using GTK+, normally you should use @/gtk_widget_get_pango_context()/@ -- instead of this function, to get the appropriate context for -- the widget you intend to render text onto. -- -- The newly created context will have the default font options -- (see t'GI.Cairo.Structs.FontOptions.FontOptions') for the display; if these options -- change it will not be updated. Using @/gtk_widget_get_pango_context()/@ -- is more convenient if you want to keep a context around and track -- changes to the font rendering settings. -- -- /Since: 3.22/ pangoContextGetForDisplay :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) => a -- ^ /@display@/: the t'GI.Gdk.Objects.Display.Display' for which the context is to be created -> m Pango.Context.Context -- ^ __Returns:__ a new t'GI.Pango.Objects.Context.Context' for /@display@/ pangoContextGetForDisplay :: a -> m Context pangoContextGetForDisplay a display = IO Context -> m Context forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Context -> m Context) -> IO Context -> m Context 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 Context result <- Ptr Display -> IO (Ptr Context) gdk_pango_context_get_for_display Ptr Display display' Text -> Ptr Context -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "pangoContextGetForDisplay" Ptr Context result Context result' <- ((ManagedPtr Context -> Context) -> Ptr Context -> IO Context forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr Context -> Context Pango.Context.Context) Ptr Context result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a display Context -> IO Context forall (m :: * -> *) a. Monad m => a -> m a return Context result' -- function pango_context_get -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Pango" , name = "Context" }) -- throws : False -- Skip return : False foreign import ccall "gdk_pango_context_get" gdk_pango_context_get :: IO (Ptr Pango.Context.Context) -- | Creates a t'GI.Pango.Objects.Context.Context' for the default GDK screen. -- -- The context must be freed when you’re finished with it. -- -- When using GTK+, normally you should use @/gtk_widget_get_pango_context()/@ -- instead of this function, to get the appropriate context for -- the widget you intend to render text onto. -- -- The newly created context will have the default font options (see -- t'GI.Cairo.Structs.FontOptions.FontOptions') for the default screen; if these options -- change it will not be updated. Using @/gtk_widget_get_pango_context()/@ -- is more convenient if you want to keep a context around and track -- changes to the screen’s font rendering settings. pangoContextGet :: (B.CallStack.HasCallStack, MonadIO m) => m Pango.Context.Context -- ^ __Returns:__ a new t'GI.Pango.Objects.Context.Context' for the default display pangoContextGet :: m Context pangoContextGet = IO Context -> m Context forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Context -> m Context) -> IO Context -> m Context forall a b. (a -> b) -> a -> b $ do Ptr Context result <- IO (Ptr Context) gdk_pango_context_get Text -> Ptr Context -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "pangoContextGet" Ptr Context result Context result' <- ((ManagedPtr Context -> Context) -> Ptr Context -> IO Context forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr Context -> Context Pango.Context.Context) Ptr Context result Context -> IO Context forall (m :: * -> *) a. Monad m => a -> m a return Context result' -- function offscreen_window_set_embedder -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkWindow" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "embedder" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the #GdkWindow that @window gets embedded in" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_offscreen_window_set_embedder" gdk_offscreen_window_set_embedder :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) Ptr Gdk.Window.Window -> -- embedder : TInterface (Name {namespace = "Gdk", name = "Window"}) IO () -- | Sets /@window@/ to be embedded in /@embedder@/. -- -- To fully embed an offscreen window, in addition to calling this -- function, it is also necessary to handle the [pickEmbeddedChild]("GI.Gdk.Objects.Window#g:signal:pickEmbeddedChild") -- signal on the /@embedder@/ and the [toEmbedder]("GI.Gdk.Objects.Window#g:signal:toEmbedder") and -- [fromEmbedder]("GI.Gdk.Objects.Window#g:signal:fromEmbedder") signals on /@window@/. -- -- /Since: 2.18/ offscreenWindowSetEmbedder :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a, Gdk.Window.IsWindow b) => a -- ^ /@window@/: a t'GI.Gdk.Objects.Window.Window' -> b -- ^ /@embedder@/: the t'GI.Gdk.Objects.Window.Window' that /@window@/ gets embedded in -> m () offscreenWindowSetEmbedder :: a -> b -> m () offscreenWindowSetEmbedder a window b embedder = 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 Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window Ptr Window embedder' <- b -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b embedder Ptr Window -> Ptr Window -> IO () gdk_offscreen_window_set_embedder Ptr Window window' Ptr Window embedder' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr b embedder () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function offscreen_window_get_surface -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkWindow" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "cairo" , name = "Surface" }) -- throws : False -- Skip return : False foreign import ccall "gdk_offscreen_window_get_surface" gdk_offscreen_window_get_surface :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) IO (Ptr Cairo.Surface.Surface) -- | Gets the offscreen surface that an offscreen window renders into. -- If you need to keep this around over window resizes, you need to -- add a reference to it. offscreenWindowGetSurface :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@window@/: a t'GI.Gdk.Objects.Window.Window' -> m (Maybe Cairo.Surface.Surface) -- ^ __Returns:__ The offscreen surface, or -- 'P.Nothing' if not offscreen offscreenWindowGetSurface :: a -> m (Maybe Surface) offscreenWindowGetSurface a window = IO (Maybe Surface) -> m (Maybe Surface) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Surface) -> m (Maybe Surface)) -> IO (Maybe Surface) -> m (Maybe Surface) forall a b. (a -> b) -> a -> b $ do Ptr Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window Ptr Surface result <- Ptr Window -> IO (Ptr Surface) gdk_offscreen_window_get_surface Ptr Window window' Maybe Surface maybeResult <- Ptr Surface -> (Ptr Surface -> IO Surface) -> IO (Maybe Surface) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr Surface result ((Ptr Surface -> IO Surface) -> IO (Maybe Surface)) -> (Ptr Surface -> IO Surface) -> IO (Maybe Surface) forall a b. (a -> b) -> a -> b $ \Ptr Surface result' -> do Surface result'' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a newBoxed ManagedPtr Surface -> Surface Cairo.Surface.Surface) Ptr Surface result' Surface -> IO Surface forall (m :: * -> *) a. Monad m => a -> m a return Surface result'' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window Maybe Surface -> IO (Maybe Surface) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Surface maybeResult -- function offscreen_window_get_embedder -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkWindow" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Window" }) -- throws : False -- Skip return : False foreign import ccall "gdk_offscreen_window_get_embedder" gdk_offscreen_window_get_embedder :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) IO (Ptr Gdk.Window.Window) -- | Gets the window that /@window@/ is embedded in. -- -- /Since: 2.18/ offscreenWindowGetEmbedder :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@window@/: a t'GI.Gdk.Objects.Window.Window' -> m (Maybe Gdk.Window.Window) -- ^ __Returns:__ the embedding t'GI.Gdk.Objects.Window.Window', or -- 'P.Nothing' if /@window@/ is not an mbedded offscreen window offscreenWindowGetEmbedder :: a -> m (Maybe Window) offscreenWindowGetEmbedder a window = IO (Maybe Window) -> m (Maybe Window) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Window) -> m (Maybe Window)) -> IO (Maybe Window) -> m (Maybe Window) forall a b. (a -> b) -> a -> b $ do Ptr Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window Ptr Window result <- Ptr Window -> IO (Ptr Window) gdk_offscreen_window_get_embedder Ptr Window window' Maybe Window maybeResult <- Ptr Window -> (Ptr Window -> IO Window) -> IO (Maybe Window) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr Window result ((Ptr Window -> IO Window) -> IO (Maybe Window)) -> (Ptr Window -> IO Window) -> IO (Maybe Window) forall a b. (a -> b) -> a -> b $ \Ptr Window result' -> do Window result'' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Window -> Window Gdk.Window.Window) Ptr Window result' Window -> IO Window forall (m :: * -> *) a. Monad m => a -> m a return Window result'' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window Maybe Window -> IO (Maybe Window) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Window maybeResult -- function notify_startup_complete_with_id -- Args: [ Arg -- { argCName = "startup_id" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a startup-notification identifier, for which\n notification process should be completed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_notify_startup_complete_with_id" gdk_notify_startup_complete_with_id :: CString -> -- startup_id : TBasicType TUTF8 IO () -- | Indicates to the GUI environment that the application has -- finished loading, using a given identifier. -- -- GTK+ will call this function automatically for @/GtkWindow/@ -- with custom startup-notification identifier unless -- @/gtk_window_set_auto_startup_notification()/@ is called to -- disable that feature. -- -- /Since: 2.12/ notifyStartupCompleteWithId :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@startupId@/: a startup-notification identifier, for which -- notification process should be completed -> m () notifyStartupCompleteWithId :: Text -> m () notifyStartupCompleteWithId Text startupId = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do CString startupId' <- Text -> IO CString textToCString Text startupId CString -> IO () gdk_notify_startup_complete_with_id CString startupId' CString -> IO () forall a. Ptr a -> IO () freeMem CString startupId' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function notify_startup_complete -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_notify_startup_complete" gdk_notify_startup_complete :: IO () -- | Indicates to the GUI environment that the application has finished -- loading. If the applications opens windows, this function is -- normally called after opening the application’s initial set of -- windows. -- -- GTK+ will call this function automatically after opening the first -- @/GtkWindow/@ unless @/gtk_window_set_auto_startup_notification()/@ is called -- to disable that feature. -- -- /Since: 2.2/ notifyStartupComplete :: (B.CallStack.HasCallStack, MonadIO m) => m () notifyStartupComplete :: m () notifyStartupComplete = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gdk_notify_startup_complete () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function list_visuals -- Args: [] -- Lengths: [] -- returnType: Just -- (TGList (TInterface Name { namespace = "Gdk" , name = "Visual" })) -- throws : False -- Skip return : False foreign import ccall "gdk_list_visuals" gdk_list_visuals :: IO (Ptr (GList (Ptr Gdk.Visual.Visual))) {-# DEPRECATED listVisuals ["(Since version 3.22)","Use gdk_screen_list_visuals (gdk_screen_get_default ())."] #-} -- | Lists the available visuals for the default screen. -- (See 'GI.Gdk.Objects.Screen.screenListVisuals') -- A visual describes a hardware image data format. -- For example, a visual might support 24-bit color, or 8-bit color, -- and might expect pixels to be in a certain format. -- -- Call @/g_list_free()/@ on the return value when you’re finished with it. listVisuals :: (B.CallStack.HasCallStack, MonadIO m) => m [Gdk.Visual.Visual] -- ^ __Returns:__ -- a list of visuals; the list must be freed, but not its contents listVisuals :: m [Visual] listVisuals = IO [Visual] -> m [Visual] forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Visual] -> m [Visual]) -> IO [Visual] -> m [Visual] forall a b. (a -> b) -> a -> b $ do Ptr (GList (Ptr Visual)) result <- IO (Ptr (GList (Ptr Visual))) gdk_list_visuals [Ptr Visual] result' <- Ptr (GList (Ptr Visual)) -> IO [Ptr Visual] forall a. Ptr (GList (Ptr a)) -> IO [Ptr a] unpackGList Ptr (GList (Ptr Visual)) result [Visual] result'' <- (Ptr Visual -> IO Visual) -> [Ptr Visual] -> IO [Visual] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((ManagedPtr Visual -> Visual) -> Ptr Visual -> IO Visual forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Visual -> Visual Gdk.Visual.Visual) [Ptr Visual] result' Ptr (GList (Ptr Visual)) -> IO () forall a. Ptr (GList a) -> IO () g_list_free Ptr (GList (Ptr Visual)) result [Visual] -> IO [Visual] forall (m :: * -> *) a. Monad m => a -> m a return [Visual] result'' -- function keyval_to_upper -- Args: [ Arg -- { argCName = "keyval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a key value." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gdk_keyval_to_upper" gdk_keyval_to_upper :: Word32 -> -- keyval : TBasicType TUInt IO Word32 -- | Converts a key value to upper case, if applicable. keyvalToUpper :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@keyval@/: a key value. -> m Word32 -- ^ __Returns:__ the upper case form of /@keyval@/, or /@keyval@/ itself if it is already -- in upper case or it is not subject to case conversion. keyvalToUpper :: Word32 -> m Word32 keyvalToUpper Word32 keyval = IO Word32 -> m Word32 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do Word32 result <- Word32 -> IO Word32 gdk_keyval_to_upper Word32 keyval Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function keyval_to_unicode -- Args: [ Arg -- { argCName = "keyval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a GDK key symbol" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "gdk_keyval_to_unicode" gdk_keyval_to_unicode :: Word32 -> -- keyval : TBasicType TUInt IO Word32 -- | Convert from a GDK key symbol to the corresponding ISO10646 (Unicode) -- character. keyvalToUnicode :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@keyval@/: a GDK key symbol -> m Word32 -- ^ __Returns:__ the corresponding unicode character, or 0 if there -- is no corresponding character. keyvalToUnicode :: Word32 -> m Word32 keyvalToUnicode Word32 keyval = IO Word32 -> m Word32 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do Word32 result <- Word32 -> IO Word32 gdk_keyval_to_unicode Word32 keyval Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function keyval_to_lower -- Args: [ Arg -- { argCName = "keyval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a key value." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gdk_keyval_to_lower" gdk_keyval_to_lower :: Word32 -> -- keyval : TBasicType TUInt IO Word32 -- | Converts a key value to lower case, if applicable. keyvalToLower :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@keyval@/: a key value. -> m Word32 -- ^ __Returns:__ the lower case form of /@keyval@/, or /@keyval@/ itself if it is already -- in lower case or it is not subject to case conversion. keyvalToLower :: Word32 -> m Word32 keyvalToLower Word32 keyval = IO Word32 -> m Word32 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do Word32 result <- Word32 -> IO Word32 gdk_keyval_to_lower Word32 keyval Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function keyval_name -- Args: [ Arg -- { argCName = "keyval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a key value" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gdk_keyval_name" gdk_keyval_name :: Word32 -> -- keyval : TBasicType TUInt IO CString -- | Converts a key value into a symbolic name. -- -- The names are the same as those in the -- @gdk\/gdkkeysyms.h@ header file -- but without the leading “GDK_KEY_”. keyvalName :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@keyval@/: a key value -> m (Maybe T.Text) -- ^ __Returns:__ a string containing the name -- of the key, or 'P.Nothing' if /@keyval@/ is not a valid key. The string -- should not be modified. keyvalName :: Word32 -> m (Maybe Text) keyvalName Word32 keyval = IO (Maybe Text) -> m (Maybe Text) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Text) -> m (Maybe Text)) -> IO (Maybe Text) -> m (Maybe Text) forall a b. (a -> b) -> a -> b $ do CString result <- Word32 -> IO CString gdk_keyval_name Word32 keyval Maybe Text maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString result ((CString -> IO Text) -> IO (Maybe Text)) -> (CString -> IO Text) -> IO (Maybe Text) forall a b. (a -> b) -> a -> b $ \CString result' -> do Text result'' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result' Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result'' Maybe Text -> IO (Maybe Text) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Text maybeResult -- function keyval_is_upper -- Args: [ Arg -- { argCName = "keyval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a key value." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_keyval_is_upper" gdk_keyval_is_upper :: Word32 -> -- keyval : TBasicType TUInt IO CInt -- | Returns 'P.True' if the given key value is in upper case. keyvalIsUpper :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@keyval@/: a key value. -> m Bool -- ^ __Returns:__ 'P.True' if /@keyval@/ is in upper case, or if /@keyval@/ is not subject to -- case conversion. keyvalIsUpper :: Word32 -> m Bool keyvalIsUpper Word32 keyval = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do CInt result <- Word32 -> IO CInt gdk_keyval_is_upper Word32 keyval let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function keyval_is_lower -- Args: [ Arg -- { argCName = "keyval" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a key value." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_keyval_is_lower" gdk_keyval_is_lower :: Word32 -> -- keyval : TBasicType TUInt IO CInt -- | Returns 'P.True' if the given key value is in lower case. keyvalIsLower :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@keyval@/: a key value. -> m Bool -- ^ __Returns:__ 'P.True' if /@keyval@/ is in lower case, or if /@keyval@/ is not -- subject to case conversion. keyvalIsLower :: Word32 -> m Bool keyvalIsLower Word32 keyval = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do CInt result <- Word32 -> IO CInt gdk_keyval_is_lower Word32 keyval let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function keyval_from_name -- Args: [ Arg -- { argCName = "keyval_name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a key name" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gdk_keyval_from_name" gdk_keyval_from_name :: CString -> -- keyval_name : TBasicType TUTF8 IO Word32 -- | Converts a key name to a key value. -- -- The names are the same as those in the -- @gdk\/gdkkeysyms.h@ header file -- but without the leading “GDK_KEY_”. keyvalFromName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@keyvalName@/: a key name -> m Word32 -- ^ __Returns:__ the corresponding key value, or 'GI.Gdk.Constants.KEY_VoidSymbol' -- if the key name is not a valid key keyvalFromName :: Text -> m Word32 keyvalFromName Text keyvalName = IO Word32 -> m Word32 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do CString keyvalName' <- Text -> IO CString textToCString Text keyvalName Word32 result <- CString -> IO Word32 gdk_keyval_from_name CString keyvalName' CString -> IO () forall a. Ptr a -> IO () freeMem CString keyvalName' Word32 -> IO Word32 forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function keyval_convert_case -- Args: [ Arg -- { argCName = "symbol" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a keyval" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lower" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for lowercase version of @symbol" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "upper" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for uppercase version of @symbol" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_keyval_convert_case" gdk_keyval_convert_case :: Word32 -> -- symbol : TBasicType TUInt Ptr Word32 -> -- lower : TBasicType TUInt Ptr Word32 -> -- upper : TBasicType TUInt IO () -- | Obtains the upper- and lower-case versions of the keyval /@symbol@/. -- Examples of keyvals are 'GI.Gdk.Constants.KEY_a', @/GDK_KEY_Enter/@, 'GI.Gdk.Constants.KEY_F1', etc. keyvalConvertCase :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@symbol@/: a keyval -> m ((Word32, Word32)) keyvalConvertCase :: Word32 -> m (Word32, Word32) keyvalConvertCase Word32 symbol = IO (Word32, Word32) -> m (Word32, Word32) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, Word32) -> m (Word32, Word32)) -> IO (Word32, Word32) -> m (Word32, Word32) forall a b. (a -> b) -> a -> b $ do Ptr Word32 lower <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Ptr Word32 upper <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Word32 -> Ptr Word32 -> Ptr Word32 -> IO () gdk_keyval_convert_case Word32 symbol Ptr Word32 lower Ptr Word32 upper Word32 lower' <- Ptr Word32 -> IO Word32 forall a. Storable a => Ptr a -> IO a peek Ptr Word32 lower Word32 upper' <- Ptr Word32 -> IO Word32 forall a. Storable a => Ptr a -> IO a peek Ptr Word32 upper Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 lower Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 upper (Word32, Word32) -> IO (Word32, Word32) forall (m :: * -> *) a. Monad m => a -> m a return (Word32 lower', Word32 upper') -- function keyboard_ungrab -- Args: [ Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no\n timestamp is available." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_keyboard_ungrab" gdk_keyboard_ungrab :: Word32 -> -- time_ : TBasicType TUInt32 IO () {-# DEPRECATED keyboardUngrab ["(Since version 3.0)","Use 'GI.Gdk.Objects.Device.deviceUngrab', together with 'GI.Gdk.Objects.Device.deviceGrab'"," instead."] #-} -- | Ungrabs the keyboard on the default display, if it is grabbed by this -- application. keyboardUngrab :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@time_@/: a timestamp from a t'GI.Gdk.Unions.Event.Event', or 'GI.Gdk.Constants.CURRENT_TIME' if no -- timestamp is available. -> m () keyboardUngrab :: Word32 -> m () keyboardUngrab Word32 time_ = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do Word32 -> IO () gdk_keyboard_ungrab Word32 time_ () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function keyboard_grab -- Args: [ Arg -- { argCName = "window" -- , argType = TInterface Name { namespace = "Gdk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #GdkWindow which will own the grab (the grab window)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "owner_events" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "if %FALSE then all keyboard events are reported with respect to\n @window. If %TRUE then keyboard events for this application are\n reported as normal, but keyboard events outside this application\n are reported with respect to @window. Both key press and key\n release events are always reported, independant of the event mask\n set by the application." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no timestamp is\n available." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gdk" , name = "GrabStatus" }) -- throws : False -- Skip return : False foreign import ccall "gdk_keyboard_grab" gdk_keyboard_grab :: Ptr Gdk.Window.Window -> -- window : TInterface (Name {namespace = "Gdk", name = "Window"}) CInt -> -- owner_events : TBasicType TBoolean Word32 -> -- time_ : TBasicType TUInt32 IO CUInt {-# DEPRECATED keyboardGrab ["(Since version 3.0)","Use 'GI.Gdk.Objects.Device.deviceGrab' instead."] #-} -- | Grabs the keyboard so that all events are passed to this -- application until the keyboard is ungrabbed with 'GI.Gdk.Functions.keyboardUngrab'. -- This overrides any previous keyboard grab by this client. -- -- If you set up anything at the time you take the grab that needs to be cleaned -- up when the grab ends, you should handle the t'GI.Gdk.Structs.EventGrabBroken.EventGrabBroken' events that -- are emitted when the grab ends unvoluntarily. keyboardGrab :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) => a -- ^ /@window@/: the t'GI.Gdk.Objects.Window.Window' which will own the grab (the grab window). -> Bool -- ^ /@ownerEvents@/: if 'P.False' then all keyboard events are reported with respect to -- /@window@/. If 'P.True' then keyboard events for this application are -- reported as normal, but keyboard events outside this application -- are reported with respect to /@window@/. Both key press and key -- release events are always reported, independant of the event mask -- set by the application. -> Word32 -- ^ /@time_@/: a timestamp from a t'GI.Gdk.Unions.Event.Event', or 'GI.Gdk.Constants.CURRENT_TIME' if no timestamp is -- available. -> m Gdk.Enums.GrabStatus -- ^ __Returns:__ 'GI.Gdk.Enums.GrabStatusSuccess' if the grab was successful. keyboardGrab :: a -> Bool -> Word32 -> m GrabStatus keyboardGrab a window Bool ownerEvents Word32 time_ = IO GrabStatus -> m GrabStatus forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO GrabStatus -> m GrabStatus) -> IO GrabStatus -> m GrabStatus forall a b. (a -> b) -> a -> b $ do Ptr Window window' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a window let ownerEvents' :: CInt ownerEvents' = (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 ownerEvents CUInt result <- Ptr Window -> CInt -> Word32 -> IO CUInt gdk_keyboard_grab Ptr Window window' CInt ownerEvents' Word32 time_ let result' :: GrabStatus result' = (Int -> GrabStatus forall a. Enum a => Int -> a toEnum (Int -> GrabStatus) -> (CUInt -> Int) -> CUInt -> GrabStatus forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a window GrabStatus -> IO GrabStatus forall (m :: * -> *) a. Monad m => a -> m a return GrabStatus result' -- function init_check -- Args: [ Arg -- { argCName = "argc" -- , argType = TBasicType TInt -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "argv" -- , argType = TCArray False (-1) 0 (TBasicType TUTF8) -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the array of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "argc" -- , argType = TBasicType TInt -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_init_check" gdk_init_check :: Ptr Int32 -> -- argc : TBasicType TInt Ptr (Ptr CString) -> -- argv : TCArray False (-1) 0 (TBasicType TUTF8) IO CInt -- | Initializes the GDK library and connects to the windowing system, -- returning 'P.True' on success. -- -- Any arguments used by GDK are removed from the array and /@argc@/ and /@argv@/ -- are updated accordingly. -- -- GTK+ initializes GDK in @/gtk_init()/@ and so this function is not usually -- needed by GTK+ applications. initCheck :: (B.CallStack.HasCallStack, MonadIO m) => [T.Text] -- ^ /@argv@/: the array of command line arguments. -> m ((Bool, [T.Text])) -- ^ __Returns:__ 'P.True' if initialization succeeded. initCheck :: [Text] -> m (Bool, [Text]) initCheck [Text] argv = IO (Bool, [Text]) -> m (Bool, [Text]) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Bool, [Text]) -> m (Bool, [Text])) -> IO (Bool, [Text]) -> m (Bool, [Text]) forall a b. (a -> b) -> a -> b $ do let argc :: Int32 argc = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Text] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Text] argv Ptr Int32 argc' <- IO (Ptr Int32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Int32) Ptr Int32 -> Int32 -> IO () forall a. Storable a => Ptr a -> a -> IO () poke Ptr Int32 argc' Int32 argc Ptr CString argv' <- [Text] -> IO (Ptr CString) packUTF8CArray [Text] argv Ptr (Ptr CString) argv'' <- IO (Ptr (Ptr CString)) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr (Ptr CString)) Ptr (Ptr CString) -> Ptr CString -> IO () forall a. Storable a => Ptr a -> a -> IO () poke Ptr (Ptr CString) argv'' Ptr CString argv' CInt result <- Ptr Int32 -> Ptr (Ptr CString) -> IO CInt gdk_init_check Ptr Int32 argc' Ptr (Ptr CString) argv'' Int32 argc'' <- Ptr Int32 -> IO Int32 forall a. Storable a => Ptr a -> IO a peek Ptr Int32 argc' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result Ptr CString argv''' <- Ptr (Ptr CString) -> IO (Ptr CString) forall a. Storable a => Ptr a -> IO a peek Ptr (Ptr CString) argv'' [Text] argv'''' <- (Int32 -> Ptr CString -> IO [Text] forall a. (HasCallStack, Integral a) => a -> Ptr CString -> IO [Text] unpackUTF8CArrayWithLength Int32 argc'') Ptr CString argv''' (Int32 -> (CString -> IO ()) -> Ptr CString -> IO () forall a b c. (Storable a, Integral b) => b -> (a -> IO c) -> Ptr a -> IO () mapCArrayWithLength Int32 argc'') CString -> IO () forall a. Ptr a -> IO () freeMem Ptr CString argv''' Ptr CString -> IO () forall a. Ptr a -> IO () freeMem Ptr CString argv''' Ptr Int32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Int32 argc' Ptr (Ptr CString) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr CString) argv'' (Bool, [Text]) -> IO (Bool, [Text]) forall (m :: * -> *) a. Monad m => a -> m a return (Bool result', [Text] argv'''') -- function init -- Args: [ Arg -- { argCName = "argc" -- , argType = TBasicType TInt -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "argv" -- , argType = TCArray False (-1) 0 (TBasicType TUTF8) -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the array of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "argc" -- , argType = TBasicType TInt -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of command line arguments." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_init" gdk_init :: Ptr Int32 -> -- argc : TBasicType TInt Ptr (Ptr CString) -> -- argv : TCArray False (-1) 0 (TBasicType TUTF8) IO () -- | Initializes the GDK library and connects to the windowing system. -- If initialization fails, a warning message is output and the application -- terminates with a call to @exit(1)@. -- -- Any arguments used by GDK are removed from the array and /@argc@/ and /@argv@/ -- are updated accordingly. -- -- GTK+ initializes GDK in @/gtk_init()/@ and so this function is not usually -- needed by GTK+ applications. init :: (B.CallStack.HasCallStack, MonadIO m) => [T.Text] -- ^ /@argv@/: the array of command line arguments. -> m ([T.Text]) init :: [Text] -> m [Text] init [Text] argv = IO [Text] -> m [Text] forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do let argc :: Int32 argc = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Text] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Text] argv Ptr Int32 argc' <- IO (Ptr Int32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Int32) Ptr Int32 -> Int32 -> IO () forall a. Storable a => Ptr a -> a -> IO () poke Ptr Int32 argc' Int32 argc Ptr CString argv' <- [Text] -> IO (Ptr CString) packUTF8CArray [Text] argv Ptr (Ptr CString) argv'' <- IO (Ptr (Ptr CString)) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr (Ptr CString)) Ptr (Ptr CString) -> Ptr CString -> IO () forall a. Storable a => Ptr a -> a -> IO () poke Ptr (Ptr CString) argv'' Ptr CString argv' Ptr Int32 -> Ptr (Ptr CString) -> IO () gdk_init Ptr Int32 argc' Ptr (Ptr CString) argv'' Int32 argc'' <- Ptr Int32 -> IO Int32 forall a. Storable a => Ptr a -> IO a peek Ptr Int32 argc' Ptr CString argv''' <- Ptr (Ptr CString) -> IO (Ptr CString) forall a. Storable a => Ptr a -> IO a peek Ptr (Ptr CString) argv'' [Text] argv'''' <- (Int32 -> Ptr CString -> IO [Text] forall a. (HasCallStack, Integral a) => a -> Ptr CString -> IO [Text] unpackUTF8CArrayWithLength Int32 argc'') Ptr CString argv''' (Int32 -> (CString -> IO ()) -> Ptr CString -> IO () forall a b c. (Storable a, Integral b) => b -> (a -> IO c) -> Ptr a -> IO () mapCArrayWithLength Int32 argc'') CString -> IO () forall a. Ptr a -> IO () freeMem Ptr CString argv''' Ptr CString -> IO () forall a. Ptr a -> IO () freeMem Ptr CString argv''' Ptr Int32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Int32 argc' Ptr (Ptr CString) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr CString) argv'' [Text] -> IO [Text] forall (m :: * -> *) a. Monad m => a -> m a return [Text] argv'''' -- function get_show_events -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_get_show_events" gdk_get_show_events :: IO CInt -- | Gets whether event debugging output is enabled. getShowEvents :: (B.CallStack.HasCallStack, MonadIO m) => m Bool -- ^ __Returns:__ 'P.True' if event debugging output is enabled. getShowEvents :: m Bool getShowEvents = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do CInt result <- IO CInt gdk_get_show_events let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function get_program_class -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gdk_get_program_class" gdk_get_program_class :: IO CString -- | Gets the program class. Unless the program class has explicitly -- been set with 'GI.Gdk.Functions.setProgramClass' or with the @--class@ -- commandline option, the default value is the program name (determined -- with 'GI.GLib.Functions.getPrgname') with the first character converted to uppercase. getProgramClass :: (B.CallStack.HasCallStack, MonadIO m) => m T.Text -- ^ __Returns:__ the program class. getProgramClass :: m Text getProgramClass = IO Text -> m Text forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Text -> m Text) -> IO Text -> m Text forall a b. (a -> b) -> a -> b $ do CString result <- IO CString gdk_get_program_class Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "getProgramClass" CString result Text result' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function get_display_arg_name -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gdk_get_display_arg_name" gdk_get_display_arg_name :: IO CString -- | Gets the display name specified in the command line arguments passed -- to 'GI.Gdk.Functions.init' or 'GI.Gdk.Functions.parseArgs', if any. -- -- /Since: 2.2/ getDisplayArgName :: (B.CallStack.HasCallStack, MonadIO m) => m (Maybe T.Text) -- ^ __Returns:__ the display name, if specified explicitly, -- otherwise 'P.Nothing' this string is owned by GTK+ and must not be -- modified or freed. getDisplayArgName :: m (Maybe Text) getDisplayArgName = IO (Maybe Text) -> m (Maybe Text) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Text) -> m (Maybe Text)) -> IO (Maybe Text) -> m (Maybe Text) forall a b. (a -> b) -> a -> b $ do CString result <- IO CString gdk_get_display_arg_name Maybe Text maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString result ((CString -> IO Text) -> IO (Maybe Text)) -> (CString -> IO Text) -> IO (Maybe Text) forall a b. (a -> b) -> a -> b $ \CString result' -> do Text result'' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result' Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result'' Maybe Text -> IO (Maybe Text) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Text maybeResult -- function get_display -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gdk_get_display" gdk_get_display :: IO CString {-# DEPRECATED getDisplay ["(Since version 3.8)","Call gdk_display_get_name (gdk_display_get_default ()))"," instead."] #-} -- | Gets the name of the display, which usually comes from the -- @DISPLAY@ environment variable or the -- @--display@ command line option. getDisplay :: (B.CallStack.HasCallStack, MonadIO m) => m T.Text -- ^ __Returns:__ the name of the display. getDisplay :: m Text getDisplay = IO Text -> m Text forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Text -> m Text) -> IO Text -> m Text forall a b. (a -> b) -> a -> b $ do CString result <- IO CString gdk_get_display Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "getDisplay" CString result Text result' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result CString -> IO () forall a. Ptr a -> IO () freeMem CString result Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function get_default_root_window -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Window" }) -- throws : False -- Skip return : False foreign import ccall "gdk_get_default_root_window" gdk_get_default_root_window :: IO (Ptr Gdk.Window.Window) -- | Obtains the root window (parent all other windows are inside) -- for the default display and screen. getDefaultRootWindow :: (B.CallStack.HasCallStack, MonadIO m) => m Gdk.Window.Window -- ^ __Returns:__ the default root window getDefaultRootWindow :: m Window getDefaultRootWindow = IO Window -> m Window forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Window -> m Window) -> IO Window -> m Window forall a b. (a -> b) -> a -> b $ do Ptr Window result <- IO (Ptr Window) gdk_get_default_root_window Text -> Ptr Window -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "getDefaultRootWindow" Ptr Window result Window result' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Window -> Window Gdk.Window.Window) Ptr Window result Window -> IO Window forall (m :: * -> *) a. Monad m => a -> m a return Window result' -- function flush -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_flush" gdk_flush :: IO () -- | Flushes the output buffers of all display connections and waits -- until all requests have been processed. -- This is rarely needed by applications. flush :: (B.CallStack.HasCallStack, MonadIO m) => m () flush :: m () flush = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gdk_flush () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function events_pending -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_events_pending" gdk_events_pending :: IO CInt -- | Checks if any events are ready to be processed for any display. eventsPending :: (B.CallStack.HasCallStack, MonadIO m) => m Bool -- ^ __Returns:__ 'P.True' if any events are pending. eventsPending :: m Bool eventsPending = SourceFunc -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (SourceFunc -> m Bool) -> SourceFunc -> m Bool forall a b. (a -> b) -> a -> b $ do CInt result <- IO CInt gdk_events_pending let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result Bool -> SourceFunc forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function events_get_distance -- Args: [ Arg -- { argCName = "event1" -- , argType = TInterface Name { namespace = "Gdk" , name = "Event" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "first #GdkEvent" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "event2" -- , argType = TInterface Name { namespace = "Gdk" , name = "Event" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "second #GdkEvent" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "distance" -- , argType = TBasicType TDouble -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "return location for the distance" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_events_get_distance" gdk_events_get_distance :: Ptr Gdk.Event.Event -> -- event1 : TInterface (Name {namespace = "Gdk", name = "Event"}) Ptr Gdk.Event.Event -> -- event2 : TInterface (Name {namespace = "Gdk", name = "Event"}) Ptr CDouble -> -- distance : TBasicType TDouble IO CInt -- | If both events have X\/Y information, the distance between both coordinates -- (as in a straight line going from /@event1@/ to /@event2@/) will be returned. -- -- /Since: 3.0/ eventsGetDistance :: (B.CallStack.HasCallStack, MonadIO m) => Gdk.Event.Event -- ^ /@event1@/: first t'GI.Gdk.Unions.Event.Event' -> Gdk.Event.Event -- ^ /@event2@/: second t'GI.Gdk.Unions.Event.Event' -> m ((Bool, Double)) -- ^ __Returns:__ 'P.True' if the distance could be calculated. eventsGetDistance :: Event -> Event -> m (Bool, Double) eventsGetDistance Event event1 Event event2 = IO (Bool, Double) -> m (Bool, Double) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Bool, Double) -> m (Bool, Double)) -> IO (Bool, Double) -> m (Bool, Double) forall a b. (a -> b) -> a -> b $ do Ptr Event event1' <- Event -> IO (Ptr Event) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Event event1 Ptr Event event2' <- Event -> IO (Ptr Event) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Event event2 Ptr CDouble distance <- IO (Ptr CDouble) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr CDouble) CInt result <- Ptr Event -> Ptr Event -> Ptr CDouble -> IO CInt gdk_events_get_distance Ptr Event event1' Ptr Event event2' Ptr CDouble distance let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result CDouble distance' <- Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble distance let distance'' :: Double distance'' = CDouble -> Double forall a b. (Real a, Fractional b) => a -> b realToFrac CDouble distance' Event -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Event event1 Event -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Event event2 Ptr CDouble -> IO () forall a. Ptr a -> IO () freeMem Ptr CDouble distance (Bool, Double) -> IO (Bool, Double) forall (m :: * -> *) a. Monad m => a -> m a return (Bool result', Double distance'') -- function events_get_center -- Args: [ Arg -- { argCName = "event1" -- , argType = TInterface Name { namespace = "Gdk" , name = "Event" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "first #GdkEvent" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "event2" -- , argType = TInterface Name { namespace = "Gdk" , name = "Event" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "second #GdkEvent" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for the X coordinate of the center" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for the Y coordinate of the center" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_events_get_center" gdk_events_get_center :: Ptr Gdk.Event.Event -> -- event1 : TInterface (Name {namespace = "Gdk", name = "Event"}) Ptr Gdk.Event.Event -> -- event2 : TInterface (Name {namespace = "Gdk", name = "Event"}) Ptr CDouble -> -- x : TBasicType TDouble Ptr CDouble -> -- y : TBasicType TDouble IO CInt -- | If both events contain X\/Y information, the center of both coordinates -- will be returned in /@x@/ and /@y@/. -- -- /Since: 3.0/ eventsGetCenter :: (B.CallStack.HasCallStack, MonadIO m) => Gdk.Event.Event -- ^ /@event1@/: first t'GI.Gdk.Unions.Event.Event' -> Gdk.Event.Event -- ^ /@event2@/: second t'GI.Gdk.Unions.Event.Event' -> m ((Bool, Double, Double)) -- ^ __Returns:__ 'P.True' if the center could be calculated. eventsGetCenter :: Event -> Event -> m (Bool, Double, Double) eventsGetCenter Event event1 Event event2 = IO (Bool, Double, Double) -> m (Bool, Double, Double) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Bool, Double, Double) -> m (Bool, Double, Double)) -> IO (Bool, Double, Double) -> m (Bool, Double, Double) forall a b. (a -> b) -> a -> b $ do Ptr Event event1' <- Event -> IO (Ptr Event) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Event event1 Ptr Event event2' <- Event -> IO (Ptr Event) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Event event2 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) CInt result <- Ptr Event -> Ptr Event -> Ptr CDouble -> Ptr CDouble -> IO CInt gdk_events_get_center Ptr Event event1' Ptr Event event2' Ptr CDouble x Ptr CDouble y let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result 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' Event -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Event event1 Event -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Event event2 Ptr CDouble -> IO () forall a. Ptr a -> IO () freeMem Ptr CDouble x Ptr CDouble -> IO () forall a. Ptr a -> IO () freeMem Ptr CDouble y (Bool, Double, Double) -> IO (Bool, Double, Double) forall (m :: * -> *) a. Monad m => a -> m a return (Bool result', Double x'', Double y'') -- function events_get_angle -- Args: [ Arg -- { argCName = "event1" -- , argType = TInterface Name { namespace = "Gdk" , name = "Event" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "first #GdkEvent" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "event2" -- , argType = TInterface Name { namespace = "Gdk" , name = "Event" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "second #GdkEvent" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "angle" -- , argType = TBasicType TDouble -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for the relative angle between both events" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gdk_events_get_angle" gdk_events_get_angle :: Ptr Gdk.Event.Event -> -- event1 : TInterface (Name {namespace = "Gdk", name = "Event"}) Ptr Gdk.Event.Event -> -- event2 : TInterface (Name {namespace = "Gdk", name = "Event"}) Ptr CDouble -> -- angle : TBasicType TDouble IO CInt -- | If both events contain X\/Y information, this function will return 'P.True' -- and return in /@angle@/ the relative angle from /@event1@/ to /@event2@/. The rotation -- direction for positive angles is from the positive X axis towards the positive -- Y axis. -- -- /Since: 3.0/ eventsGetAngle :: (B.CallStack.HasCallStack, MonadIO m) => Gdk.Event.Event -- ^ /@event1@/: first t'GI.Gdk.Unions.Event.Event' -> Gdk.Event.Event -- ^ /@event2@/: second t'GI.Gdk.Unions.Event.Event' -> m ((Bool, Double)) -- ^ __Returns:__ 'P.True' if the angle could be calculated. eventsGetAngle :: Event -> Event -> m (Bool, Double) eventsGetAngle Event event1 Event event2 = IO (Bool, Double) -> m (Bool, Double) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Bool, Double) -> m (Bool, Double)) -> IO (Bool, Double) -> m (Bool, Double) forall a b. (a -> b) -> a -> b $ do Ptr Event event1' <- Event -> IO (Ptr Event) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Event event1 Ptr Event event2' <- Event -> IO (Ptr Event) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Event event2 Ptr CDouble angle <- IO (Ptr CDouble) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr CDouble) CInt result <- Ptr Event -> Ptr Event -> Ptr CDouble -> IO CInt gdk_events_get_angle Ptr Event event1' Ptr Event event2' Ptr CDouble angle let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result CDouble angle' <- Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble angle let angle'' :: Double angle'' = CDouble -> Double forall a b. (Real a, Fractional b) => a -> b realToFrac CDouble angle' Event -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Event event1 Event -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Event event2 Ptr CDouble -> IO () forall a. Ptr a -> IO () freeMem Ptr CDouble angle (Bool, Double) -> IO (Bool, Double) forall (m :: * -> *) a. Monad m => a -> m a return (Bool result', Double angle'') -- function error_trap_push -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_error_trap_push" gdk_error_trap_push :: IO () -- | This function allows X errors to be trapped instead of the normal -- behavior of exiting the application. It should only be used if it -- is not possible to avoid the X error in any other way. Errors are -- ignored on all t'GI.Gdk.Objects.Display.Display' currently known to the -- t'GI.Gdk.Objects.DisplayManager.DisplayManager'. If you don’t care which error happens and just -- want to ignore everything, pop with 'GI.Gdk.Functions.errorTrapPopIgnored'. -- If you need the error code, use 'GI.Gdk.Functions.errorTrapPop' which may have -- to block and wait for the error to arrive from the X server. -- -- This API exists on all platforms but only does anything on X. -- -- You can use @/gdk_x11_display_error_trap_push()/@ to ignore errors -- on only a single display. -- -- == Trapping an X error -- -- -- === /C code/ -- > -- >gdk_error_trap_push (); -- > -- > // ... Call the X function which may cause an error here ... -- > -- > -- >if (gdk_error_trap_pop ()) -- > { -- > // ... Handle the error here ... -- > } errorTrapPush :: (B.CallStack.HasCallStack, MonadIO m) => m () errorTrapPush :: m () errorTrapPush = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gdk_error_trap_push () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function error_trap_pop_ignored -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gdk_error_trap_pop_ignored" gdk_error_trap_pop_ignored :: IO () -- | Removes an error trap pushed with 'GI.Gdk.Functions.errorTrapPush', but -- without bothering to wait and see whether an error occurred. If an -- error arrives later asynchronously that was triggered while the -- trap was pushed, that error will be ignored. -- -- /Since: 3.0/ errorTrapPopIgnored :: (B.CallStack.HasCallStack, MonadIO m) => m () errorTrapPopIgnored :: m () errorTrapPopIgnored = IO () -> m () forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gdk_error_trap_pop_ignored () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function error_trap_pop -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "gdk_error_trap_pop" gdk_error_trap_pop :: IO Int32 -- | Removes an error trap pushed with 'GI.Gdk.Functions.errorTrapPush'. -- May block until an error has been definitively received -- or not received from the X server. 'GI.Gdk.Functions.errorTrapPopIgnored' -- is preferred if you don’t need to know whether an error -- occurred, because it never has to block. If you don\'t -- need the return value of 'GI.Gdk.Functions.errorTrapPop', use -- 'GI.Gdk.Functions.errorTrapPopIgnored'. -- -- Prior to GDK 3.0, this function would not automatically -- sync for you, so you had to 'GI.Gdk.Functions.flush' if your last -- call to Xlib was not a blocking round trip.