-- | 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.Gtk.Functions ( -- * Methods -- ** accelGroupsActivate #method:accelGroupsActivate# accelGroupsActivate , -- ** accelGroupsFromObject #method:accelGroupsFromObject# accelGroupsFromObject , -- ** acceleratorGetDefaultModMask #method:acceleratorGetDefaultModMask# acceleratorGetDefaultModMask , -- ** acceleratorGetLabel #method:acceleratorGetLabel# acceleratorGetLabel , -- ** acceleratorGetLabelWithKeycode #method:acceleratorGetLabelWithKeycode# acceleratorGetLabelWithKeycode , -- ** acceleratorName #method:acceleratorName# acceleratorName , -- ** acceleratorNameWithKeycode #method:acceleratorNameWithKeycode# acceleratorNameWithKeycode , -- ** acceleratorParse #method:acceleratorParse# acceleratorParse , -- ** acceleratorParseWithKeycode #method:acceleratorParseWithKeycode# acceleratorParseWithKeycode , -- ** acceleratorSetDefaultModMask #method:acceleratorSetDefaultModMask# acceleratorSetDefaultModMask , -- ** acceleratorValid #method:acceleratorValid# acceleratorValid , -- ** alternativeDialogButtonOrder #method:alternativeDialogButtonOrder# alternativeDialogButtonOrder , -- ** bindingsActivate #method:bindingsActivate# bindingsActivate , -- ** bindingsActivateEvent #method:bindingsActivateEvent# bindingsActivateEvent , -- ** cairoShouldDrawWindow #method:cairoShouldDrawWindow# cairoShouldDrawWindow , -- ** cairoTransformToWindow #method:cairoTransformToWindow# cairoTransformToWindow , -- ** checkVersion #method:checkVersion# checkVersion , -- ** deviceGrabAdd #method:deviceGrabAdd# deviceGrabAdd , -- ** deviceGrabRemove #method:deviceGrabRemove# deviceGrabRemove , -- ** disableSetlocale #method:disableSetlocale# disableSetlocale , -- ** distributeNaturalAllocation #method:distributeNaturalAllocation# distributeNaturalAllocation , -- ** dragCancel #method:dragCancel# dragCancel , -- ** dragFinish #method:dragFinish# dragFinish , -- ** dragGetSourceWidget #method:dragGetSourceWidget# dragGetSourceWidget , -- ** dragSetIconDefault #method:dragSetIconDefault# dragSetIconDefault , -- ** dragSetIconGicon #method:dragSetIconGicon# dragSetIconGicon , -- ** dragSetIconName #method:dragSetIconName# dragSetIconName , -- ** dragSetIconPixbuf #method:dragSetIconPixbuf# dragSetIconPixbuf , -- ** dragSetIconStock #method:dragSetIconStock# dragSetIconStock , -- ** dragSetIconSurface #method:dragSetIconSurface# dragSetIconSurface , -- ** dragSetIconWidget #method:dragSetIconWidget# dragSetIconWidget , -- ** drawInsertionCursor #method:drawInsertionCursor# drawInsertionCursor , -- ** eventsPending #method:eventsPending# eventsPending , -- ** false #method:false# false , -- ** getBinaryAge #method:getBinaryAge# getBinaryAge , -- ** getCurrentEvent #method:getCurrentEvent# getCurrentEvent , -- ** getCurrentEventDevice #method:getCurrentEventDevice# getCurrentEventDevice , -- ** getCurrentEventState #method:getCurrentEventState# getCurrentEventState , -- ** getCurrentEventTime #method:getCurrentEventTime# getCurrentEventTime , -- ** getDebugFlags #method:getDebugFlags# getDebugFlags , -- ** getDefaultLanguage #method:getDefaultLanguage# getDefaultLanguage , -- ** getEventWidget #method:getEventWidget# getEventWidget , -- ** getInterfaceAge #method:getInterfaceAge# getInterfaceAge , -- ** getLocaleDirection #method:getLocaleDirection# getLocaleDirection , -- ** getMajorVersion #method:getMajorVersion# getMajorVersion , -- ** getMicroVersion #method:getMicroVersion# getMicroVersion , -- ** getMinorVersion #method:getMinorVersion# getMinorVersion , -- ** getOptionGroup #method:getOptionGroup# getOptionGroup , -- ** grabGetCurrent #method:grabGetCurrent# grabGetCurrent , -- ** init #method:init# init , -- ** initCheck #method:initCheck# initCheck , -- ** initWithArgs #method:initWithArgs# initWithArgs , -- ** keySnooperRemove #method:keySnooperRemove# keySnooperRemove , -- ** main #method:main# main , -- ** mainDoEvent #method:mainDoEvent# mainDoEvent , -- ** mainIteration #method:mainIteration# mainIteration , -- ** mainIterationDo #method:mainIterationDo# mainIterationDo , -- ** mainLevel #method:mainLevel# mainLevel , -- ** mainQuit #method:mainQuit# mainQuit , -- ** paintArrow #method:paintArrow# paintArrow , -- ** paintBox #method:paintBox# paintBox , -- ** paintBoxGap #method:paintBoxGap# paintBoxGap , -- ** paintCheck #method:paintCheck# paintCheck , -- ** paintDiamond #method:paintDiamond# paintDiamond , -- ** paintExpander #method:paintExpander# paintExpander , -- ** paintExtension #method:paintExtension# paintExtension , -- ** paintFlatBox #method:paintFlatBox# paintFlatBox , -- ** paintFocus #method:paintFocus# paintFocus , -- ** paintHandle #method:paintHandle# paintHandle , -- ** paintHline #method:paintHline# paintHline , -- ** paintLayout #method:paintLayout# paintLayout , -- ** paintOption #method:paintOption# paintOption , -- ** paintResizeGrip #method:paintResizeGrip# paintResizeGrip , -- ** paintShadow #method:paintShadow# paintShadow , -- ** paintShadowGap #method:paintShadowGap# paintShadowGap , -- ** paintSlider #method:paintSlider# paintSlider , -- ** paintSpinner #method:paintSpinner# paintSpinner , -- ** paintTab #method:paintTab# paintTab , -- ** paintVline #method:paintVline# paintVline , -- ** parseArgs #method:parseArgs# parseArgs , -- ** printRunPageSetupDialog #method:printRunPageSetupDialog# printRunPageSetupDialog , -- ** printRunPageSetupDialogAsync #method:printRunPageSetupDialogAsync# printRunPageSetupDialogAsync , -- ** propagateEvent #method:propagateEvent# propagateEvent , -- ** rcAddDefaultFile #method:rcAddDefaultFile# rcAddDefaultFile , -- ** rcFindModuleInPath #method:rcFindModuleInPath# rcFindModuleInPath , -- ** rcFindPixmapInPath #method:rcFindPixmapInPath# rcFindPixmapInPath , -- ** rcGetDefaultFiles #method:rcGetDefaultFiles# rcGetDefaultFiles , -- ** rcGetImModuleFile #method:rcGetImModuleFile# rcGetImModuleFile , -- ** rcGetImModulePath #method:rcGetImModulePath# rcGetImModulePath , -- ** rcGetModuleDir #method:rcGetModuleDir# rcGetModuleDir , -- ** rcGetStyle #method:rcGetStyle# rcGetStyle , -- ** rcGetStyleByPaths #method:rcGetStyleByPaths# rcGetStyleByPaths , -- ** rcGetThemeDir #method:rcGetThemeDir# rcGetThemeDir , -- ** rcParse #method:rcParse# rcParse , -- ** rcParseColor #method:rcParseColor# rcParseColor , -- ** rcParseColorFull #method:rcParseColorFull# rcParseColorFull , -- ** rcParsePriority #method:rcParsePriority# rcParsePriority , -- ** rcParseState #method:rcParseState# rcParseState , -- ** rcParseString #method:rcParseString# rcParseString , -- ** rcReparseAll #method:rcReparseAll# rcReparseAll , -- ** rcReparseAllForSettings #method:rcReparseAllForSettings# rcReparseAllForSettings , -- ** rcResetStyles #method:rcResetStyles# rcResetStyles , -- ** rcSetDefaultFiles #method:rcSetDefaultFiles# rcSetDefaultFiles , -- ** renderActivity #method:renderActivity# renderActivity , -- ** renderArrow #method:renderArrow# renderArrow , -- ** renderBackground #method:renderBackground# renderBackground , -- ** renderBackgroundGetClip #method:renderBackgroundGetClip# renderBackgroundGetClip , -- ** renderCheck #method:renderCheck# renderCheck , -- ** renderExpander #method:renderExpander# renderExpander , -- ** renderExtension #method:renderExtension# renderExtension , -- ** renderFocus #method:renderFocus# renderFocus , -- ** renderFrame #method:renderFrame# renderFrame , -- ** renderFrameGap #method:renderFrameGap# renderFrameGap , -- ** renderHandle #method:renderHandle# renderHandle , -- ** renderIcon #method:renderIcon# renderIcon , -- ** renderIconPixbuf #method:renderIconPixbuf# renderIconPixbuf , -- ** renderIconSurface #method:renderIconSurface# renderIconSurface , -- ** renderInsertionCursor #method:renderInsertionCursor# renderInsertionCursor , -- ** renderLayout #method:renderLayout# renderLayout , -- ** renderLine #method:renderLine# renderLine , -- ** renderOption #method:renderOption# renderOption , -- ** renderSlider #method:renderSlider# renderSlider , -- ** rgbToHsv #method:rgbToHsv# rgbToHsv , -- ** selectionAddTarget #method:selectionAddTarget# selectionAddTarget , -- ** selectionAddTargets #method:selectionAddTargets# selectionAddTargets , -- ** selectionClearTargets #method:selectionClearTargets# selectionClearTargets , -- ** selectionConvert #method:selectionConvert# selectionConvert , -- ** selectionOwnerSet #method:selectionOwnerSet# selectionOwnerSet , -- ** selectionOwnerSetForDisplay #method:selectionOwnerSetForDisplay# selectionOwnerSetForDisplay , -- ** selectionRemoveAll #method:selectionRemoveAll# selectionRemoveAll , -- ** setDebugFlags #method:setDebugFlags# setDebugFlags , -- ** showUri #method:showUri# showUri , -- ** showUriOnWindow #method:showUriOnWindow# showUriOnWindow , -- ** stockAdd #method:stockAdd# stockAdd , -- ** stockAddStatic #method:stockAddStatic# stockAddStatic , -- ** stockListIds #method:stockListIds# stockListIds , -- ** stockLookup #method:stockLookup# stockLookup , -- ** stockSetTranslateFunc #method:stockSetTranslateFunc# stockSetTranslateFunc , -- ** targetTableFree #method:targetTableFree# targetTableFree , -- ** targetTableNewFromList #method:targetTableNewFromList# targetTableNewFromList , -- ** targetsIncludeImage #method:targetsIncludeImage# targetsIncludeImage , -- ** targetsIncludeRichText #method:targetsIncludeRichText# targetsIncludeRichText , -- ** targetsIncludeText #method:targetsIncludeText# targetsIncludeText , -- ** targetsIncludeUri #method:targetsIncludeUri# targetsIncludeUri , -- ** testCreateSimpleWindow #method:testCreateSimpleWindow# testCreateSimpleWindow , -- ** testFindLabel #method:testFindLabel# testFindLabel , -- ** testFindSibling #method:testFindSibling# testFindSibling , -- ** testFindWidget #method:testFindWidget# testFindWidget , -- ** testListAllTypes #method:testListAllTypes# testListAllTypes , -- ** testRegisterAllTypes #method:testRegisterAllTypes# testRegisterAllTypes , -- ** testSliderGetValue #method:testSliderGetValue# testSliderGetValue , -- ** testSliderSetPerc #method:testSliderSetPerc# testSliderSetPerc , -- ** testSpinButtonClick #method:testSpinButtonClick# testSpinButtonClick , -- ** testTextGet #method:testTextGet# testTextGet , -- ** testTextSet #method:testTextSet# testTextSet , -- ** testWidgetClick #method:testWidgetClick# testWidgetClick , -- ** testWidgetSendKey #method:testWidgetSendKey# testWidgetSendKey , -- ** testWidgetWaitForDraw #method:testWidgetWaitForDraw# testWidgetWaitForDraw , -- ** treeGetRowDragData #method:treeGetRowDragData# treeGetRowDragData , -- ** treeSetRowDragData #method:treeSetRowDragData# treeSetRowDragData , -- ** true #method:true# true , ) 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.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 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.Surface as Cairo.Surface import qualified GI.GLib.Callbacks as GLib.Callbacks import qualified GI.GLib.Structs.OptionEntry as GLib.OptionEntry import qualified GI.GLib.Structs.OptionGroup as GLib.OptionGroup import qualified GI.GLib.Structs.Scanner as GLib.Scanner import qualified GI.GObject.Objects.Object as GObject.Object import qualified GI.Gdk.Enums as Gdk.Enums import qualified GI.Gdk.Flags as Gdk.Flags import qualified GI.Gdk.Objects.Device as Gdk.Device import qualified GI.Gdk.Objects.Display as Gdk.Display import qualified GI.Gdk.Objects.DragContext as Gdk.DragContext import qualified GI.Gdk.Objects.Screen as Gdk.Screen import qualified GI.Gdk.Objects.Window as Gdk.Window import qualified GI.Gdk.Structs.Atom as Gdk.Atom import qualified GI.Gdk.Structs.Color as Gdk.Color import qualified GI.Gdk.Structs.EventKey as Gdk.EventKey import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle import qualified GI.Gdk.Unions.Event as Gdk.Event import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf import qualified GI.Gio.Interfaces.Icon as Gio.Icon import qualified GI.Gtk.Callbacks as Gtk.Callbacks import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeModel as Gtk.TreeModel import {-# SOURCE #-} qualified GI.Gtk.Objects.AccelGroup as Gtk.AccelGroup import {-# SOURCE #-} qualified GI.Gtk.Objects.PageSetup as Gtk.PageSetup import {-# SOURCE #-} qualified GI.Gtk.Objects.PrintSettings as Gtk.PrintSettings import {-# SOURCE #-} qualified GI.Gtk.Objects.RcStyle as Gtk.RcStyle import {-# SOURCE #-} qualified GI.Gtk.Objects.Settings as Gtk.Settings import {-# SOURCE #-} qualified GI.Gtk.Objects.SpinButton as Gtk.SpinButton import {-# SOURCE #-} qualified GI.Gtk.Objects.Style as Gtk.Style import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleContext as Gtk.StyleContext import {-# SOURCE #-} qualified GI.Gtk.Objects.TextBuffer as Gtk.TextBuffer import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget import {-# SOURCE #-} qualified GI.Gtk.Objects.Window as Gtk.Window import {-# SOURCE #-} qualified GI.Gtk.Structs.IconSource as Gtk.IconSource import {-# SOURCE #-} qualified GI.Gtk.Structs.RequestedSize as Gtk.RequestedSize import {-# SOURCE #-} qualified GI.Gtk.Structs.SelectionData as Gtk.SelectionData import {-# SOURCE #-} qualified GI.Gtk.Structs.StockItem as Gtk.StockItem import {-# SOURCE #-} qualified GI.Gtk.Structs.TargetEntry as Gtk.TargetEntry import {-# SOURCE #-} qualified GI.Gtk.Structs.TargetList as Gtk.TargetList import {-# SOURCE #-} qualified GI.Gtk.Structs.TreePath as Gtk.TreePath import qualified GI.Pango.Enums as Pango.Enums import qualified GI.Pango.Objects.Layout as Pango.Layout import qualified GI.Pango.Structs.Language as Pango.Language -- function gtk_true -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_true" gtk_true :: IO CInt -- | All this function does it to return 'P.True'. -- -- This can be useful for example if you want to inhibit the deletion -- of a window. Of course you should not do this as the user expects -- a reaction from clicking the close icon of the window... -- -- == A persistent window -- -- -- === /C code/ -- > -- >#include <gtk/gtk.h> -- > -- >int -- >main (int argc, char **argv) -- >{ -- > GtkWidget *win, *but; -- > const char *text = "Close yourself. I mean it!"; -- > -- > gtk_init (&argc, &argv); -- > -- > win = gtk_window_new (GTK_WINDOW_TOPLEVEL); -- > g_signal_connect (win, -- > "delete-event", -- > G_CALLBACK (gtk_true), -- > NULL); -- > g_signal_connect (win, "destroy", -- > G_CALLBACK (gtk_main_quit), -- > NULL); -- > -- > but = gtk_button_new_with_label (text); -- > g_signal_connect_swapped (but, "clicked", -- > G_CALLBACK (gtk_object_destroy), -- > win); -- > gtk_container_add (GTK_CONTAINER (win), but); -- > -- > gtk_widget_show_all (win); -- > -- > gtk_main (); -- > -- > return 0; -- >} true :: (B.CallStack.HasCallStack, MonadIO m) => m Bool -- ^ __Returns:__ 'P.True' true :: m Bool true = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do CInt result <- IO CInt gtk_true let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_tree_set_row_drag_data -- Args: [ Arg -- { argCName = "selection_data" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "SelectionData" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "some #GtkSelectionData" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "tree_model" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "TreeModel" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkTreeModel" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "path" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "TreePath" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a row in @tree_model" -- , 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 "gtk_tree_set_row_drag_data" gtk_tree_set_row_drag_data :: Ptr Gtk.SelectionData.SelectionData -> -- selection_data : TInterface (Name {namespace = "Gtk", name = "SelectionData"}) Ptr Gtk.TreeModel.TreeModel -> -- tree_model : TInterface (Name {namespace = "Gtk", name = "TreeModel"}) Ptr Gtk.TreePath.TreePath -> -- path : TInterface (Name {namespace = "Gtk", name = "TreePath"}) IO CInt -- | Sets selection data of target type @/GTK_TREE_MODEL_ROW/@. Normally used -- in a drag_data_get handler. treeSetRowDragData :: (B.CallStack.HasCallStack, MonadIO m, Gtk.TreeModel.IsTreeModel a) => Gtk.SelectionData.SelectionData -- ^ /@selectionData@/: some t'GI.Gtk.Structs.SelectionData.SelectionData' -> a -- ^ /@treeModel@/: a t'GI.Gtk.Interfaces.TreeModel.TreeModel' -> Gtk.TreePath.TreePath -- ^ /@path@/: a row in /@treeModel@/ -> m Bool -- ^ __Returns:__ 'P.True' if the t'GI.Gtk.Structs.SelectionData.SelectionData' had the proper target type to allow us to set a tree row treeSetRowDragData :: SelectionData -> a -> TreePath -> m Bool treeSetRowDragData selectionData :: SelectionData selectionData treeModel :: a treeModel path :: TreePath path = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr SelectionData selectionData' <- SelectionData -> IO (Ptr SelectionData) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SelectionData selectionData Ptr TreeModel treeModel' <- a -> IO (Ptr TreeModel) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a treeModel Ptr TreePath path' <- TreePath -> IO (Ptr TreePath) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TreePath path CInt result <- Ptr SelectionData -> Ptr TreeModel -> Ptr TreePath -> IO CInt gtk_tree_set_row_drag_data Ptr SelectionData selectionData' Ptr TreeModel treeModel' Ptr TreePath path' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result SelectionData -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr SelectionData selectionData a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a treeModel TreePath -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TreePath path Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_tree_get_row_drag_data -- Args: [ Arg -- { argCName = "selection_data" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "SelectionData" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkSelectionData" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "tree_model" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "TreeModel" } -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkTreeModel" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "path" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "TreePath" } -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "row in @tree_model" , 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 "gtk_tree_get_row_drag_data" gtk_tree_get_row_drag_data :: Ptr Gtk.SelectionData.SelectionData -> -- selection_data : TInterface (Name {namespace = "Gtk", name = "SelectionData"}) Ptr (Ptr Gtk.TreeModel.TreeModel) -> -- tree_model : TInterface (Name {namespace = "Gtk", name = "TreeModel"}) Ptr (Ptr Gtk.TreePath.TreePath) -> -- path : TInterface (Name {namespace = "Gtk", name = "TreePath"}) IO CInt -- | Obtains a /@treeModel@/ and /@path@/ from selection data of target type -- @/GTK_TREE_MODEL_ROW/@. Normally called from a drag_data_received handler. -- This function can only be used if /@selectionData@/ originates from the same -- process that’s calling this function, because a pointer to the tree model -- is being passed around. If you aren’t in the same process, then you\'ll -- get memory corruption. In the t'GI.Gtk.Interfaces.TreeDragDest.TreeDragDest' drag_data_received handler, -- you can assume that selection data of type @/GTK_TREE_MODEL_ROW/@ is -- in from the current process. The returned path must be freed with -- 'GI.Gtk.Structs.TreePath.treePathFree'. treeGetRowDragData :: (B.CallStack.HasCallStack, MonadIO m) => Gtk.SelectionData.SelectionData -- ^ /@selectionData@/: a t'GI.Gtk.Structs.SelectionData.SelectionData' -> m ((Bool, Maybe Gtk.TreeModel.TreeModel, Maybe Gtk.TreePath.TreePath)) -- ^ __Returns:__ 'P.True' if /@selectionData@/ had target type @/GTK_TREE_MODEL_ROW/@ and -- is otherwise valid treeGetRowDragData :: SelectionData -> m (Bool, Maybe TreeModel, Maybe TreePath) treeGetRowDragData selectionData :: SelectionData selectionData = IO (Bool, Maybe TreeModel, Maybe TreePath) -> m (Bool, Maybe TreeModel, Maybe TreePath) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Bool, Maybe TreeModel, Maybe TreePath) -> m (Bool, Maybe TreeModel, Maybe TreePath)) -> IO (Bool, Maybe TreeModel, Maybe TreePath) -> m (Bool, Maybe TreeModel, Maybe TreePath) forall a b. (a -> b) -> a -> b $ do Ptr SelectionData selectionData' <- SelectionData -> IO (Ptr SelectionData) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SelectionData selectionData Ptr (Ptr TreeModel) treeModel <- IO (Ptr (Ptr TreeModel)) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr (Ptr Gtk.TreeModel.TreeModel)) Ptr (Ptr TreePath) path <- IO (Ptr (Ptr TreePath)) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr (Ptr Gtk.TreePath.TreePath)) CInt result <- Ptr SelectionData -> Ptr (Ptr TreeModel) -> Ptr (Ptr TreePath) -> IO CInt gtk_tree_get_row_drag_data Ptr SelectionData selectionData' Ptr (Ptr TreeModel) treeModel Ptr (Ptr TreePath) path let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result Ptr TreeModel treeModel' <- Ptr (Ptr TreeModel) -> IO (Ptr TreeModel) forall a. Storable a => Ptr a -> IO a peek Ptr (Ptr TreeModel) treeModel Maybe TreeModel maybeTreeModel' <- Ptr TreeModel -> (Ptr TreeModel -> IO TreeModel) -> IO (Maybe TreeModel) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr TreeModel treeModel' ((Ptr TreeModel -> IO TreeModel) -> IO (Maybe TreeModel)) -> (Ptr TreeModel -> IO TreeModel) -> IO (Maybe TreeModel) forall a b. (a -> b) -> a -> b $ \treeModel'' :: Ptr TreeModel treeModel'' -> do TreeModel treeModel''' <- ((ManagedPtr TreeModel -> TreeModel) -> Ptr TreeModel -> IO TreeModel forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr TreeModel -> TreeModel Gtk.TreeModel.TreeModel) Ptr TreeModel treeModel'' TreeModel -> IO TreeModel forall (m :: * -> *) a. Monad m => a -> m a return TreeModel treeModel''' Ptr TreePath path' <- Ptr (Ptr TreePath) -> IO (Ptr TreePath) forall a. Storable a => Ptr a -> IO a peek Ptr (Ptr TreePath) path Maybe TreePath maybePath' <- Ptr TreePath -> (Ptr TreePath -> IO TreePath) -> IO (Maybe TreePath) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr TreePath path' ((Ptr TreePath -> IO TreePath) -> IO (Maybe TreePath)) -> (Ptr TreePath -> IO TreePath) -> IO (Maybe TreePath) forall a b. (a -> b) -> a -> b $ \path'' :: Ptr TreePath path'' -> do TreePath path''' <- ((ManagedPtr TreePath -> TreePath) -> Ptr TreePath -> IO TreePath forall a. (HasCallStack, BoxedObject a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr TreePath -> TreePath Gtk.TreePath.TreePath) Ptr TreePath path'' TreePath -> IO TreePath forall (m :: * -> *) a. Monad m => a -> m a return TreePath path''' SelectionData -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr SelectionData selectionData Ptr (Ptr TreeModel) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr TreeModel) treeModel Ptr (Ptr TreePath) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr TreePath) path (Bool, Maybe TreeModel, Maybe TreePath) -> IO (Bool, Maybe TreeModel, Maybe TreePath) forall (m :: * -> *) a. Monad m => a -> m a return (Bool result', Maybe TreeModel maybeTreeModel', Maybe TreePath maybePath') -- function gtk_test_widget_wait_for_draw -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the widget to wait for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_test_widget_wait_for_draw" gtk_test_widget_wait_for_draw :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) IO () -- | Enters the main loop and waits for /@widget@/ to be “drawn”. In this -- context that means it waits for the frame clock of /@widget@/ to have -- run a full styling, layout and drawing cycle. -- -- This function is intended to be used for syncing with actions that -- depend on /@widget@/ relayouting or on interaction with the display -- server. -- -- /Since: 3.10/ testWidgetWaitForDraw :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: the widget to wait for -> m () testWidgetWaitForDraw :: a -> m () testWidgetWaitForDraw widget :: a widget = 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 Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget Ptr Widget -> IO () gtk_test_widget_wait_for_draw Ptr Widget widget' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_test_widget_send_key -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Widget to generate a key press and release on." -- , 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 -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_test_widget_send_key" gtk_test_widget_send_key :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) Word32 -> -- keyval : TBasicType TUInt CUInt -> -- modifiers : TInterface (Name {namespace = "Gdk", name = "ModifierType"}) IO CInt -- | This function will generate keyboard press and release events in -- the middle of the first GdkWindow found that belongs to /@widget@/. -- For windowless widgets like t'GI.Gtk.Objects.Button.Button' (which returns 'P.False' from -- 'GI.Gtk.Objects.Widget.widgetGetHasWindow'), this will often be an -- input-only event window. For other widgets, this is usually widget->window. -- Certain caveats should be considered when using this function, in -- particular because the mouse pointer is warped to the key press -- location, see 'GI.Gdk.Functions.testSimulateKey' for details. -- -- /Since: 2.14/ testWidgetSendKey :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: Widget to generate a key press and release on. -> Word32 -- ^ /@keyval@/: A Gdk keyboard value. -> [Gdk.Flags.ModifierType] -- ^ /@modifiers@/: Keyboard modifiers the event is setup with. -> m Bool -- ^ __Returns:__ whether all actions neccessary for the key event simulation were carried out successfully. testWidgetSendKey :: a -> Word32 -> [ModifierType] -> m Bool testWidgetSendKey widget :: a widget keyval :: Word32 keyval modifiers :: [ModifierType] modifiers = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget let modifiers' :: CUInt modifiers' = [ModifierType] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ModifierType] modifiers CInt result <- Ptr Widget -> Word32 -> CUInt -> IO CInt gtk_test_widget_send_key Ptr Widget widget' Word32 keyval CUInt modifiers' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_test_widget_click -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Widget to generate a button click on." -- , 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 -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_test_widget_click" gtk_test_widget_click :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) Word32 -> -- button : TBasicType TUInt CUInt -> -- modifiers : TInterface (Name {namespace = "Gdk", name = "ModifierType"}) IO CInt {-# DEPRECATED testWidgetClick ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-} -- | This function will generate a /@button@/ click (button press and button -- release event) in the middle of the first GdkWindow found that belongs -- to /@widget@/. -- For windowless widgets like t'GI.Gtk.Objects.Button.Button' (which returns 'P.False' from -- 'GI.Gtk.Objects.Widget.widgetGetHasWindow'), this will often be an -- input-only event window. For other widgets, this is usually widget->window. -- Certain caveats should be considered when using this function, in -- particular because the mouse pointer is warped to the button click -- location, see 'GI.Gdk.Functions.testSimulateButton' for details. -- -- /Since: 2.14/ testWidgetClick :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: Widget to generate a button click on. -> 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. -> m Bool -- ^ __Returns:__ whether all actions neccessary for the button click simulation were carried out successfully. testWidgetClick :: a -> Word32 -> [ModifierType] -> m Bool testWidgetClick widget :: a widget button :: Word32 button modifiers :: [ModifierType] modifiers = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget let modifiers' :: CUInt modifiers' = [ModifierType] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ModifierType] modifiers CInt result <- Ptr Widget -> Word32 -> CUInt -> IO CInt gtk_test_widget_click Ptr Widget widget' Word32 button CUInt modifiers' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_test_text_set -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "valid widget pointer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a 0-terminated C string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_test_text_set" gtk_test_text_set :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) CString -> -- string : TBasicType TUTF8 IO () {-# DEPRECATED testTextSet ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-} -- | Set the text string of /@widget@/ to /@string@/ if it is a GtkLabel, -- GtkEditable (entry and text widgets) or GtkTextView. -- -- /Since: 2.14/ testTextSet :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: valid widget pointer. -> T.Text -- ^ /@string@/: a 0-terminated C string -> m () testTextSet :: a -> Text -> m () testTextSet widget :: a widget string :: Text string = 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 Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget CString string' <- Text -> IO CString textToCString Text string Ptr Widget -> CString -> IO () gtk_test_text_set Ptr Widget widget' CString string' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget CString -> IO () forall a. Ptr a -> IO () freeMem CString string' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_test_text_get -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "valid widget pointer." -- , 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 "gtk_test_text_get" gtk_test_text_get :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) IO CString {-# DEPRECATED testTextGet ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-} -- | Retrive the text string of /@widget@/ if it is a GtkLabel, -- GtkEditable (entry and text widgets) or GtkTextView. -- -- /Since: 2.14/ testTextGet :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: valid widget pointer. -> m T.Text -- ^ __Returns:__ new 0-terminated C string, needs to be released with 'GI.GLib.Functions.free'. testTextGet :: a -> m Text testTextGet widget :: a widget = 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 Ptr Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget CString result <- Ptr Widget -> IO CString gtk_test_text_get Ptr Widget widget' Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "testTextGet" CString result Text result' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result CString -> IO () forall a. Ptr a -> IO () freeMem CString result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget Text -> IO Text forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function gtk_test_spin_button_click -- Args: [ Arg -- { argCName = "spinner" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "SpinButton" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "valid GtkSpinButton widget." -- , 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 = "upwards" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "%TRUE for upwards arrow click, %FALSE for downwards arrow click." -- , 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 "gtk_test_spin_button_click" :: Ptr Gtk.SpinButton.SpinButton -> -- spinner : TInterface (Name {namespace = "Gtk", name = "SpinButton"}) Word32 -> -- button : TBasicType TUInt CInt -> -- upwards : TBasicType TBoolean IO CInt {-# DEPRECATED testSpinButtonClick ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-} -- | This function will generate a /@button@/ click in the upwards or downwards -- spin button arrow areas, usually leading to an increase or decrease of -- spin button’s value. -- -- /Since: 2.14/ testSpinButtonClick :: (B.CallStack.HasCallStack, MonadIO m, Gtk.SpinButton.IsSpinButton a) => a -- ^ /@spinner@/: valid GtkSpinButton widget. -> Word32 -- ^ /@button@/: Number of the pointer button for the event, usually 1, 2 or 3. -> Bool -- ^ /@upwards@/: 'P.True' for upwards arrow click, 'P.False' for downwards arrow click. -> m Bool -- ^ __Returns:__ whether all actions neccessary for the button click simulation were carried out successfully. testSpinButtonClick :: a -> Word32 -> Bool -> m Bool testSpinButtonClick spinner :: a spinner button :: Word32 button upwards :: Bool upwards = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr SpinButton spinner' <- a -> IO (Ptr SpinButton) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a spinner let upwards' :: CInt upwards' = (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 upwards CInt result <- Ptr SpinButton -> Word32 -> CInt -> IO CInt gtk_test_spin_button_click Ptr SpinButton spinner' Word32 button CInt upwards' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a spinner Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_test_slider_set_perc -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "valid widget pointer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "percentage" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "value between 0 and 100." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_test_slider_set_perc" gtk_test_slider_set_perc :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) CDouble -> -- percentage : TBasicType TDouble IO () {-# DEPRECATED testSliderSetPerc ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-} -- | This function will adjust the slider position of all GtkRange -- based widgets, such as scrollbars or scales, it’ll also adjust -- spin buttons. The adjustment value of these widgets is set to -- a value between the lower and upper limits, according to the -- /@percentage@/ argument. -- -- /Since: 2.14/ testSliderSetPerc :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: valid widget pointer. -> Double -- ^ /@percentage@/: value between 0 and 100. -> m () testSliderSetPerc :: a -> Double -> m () testSliderSetPerc widget :: a widget percentage :: Double percentage = 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 Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget let percentage' :: CDouble percentage' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double percentage Ptr Widget -> CDouble -> IO () gtk_test_slider_set_perc Ptr Widget widget' CDouble percentage' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_test_slider_get_value -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "valid widget pointer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TDouble) -- throws : False -- Skip return : False foreign import ccall "gtk_test_slider_get_value" gtk_test_slider_get_value :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) IO CDouble {-# DEPRECATED testSliderGetValue ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-} -- | Retrive the literal adjustment value for GtkRange based -- widgets and spin buttons. Note that the value returned by -- this function is anything between the lower and upper bounds -- of the adjustment belonging to /@widget@/, and is not a percentage -- as passed in to 'GI.Gtk.Functions.testSliderSetPerc'. -- -- /Since: 2.14/ testSliderGetValue :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: valid widget pointer. -> m Double -- ^ __Returns:__ gtk_adjustment_get_value (adjustment) for an adjustment belonging to /@widget@/. testSliderGetValue :: a -> m Double testSliderGetValue widget :: a widget = IO Double -> m Double forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Double -> m Double) -> IO Double -> m Double forall a b. (a -> b) -> a -> b $ do Ptr Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget CDouble result <- Ptr Widget -> IO CDouble gtk_test_slider_get_value Ptr Widget widget' let result' :: Double result' = CDouble -> Double forall a b. (Real a, Fractional b) => a -> b realToFrac CDouble result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget Double -> IO Double forall (m :: * -> *) a. Monad m => a -> m a return Double result' -- function gtk_test_register_all_types -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_test_register_all_types" gtk_test_register_all_types :: IO () -- | Force registration of all core Gtk+ and Gdk object types. -- This allowes to refer to any of those object types via -- 'GI.GObject.Functions.typeFromName' after calling this function. -- -- /Since: 2.14/ testRegisterAllTypes :: (B.CallStack.HasCallStack, MonadIO m) => m () testRegisterAllTypes :: m () testRegisterAllTypes = 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 () gtk_test_register_all_types () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_test_list_all_types -- Args: [ Arg -- { argCName = "n_types" -- , argType = TBasicType TUInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "location to store number of types" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TCArray True (-1) 0 (TBasicType TGType)) -- throws : False -- Skip return : False foreign import ccall "gtk_test_list_all_types" gtk_test_list_all_types :: Ptr Word32 -> -- n_types : TBasicType TUInt IO (Ptr CGType) -- | Return the type ids that have been registered after -- calling 'GI.Gtk.Functions.testRegisterAllTypes'. -- -- /Since: 2.14/ testListAllTypes :: (B.CallStack.HasCallStack, MonadIO m) => m (([GType], Word32)) -- ^ __Returns:__ -- 0-terminated array of type ids testListAllTypes :: m ([GType], Word32) testListAllTypes = IO ([GType], Word32) -> m ([GType], Word32) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO ([GType], Word32) -> m ([GType], Word32)) -> IO ([GType], Word32) -> m ([GType], Word32) forall a b. (a -> b) -> a -> b $ do Ptr Word32 nTypes <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Ptr CGType result <- Ptr Word32 -> IO (Ptr CGType) gtk_test_list_all_types Ptr Word32 nTypes Text -> Ptr CGType -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "testListAllTypes" Ptr CGType result [GType] result' <- ((CGType -> GType) -> Ptr CGType -> IO [GType] forall a b. (Eq a, Num a, Storable a) => (a -> b) -> Ptr a -> IO [b] unpackMapZeroTerminatedStorableArray CGType -> GType GType) Ptr CGType result Word32 nTypes' <- Ptr Word32 -> IO Word32 forall a. Storable a => Ptr a -> IO a peek Ptr Word32 nTypes Ptr Word32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Word32 nTypes ([GType], Word32) -> IO ([GType], Word32) forall (m :: * -> *) a. Monad m => a -> m a return ([GType] result', Word32 nTypes') -- function gtk_test_find_widget -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Container widget, usually a GtkWindow." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "label_pattern" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Shell-glob pattern to match a label string." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "widget_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Type of a aearched for label sibling widget." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Widget" }) -- throws : False -- Skip return : False foreign import ccall "gtk_test_find_widget" gtk_test_find_widget :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) CString -> -- label_pattern : TBasicType TUTF8 CGType -> -- widget_type : TBasicType TGType IO (Ptr Gtk.Widget.Widget) -- | This function will search the descendants of /@widget@/ for a widget -- of type /@widgetType@/ that has a label matching /@labelPattern@/ next -- to it. This is most useful for automated GUI testing, e.g. to find -- the “OK” button in a dialog and synthesize clicks on it. -- However see 'GI.Gtk.Functions.testFindLabel', 'GI.Gtk.Functions.testFindSibling' and -- 'GI.Gtk.Functions.testWidgetClick' for possible caveats involving the search of -- such widgets and synthesizing widget events. -- -- /Since: 2.14/ testFindWidget :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: Container widget, usually a GtkWindow. -> T.Text -- ^ /@labelPattern@/: Shell-glob pattern to match a label string. -> GType -- ^ /@widgetType@/: Type of a aearched for label sibling widget. -> m (Maybe Gtk.Widget.Widget) -- ^ __Returns:__ a valid widget if any is found or 'P.Nothing'. testFindWidget :: a -> Text -> GType -> m (Maybe Widget) testFindWidget widget :: a widget labelPattern :: Text labelPattern widgetType :: GType widgetType = IO (Maybe Widget) -> m (Maybe Widget) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe Widget) -> m (Maybe Widget)) -> IO (Maybe Widget) -> m (Maybe Widget) forall a b. (a -> b) -> a -> b $ do Ptr Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget CString labelPattern' <- Text -> IO CString textToCString Text labelPattern let widgetType' :: CGType widgetType' = GType -> CGType gtypeToCGType GType widgetType Ptr Widget result <- Ptr Widget -> CString -> CGType -> IO (Ptr Widget) gtk_test_find_widget Ptr Widget widget' CString labelPattern' CGType widgetType' Maybe Widget maybeResult <- Ptr Widget -> (Ptr Widget -> IO Widget) -> IO (Maybe Widget) forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr Widget result ((Ptr Widget -> IO Widget) -> IO (Maybe Widget)) -> (Ptr Widget -> IO Widget) -> IO (Maybe Widget) forall a b. (a -> b) -> a -> b $ \result' :: Ptr Widget result' -> do Widget result'' <- ((ManagedPtr Widget -> Widget) -> Ptr Widget -> IO Widget forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Widget -> Widget Gtk.Widget.Widget) Ptr Widget result' Widget -> IO Widget forall (m :: * -> *) a. Monad m => a -> m a return Widget result'' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget CString -> IO () forall a. Ptr a -> IO () freeMem CString labelPattern' Maybe Widget -> IO (Maybe Widget) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Widget maybeResult -- function gtk_test_find_sibling -- Args: [ Arg -- { argCName = "base_widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Valid widget, part of a widget hierarchy" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "widget_type" -- , argType = TBasicType TGType -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Type of a aearched for sibling widget" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Widget" }) -- throws : False -- Skip return : False foreign import ccall "gtk_test_find_sibling" gtk_test_find_sibling :: Ptr Gtk.Widget.Widget -> -- base_widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) CGType -> -- widget_type : TBasicType TGType IO (Ptr Gtk.Widget.Widget) -- | This function will search siblings of /@baseWidget@/ and siblings of its -- ancestors for all widgets matching /@widgetType@/. -- Of the matching widgets, the one that is geometrically closest to -- /@baseWidget@/ will be returned. -- The general purpose of this function is to find the most likely “action” -- widget, relative to another labeling widget. Such as finding a -- button or text entry widget, given its corresponding label widget. -- -- /Since: 2.14/ testFindSibling :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@baseWidget@/: Valid widget, part of a widget hierarchy -> GType -- ^ /@widgetType@/: Type of a aearched for sibling widget -> m Gtk.Widget.Widget -- ^ __Returns:__ a widget of type /@widgetType@/ if any is found. testFindSibling :: a -> GType -> m Widget testFindSibling baseWidget :: a baseWidget widgetType :: GType widgetType = IO Widget -> m Widget forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Widget -> m Widget) -> IO Widget -> m Widget forall a b. (a -> b) -> a -> b $ do Ptr Widget baseWidget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a baseWidget let widgetType' :: CGType widgetType' = GType -> CGType gtypeToCGType GType widgetType Ptr Widget result <- Ptr Widget -> CGType -> IO (Ptr Widget) gtk_test_find_sibling Ptr Widget baseWidget' CGType widgetType' Text -> Ptr Widget -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "testFindSibling" Ptr Widget result Widget result' <- ((ManagedPtr Widget -> Widget) -> Ptr Widget -> IO Widget forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Widget -> Widget Gtk.Widget.Widget) Ptr Widget result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a baseWidget Widget -> IO Widget forall (m :: * -> *) a. Monad m => a -> m a return Widget result' -- function gtk_test_find_label -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Valid label or container widget." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "label_pattern" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Shell-glob pattern to match a label string." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Widget" }) -- throws : False -- Skip return : False foreign import ccall "gtk_test_find_label" gtk_test_find_label :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) CString -> -- label_pattern : TBasicType TUTF8 IO (Ptr Gtk.Widget.Widget) -- | This function will search /@widget@/ and all its descendants for a GtkLabel -- widget with a text string matching /@labelPattern@/. -- The /@labelPattern@/ may contain asterisks “*” and question marks “?” as -- placeholders, 'GI.GLib.Functions.patternMatch' is used for the matching. -- Note that locales other than \"C“ tend to alter (translate” label strings, -- so this function is genrally only useful in test programs with -- predetermined locales, see @/gtk_test_init()/@ for more details. -- -- /Since: 2.14/ testFindLabel :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: Valid label or container widget. -> T.Text -- ^ /@labelPattern@/: Shell-glob pattern to match a label string. -> m Gtk.Widget.Widget -- ^ __Returns:__ a GtkLabel widget if any is found. testFindLabel :: a -> Text -> m Widget testFindLabel widget :: a widget labelPattern :: Text labelPattern = IO Widget -> m Widget forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Widget -> m Widget) -> IO Widget -> m Widget forall a b. (a -> b) -> a -> b $ do Ptr Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget CString labelPattern' <- Text -> IO CString textToCString Text labelPattern Ptr Widget result <- Ptr Widget -> CString -> IO (Ptr Widget) gtk_test_find_label Ptr Widget widget' CString labelPattern' Text -> Ptr Widget -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "testFindLabel" Ptr Widget result Widget result' <- ((ManagedPtr Widget -> Widget) -> Ptr Widget -> IO Widget forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Widget -> Widget Gtk.Widget.Widget) Ptr Widget result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget CString -> IO () forall a. Ptr a -> IO () freeMem CString labelPattern' Widget -> IO Widget forall (m :: * -> *) a. Monad m => a -> m a return Widget result' -- function gtk_test_create_simple_window -- Args: [ Arg -- { argCName = "window_title" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Title of the window to be displayed." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "dialog_text" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Text inside the window to be displayed." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Widget" }) -- throws : False -- Skip return : False foreign import ccall "gtk_test_create_simple_window" gtk_test_create_simple_window :: CString -> -- window_title : TBasicType TUTF8 CString -> -- dialog_text : TBasicType TUTF8 IO (Ptr Gtk.Widget.Widget) {-# DEPRECATED testCreateSimpleWindow ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-} -- | Create a simple window with window title /@windowTitle@/ and -- text contents /@dialogText@/. -- The window will quit any running 'GI.Gtk.Functions.main'-loop when destroyed, and it -- will automatically be destroyed upon test function teardown. -- -- /Since: 2.14/ testCreateSimpleWindow :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@windowTitle@/: Title of the window to be displayed. -> T.Text -- ^ /@dialogText@/: Text inside the window to be displayed. -> m Gtk.Widget.Widget -- ^ __Returns:__ a widget pointer to the newly created GtkWindow. testCreateSimpleWindow :: Text -> Text -> m Widget testCreateSimpleWindow windowTitle :: Text windowTitle dialogText :: Text dialogText = IO Widget -> m Widget forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Widget -> m Widget) -> IO Widget -> m Widget forall a b. (a -> b) -> a -> b $ do CString windowTitle' <- Text -> IO CString textToCString Text windowTitle CString dialogText' <- Text -> IO CString textToCString Text dialogText Ptr Widget result <- CString -> CString -> IO (Ptr Widget) gtk_test_create_simple_window CString windowTitle' CString dialogText' Text -> Ptr Widget -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "testCreateSimpleWindow" Ptr Widget result Widget result' <- ((ManagedPtr Widget -> Widget) -> Ptr Widget -> IO Widget forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a newObject ManagedPtr Widget -> Widget Gtk.Widget.Widget) Ptr Widget result CString -> IO () forall a. Ptr a -> IO () freeMem CString windowTitle' CString -> IO () forall a. Ptr a -> IO () freeMem CString dialogText' Widget -> IO Widget forall (m :: * -> *) a. Monad m => a -> m a return Widget result' -- function gtk_targets_include_uri -- Args: [ Arg -- { argCName = "targets" -- , argType = -- TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gdk" , name = "Atom" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an array of #GdkAtoms" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_targets_include_uri" gtk_targets_include_uri :: Ptr (Ptr Gdk.Atom.Atom) -> -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"})) Int32 -> -- n_targets : TBasicType TInt IO CInt -- | Determines if any of the targets in /@targets@/ can be used to -- provide an uri list. -- -- /Since: 2.10/ targetsIncludeUri :: (B.CallStack.HasCallStack, MonadIO m) => [Gdk.Atom.Atom] -- ^ /@targets@/: an array of @/GdkAtoms/@ -> m Bool -- ^ __Returns:__ 'P.True' if /@targets@/ include a suitable target for uri lists, -- otherwise 'P.False'. targetsIncludeUri :: [Atom] -> m Bool targetsIncludeUri targets :: [Atom] targets = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do let nTargets :: Int32 nTargets = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Atom] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [Atom] targets [Ptr Atom] targets' <- (Atom -> IO (Ptr Atom)) -> [Atom] -> IO [Ptr Atom] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [Atom] targets Ptr (Ptr Atom) targets'' <- [Ptr Atom] -> IO (Ptr (Ptr Atom)) forall a. [Ptr a] -> IO (Ptr (Ptr a)) packPtrArray [Ptr Atom] targets' CInt result <- Ptr (Ptr Atom) -> Int32 -> IO CInt gtk_targets_include_uri Ptr (Ptr Atom) targets'' Int32 nTargets let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result (Atom -> IO ()) -> [Atom] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [Atom] targets Ptr (Ptr Atom) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr Atom) targets'' Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_targets_include_text -- Args: [ Arg -- { argCName = "targets" -- , argType = -- TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gdk" , name = "Atom" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an array of #GdkAtoms" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_targets_include_text" gtk_targets_include_text :: Ptr (Ptr Gdk.Atom.Atom) -> -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"})) Int32 -> -- n_targets : TBasicType TInt IO CInt -- | Determines if any of the targets in /@targets@/ can be used to -- provide text. -- -- /Since: 2.10/ targetsIncludeText :: (B.CallStack.HasCallStack, MonadIO m) => [Gdk.Atom.Atom] -- ^ /@targets@/: an array of @/GdkAtoms/@ -> m Bool -- ^ __Returns:__ 'P.True' if /@targets@/ include a suitable target for text, -- otherwise 'P.False'. targetsIncludeText :: [Atom] -> m Bool targetsIncludeText targets :: [Atom] targets = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do let nTargets :: Int32 nTargets = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Atom] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [Atom] targets [Ptr Atom] targets' <- (Atom -> IO (Ptr Atom)) -> [Atom] -> IO [Ptr Atom] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [Atom] targets Ptr (Ptr Atom) targets'' <- [Ptr Atom] -> IO (Ptr (Ptr Atom)) forall a. [Ptr a] -> IO (Ptr (Ptr a)) packPtrArray [Ptr Atom] targets' CInt result <- Ptr (Ptr Atom) -> Int32 -> IO CInt gtk_targets_include_text Ptr (Ptr Atom) targets'' Int32 nTargets let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result (Atom -> IO ()) -> [Atom] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [Atom] targets Ptr (Ptr Atom) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr Atom) targets'' Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_targets_include_rich_text -- Args: [ Arg -- { argCName = "targets" -- , argType = -- TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gdk" , name = "Atom" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an array of #GdkAtoms" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "TextBuffer" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkTextBuffer" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_targets_include_rich_text" gtk_targets_include_rich_text :: Ptr (Ptr Gdk.Atom.Atom) -> -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"})) Int32 -> -- n_targets : TBasicType TInt Ptr Gtk.TextBuffer.TextBuffer -> -- buffer : TInterface (Name {namespace = "Gtk", name = "TextBuffer"}) IO CInt -- | Determines if any of the targets in /@targets@/ can be used to -- provide rich text. -- -- /Since: 2.10/ targetsIncludeRichText :: (B.CallStack.HasCallStack, MonadIO m, Gtk.TextBuffer.IsTextBuffer a) => [Gdk.Atom.Atom] -- ^ /@targets@/: an array of @/GdkAtoms/@ -> a -- ^ /@buffer@/: a t'GI.Gtk.Objects.TextBuffer.TextBuffer' -> m Bool -- ^ __Returns:__ 'P.True' if /@targets@/ include a suitable target for rich text, -- otherwise 'P.False'. targetsIncludeRichText :: [Atom] -> a -> m Bool targetsIncludeRichText targets :: [Atom] targets buffer :: a buffer = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do let nTargets :: Int32 nTargets = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Atom] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [Atom] targets [Ptr Atom] targets' <- (Atom -> IO (Ptr Atom)) -> [Atom] -> IO [Ptr Atom] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [Atom] targets Ptr (Ptr Atom) targets'' <- [Ptr Atom] -> IO (Ptr (Ptr Atom)) forall a. [Ptr a] -> IO (Ptr (Ptr a)) packPtrArray [Ptr Atom] targets' Ptr TextBuffer buffer' <- a -> IO (Ptr TextBuffer) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a buffer CInt result <- Ptr (Ptr Atom) -> Int32 -> Ptr TextBuffer -> IO CInt gtk_targets_include_rich_text Ptr (Ptr Atom) targets'' Int32 nTargets Ptr TextBuffer buffer' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result (Atom -> IO ()) -> [Atom] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [Atom] targets a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a buffer Ptr (Ptr Atom) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr Atom) targets'' Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_targets_include_image -- Args: [ Arg -- { argCName = "targets" -- , argType = -- TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gdk" , name = "Atom" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an array of #GdkAtoms" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "writable" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "whether to accept only targets for which GTK+ knows\n how to convert a pixbuf into the format" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_targets_include_image" gtk_targets_include_image :: Ptr (Ptr Gdk.Atom.Atom) -> -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"})) Int32 -> -- n_targets : TBasicType TInt CInt -> -- writable : TBasicType TBoolean IO CInt -- | Determines if any of the targets in /@targets@/ can be used to -- provide a t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf'. -- -- /Since: 2.10/ targetsIncludeImage :: (B.CallStack.HasCallStack, MonadIO m) => [Gdk.Atom.Atom] -- ^ /@targets@/: an array of @/GdkAtoms/@ -> Bool -- ^ /@writable@/: whether to accept only targets for which GTK+ knows -- how to convert a pixbuf into the format -> m Bool -- ^ __Returns:__ 'P.True' if /@targets@/ include a suitable target for images, -- otherwise 'P.False'. targetsIncludeImage :: [Atom] -> Bool -> m Bool targetsIncludeImage targets :: [Atom] targets writable :: Bool writable = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do let nTargets :: Int32 nTargets = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Atom] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [Atom] targets [Ptr Atom] targets' <- (Atom -> IO (Ptr Atom)) -> [Atom] -> IO [Ptr Atom] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [Atom] targets Ptr (Ptr Atom) targets'' <- [Ptr Atom] -> IO (Ptr (Ptr Atom)) forall a. [Ptr a] -> IO (Ptr (Ptr a)) packPtrArray [Ptr Atom] targets' let writable' :: CInt writable' = (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 writable CInt result <- Ptr (Ptr Atom) -> Int32 -> CInt -> IO CInt gtk_targets_include_image Ptr (Ptr Atom) targets'' Int32 nTargets CInt writable' let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result (Atom -> IO ()) -> [Atom] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [Atom] targets Ptr (Ptr Atom) -> IO () forall a. Ptr a -> IO () freeMem Ptr (Ptr Atom) targets'' Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_target_table_new_from_list -- Args: [ Arg -- { argCName = "list" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "TargetList" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkTargetList" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for the number ot targets in the table" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "return location for the number ot targets in the table" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just -- (TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gtk" , name = "TargetEntry" })) -- throws : False -- Skip return : False foreign import ccall "gtk_target_table_new_from_list" gtk_target_table_new_from_list :: Ptr Gtk.TargetList.TargetList -> -- list : TInterface (Name {namespace = "Gtk", name = "TargetList"}) Ptr Int32 -> -- n_targets : TBasicType TInt IO (Ptr Gtk.TargetEntry.TargetEntry) -- | This function creates an t'GI.Gtk.Structs.TargetEntry.TargetEntry' array that contains the -- same targets as the passed @/list/@. The returned table is newly -- allocated and should be freed using 'GI.Gtk.Functions.targetTableFree' when no -- longer needed. -- -- /Since: 2.10/ targetTableNewFromList :: (B.CallStack.HasCallStack, MonadIO m) => Gtk.TargetList.TargetList -- ^ /@list@/: a t'GI.Gtk.Structs.TargetList.TargetList' -> m [Gtk.TargetEntry.TargetEntry] -- ^ __Returns:__ the new table. targetTableNewFromList :: TargetList -> m [TargetEntry] targetTableNewFromList list :: TargetList list = IO [TargetEntry] -> m [TargetEntry] forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [TargetEntry] -> m [TargetEntry]) -> IO [TargetEntry] -> m [TargetEntry] forall a b. (a -> b) -> a -> b $ do Ptr TargetList list' <- TargetList -> IO (Ptr TargetList) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr TargetList list Ptr Int32 nTargets <- IO (Ptr Int32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Int32) Ptr TargetEntry result <- Ptr TargetList -> Ptr Int32 -> IO (Ptr TargetEntry) gtk_target_table_new_from_list Ptr TargetList list' Ptr Int32 nTargets Int32 nTargets' <- Ptr Int32 -> IO Int32 forall a. Storable a => Ptr a -> IO a peek Ptr Int32 nTargets Text -> Ptr TargetEntry -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "targetTableNewFromList" Ptr TargetEntry result [Ptr TargetEntry] result' <- (Int -> Int32 -> Ptr TargetEntry -> IO [Ptr TargetEntry] forall a b. (Integral a, BoxedObject b) => Int -> a -> Ptr b -> IO [Ptr b] unpackBoxedArrayWithLength 16 Int32 nTargets') Ptr TargetEntry result [TargetEntry] result'' <- (Ptr TargetEntry -> IO TargetEntry) -> [Ptr TargetEntry] -> IO [TargetEntry] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((ManagedPtr TargetEntry -> TargetEntry) -> Ptr TargetEntry -> IO TargetEntry forall a. (HasCallStack, BoxedObject a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr TargetEntry -> TargetEntry Gtk.TargetEntry.TargetEntry) [Ptr TargetEntry] result' Ptr TargetEntry -> IO () forall a. Ptr a -> IO () freeMem Ptr TargetEntry result TargetList -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr TargetList list Ptr Int32 -> IO () forall a. Ptr a -> IO () freeMem Ptr Int32 nTargets [TargetEntry] -> IO [TargetEntry] forall (m :: * -> *) a. Monad m => a -> m a return [TargetEntry] result'' -- function gtk_target_table_free -- Args: [ Arg -- { argCName = "targets" -- , argType = -- TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gtk" , name = "TargetEntry" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkTargetEntry array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of entries in the array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "n_targets" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of entries in the array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_target_table_free" gtk_target_table_free :: Ptr Gtk.TargetEntry.TargetEntry -> -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "TargetEntry"})) Int32 -> -- n_targets : TBasicType TInt IO () -- | This function frees a target table as returned by -- 'GI.Gtk.Functions.targetTableNewFromList' -- -- /Since: 2.10/ targetTableFree :: (B.CallStack.HasCallStack, MonadIO m) => [Gtk.TargetEntry.TargetEntry] -- ^ /@targets@/: a t'GI.Gtk.Structs.TargetEntry.TargetEntry' array -> m () targetTableFree :: [TargetEntry] -> m () targetTableFree targets :: [TargetEntry] targets = 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 nTargets :: Int32 nTargets = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [TargetEntry] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [TargetEntry] targets [Ptr TargetEntry] targets' <- (TargetEntry -> IO (Ptr TargetEntry)) -> [TargetEntry] -> IO [Ptr TargetEntry] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM TargetEntry -> IO (Ptr TargetEntry) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [TargetEntry] targets Ptr TargetEntry targets'' <- Int -> [Ptr TargetEntry] -> IO (Ptr TargetEntry) forall a. Int -> [Ptr a] -> IO (Ptr a) packBlockArray 16 [Ptr TargetEntry] targets' Ptr TargetEntry -> Int32 -> IO () gtk_target_table_free Ptr TargetEntry targets'' Int32 nTargets (TargetEntry -> IO ()) -> [TargetEntry] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ TargetEntry -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [TargetEntry] targets Ptr TargetEntry -> IO () forall a. Ptr a -> IO () freeMem Ptr TargetEntry targets'' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_stock_set_translate_func -- Args: [ Arg -- { argCName = "domain" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the translation domain for which @func shall be used" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "func" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "TranslateFunc" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkTranslateFunc" -- , 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 @func" -- , 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 = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a #GDestroyNotify that is called when @data is\n no longer needed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_stock_set_translate_func" gtk_stock_set_translate_func :: CString -> -- domain : TBasicType TUTF8 FunPtr Gtk.Callbacks.C_TranslateFunc -> -- func : TInterface (Name {namespace = "Gtk", name = "TranslateFunc"}) Ptr () -> -- data : TBasicType TPtr FunPtr GLib.Callbacks.C_DestroyNotify -> -- notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"}) IO () {-# DEPRECATED stockSetTranslateFunc ["(Since version 3.10)"] #-} -- | Sets a function to be used for translating the /@label@/ of -- a stock item. -- -- If no function is registered for a translation domain, -- 'GI.GLib.Functions.dgettext' is used. -- -- The function is used for all stock items whose -- /@translationDomain@/ matches /@domain@/. Note that it is possible -- to use strings different from the actual gettext translation domain -- of your application for this, as long as your t'GI.Gtk.Callbacks.TranslateFunc' uses -- the correct domain when calling @/dgettext()/@. This can be useful, e.g. -- when dealing with message contexts: -- -- -- === /C code/ -- > -- >GtkStockItem items[] = { -- > { MY_ITEM1, NC_("odd items", "Item 1"), 0, 0, "odd-item-domain" }, -- > { MY_ITEM2, NC_("even items", "Item 2"), 0, 0, "even-item-domain" }, -- >}; -- > -- >gchar * -- >my_translate_func (const gchar *msgid, -- > gpointer data) -- >{ -- > gchar *msgctxt = data; -- > -- > return (gchar*)g_dpgettext2 (GETTEXT_PACKAGE, msgctxt, msgid); -- >} -- > -- >... -- > -- >gtk_stock_add (items, G_N_ELEMENTS (items)); -- >gtk_stock_set_translate_func ("odd-item-domain", my_translate_func, "odd items"); -- >gtk_stock_set_translate_func ("even-item-domain", my_translate_func, "even items"); -- -- -- /Since: 2.8/ stockSetTranslateFunc :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@domain@/: the translation domain for which /@func@/ shall be used -> Gtk.Callbacks.TranslateFunc -- ^ /@func@/: a t'GI.Gtk.Callbacks.TranslateFunc' -> m () stockSetTranslateFunc :: Text -> (Text -> IO Text) -> m () stockSetTranslateFunc domain :: Text domain func :: Text -> IO Text func = 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 domain' <- Text -> IO CString textToCString Text domain FunPtr C_TranslateFunc func' <- C_TranslateFunc -> IO (FunPtr C_TranslateFunc) Gtk.Callbacks.mk_TranslateFunc (Maybe (Ptr (FunPtr C_TranslateFunc)) -> TranslateFunc_WithClosures -> C_TranslateFunc Gtk.Callbacks.wrap_TranslateFunc Maybe (Ptr (FunPtr C_TranslateFunc)) forall a. Maybe a Nothing ((Text -> IO Text) -> TranslateFunc_WithClosures Gtk.Callbacks.drop_closures_TranslateFunc Text -> IO Text func)) let data_ :: Ptr () data_ = FunPtr C_TranslateFunc -> Ptr () forall a b. FunPtr a -> Ptr b castFunPtrToPtr FunPtr C_TranslateFunc func' let notify :: FunPtr (Ptr a -> IO ()) notify = FunPtr (Ptr a -> IO ()) forall a. FunPtr (Ptr a -> IO ()) safeFreeFunPtrPtr CString -> FunPtr C_TranslateFunc -> Ptr () -> FunPtr C_DestroyNotify -> IO () gtk_stock_set_translate_func CString domain' FunPtr C_TranslateFunc func' Ptr () data_ FunPtr C_DestroyNotify forall a. FunPtr (Ptr a -> IO ()) notify CString -> IO () forall a. Ptr a -> IO () freeMem CString domain' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_stock_lookup -- Args: [ Arg -- { argCName = "stock_id" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a stock item name" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StockItem" } -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "stock item to initialize with values" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_stock_lookup" gtk_stock_lookup :: CString -> -- stock_id : TBasicType TUTF8 Ptr Gtk.StockItem.StockItem -> -- item : TInterface (Name {namespace = "Gtk", name = "StockItem"}) IO CInt {-# DEPRECATED stockLookup ["(Since version 3.10)"] #-} -- | Fills /@item@/ with the registered values for /@stockId@/, returning 'P.True' -- if /@stockId@/ was known. stockLookup :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@stockId@/: a stock item name -> m ((Bool, Gtk.StockItem.StockItem)) -- ^ __Returns:__ 'P.True' if /@item@/ was initialized stockLookup :: Text -> m (Bool, StockItem) stockLookup stockId :: Text stockId = IO (Bool, StockItem) -> m (Bool, StockItem) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Bool, StockItem) -> m (Bool, StockItem)) -> IO (Bool, StockItem) -> m (Bool, StockItem) forall a b. (a -> b) -> a -> b $ do CString stockId' <- Text -> IO CString textToCString Text stockId Ptr StockItem item <- Int -> IO (Ptr StockItem) forall a. Int -> IO (Ptr a) callocBytes 32 :: IO (Ptr Gtk.StockItem.StockItem) CInt result <- CString -> Ptr StockItem -> IO CInt gtk_stock_lookup CString stockId' Ptr StockItem item let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result StockItem item' <- ((ManagedPtr StockItem -> StockItem) -> Ptr StockItem -> IO StockItem forall a. (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapPtr ManagedPtr StockItem -> StockItem Gtk.StockItem.StockItem) Ptr StockItem item CString -> IO () forall a. Ptr a -> IO () freeMem CString stockId' (Bool, StockItem) -> IO (Bool, StockItem) forall (m :: * -> *) a. Monad m => a -> m a return (Bool result', StockItem item') -- function gtk_stock_list_ids -- Args: [] -- Lengths: [] -- returnType: Just (TGSList (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "gtk_stock_list_ids" gtk_stock_list_ids :: IO (Ptr (GSList CString)) {-# DEPRECATED stockListIds ["(Since version 3.10)"] #-} -- | Retrieves a list of all known stock IDs added to a t'GI.Gtk.Objects.IconFactory.IconFactory' -- or registered with 'GI.Gtk.Functions.stockAdd'. The list must be freed with @/g_slist_free()/@, -- and each string in the list must be freed with 'GI.GLib.Functions.free'. stockListIds :: (B.CallStack.HasCallStack, MonadIO m) => m [T.Text] -- ^ __Returns:__ a list of known stock IDs stockListIds :: m [Text] stockListIds = 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 Ptr (GSList CString) result <- IO (Ptr (GSList CString)) gtk_stock_list_ids [CString] result' <- Ptr (GSList CString) -> IO [CString] forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a] unpackGSList Ptr (GSList CString) result [Text] result'' <- (CString -> IO Text) -> [CString] -> IO [Text] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM HasCallStack => CString -> IO Text CString -> IO Text cstringToText [CString] result' (CString -> IO ()) -> Ptr (GSList CString) -> IO () forall a b. (Ptr a -> IO b) -> Ptr (GSList (Ptr a)) -> IO () mapGSList CString -> IO () forall a. Ptr a -> IO () freeMem Ptr (GSList CString) result Ptr (GSList CString) -> IO () forall a. Ptr (GSList a) -> IO () g_slist_free Ptr (GSList CString) result [Text] -> IO [Text] forall (m :: * -> *) a. Monad m => a -> m a return [Text] result'' -- function gtk_stock_add_static -- Args: [ Arg -- { argCName = "items" -- , argType = -- TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gtk" , name = "StockItem" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStockItem or array of #GtkStockItem" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_items" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of items" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "n_items" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of items" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_stock_add_static" gtk_stock_add_static :: Ptr Gtk.StockItem.StockItem -> -- items : TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "StockItem"})) Word32 -> -- n_items : TBasicType TUInt IO () {-# DEPRECATED stockAddStatic ["(Since version 3.10)"] #-} -- | Same as 'GI.Gtk.Functions.stockAdd', but doesn’t copy /@items@/, so -- /@items@/ must persist until application exit. stockAddStatic :: (B.CallStack.HasCallStack, MonadIO m) => [Gtk.StockItem.StockItem] -- ^ /@items@/: a t'GI.Gtk.Structs.StockItem.StockItem' or array of t'GI.Gtk.Structs.StockItem.StockItem' -> m () stockAddStatic :: [StockItem] -> m () stockAddStatic items :: [StockItem] items = 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 nItems :: Word32 nItems = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [StockItem] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [StockItem] items [Ptr StockItem] items' <- (StockItem -> IO (Ptr StockItem)) -> [StockItem] -> IO [Ptr StockItem] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM StockItem -> IO (Ptr StockItem) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [StockItem] items Ptr StockItem items'' <- Int -> [Ptr StockItem] -> IO (Ptr StockItem) forall a. Int -> [Ptr a] -> IO (Ptr a) packBlockArray 32 [Ptr StockItem] items' Ptr StockItem -> Word32 -> IO () gtk_stock_add_static Ptr StockItem items'' Word32 nItems (StockItem -> IO ()) -> [StockItem] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ StockItem -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [StockItem] items Ptr StockItem -> IO () forall a. Ptr a -> IO () freeMem Ptr StockItem items'' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_stock_add -- Args: [ Arg -- { argCName = "items" -- , argType = -- TCArray -- False -- (-1) -- 1 -- (TInterface Name { namespace = "Gtk" , name = "StockItem" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStockItem or array of items" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "n_items" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of #GtkStockItem in @items" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "n_items" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of #GtkStockItem in @items" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_stock_add" gtk_stock_add :: Ptr Gtk.StockItem.StockItem -> -- items : TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "StockItem"})) Word32 -> -- n_items : TBasicType TUInt IO () {-# DEPRECATED stockAdd ["(Since version 3.10)"] #-} -- | Registers each of the stock items in /@items@/. If an item already -- exists with the same stock ID as one of the /@items@/, the old item -- gets replaced. The stock items are copied, so GTK+ does not hold -- any pointer into /@items@/ and /@items@/ can be freed. Use -- 'GI.Gtk.Functions.stockAddStatic' if /@items@/ is persistent and GTK+ need not -- copy the array. stockAdd :: (B.CallStack.HasCallStack, MonadIO m) => [Gtk.StockItem.StockItem] -- ^ /@items@/: a t'GI.Gtk.Structs.StockItem.StockItem' or array of items -> m () stockAdd :: [StockItem] -> m () stockAdd items :: [StockItem] items = 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 nItems :: Word32 nItems = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [StockItem] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [StockItem] items [Ptr StockItem] items' <- (StockItem -> IO (Ptr StockItem)) -> [StockItem] -> IO [Ptr StockItem] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM StockItem -> IO (Ptr StockItem) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [StockItem] items Ptr StockItem items'' <- Int -> [Ptr StockItem] -> IO (Ptr StockItem) forall a. Int -> [Ptr a] -> IO (Ptr a) packBlockArray 32 [Ptr StockItem] items' Ptr StockItem -> Word32 -> IO () gtk_stock_add Ptr StockItem items'' Word32 nItems (StockItem -> IO ()) -> [StockItem] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ StockItem -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [StockItem] items Ptr StockItem -> IO () forall a. Ptr a -> IO () freeMem Ptr StockItem items'' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_show_uri_on_window -- Args: [ Arg -- { argCName = "parent" -- , argType = TInterface Name { namespace = "Gtk" , name = "Window" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "parent window" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "uri" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the uri to show" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "timestamp" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a timestamp to prevent focus stealing" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "gtk_show_uri_on_window" gtk_show_uri_on_window :: Ptr Gtk.Window.Window -> -- parent : TInterface (Name {namespace = "Gtk", name = "Window"}) CString -> -- uri : TBasicType TUTF8 Word32 -> -- timestamp : TBasicType TUInt32 Ptr (Ptr GError) -> -- error IO CInt -- | This is a convenience function for launching the default application -- to show the uri. The uri must be of a form understood by GIO (i.e. you -- need to install gvfs to get support for uri schemes such as http:\/\/ -- or ftp:\/\/, as only local files are handled by GIO itself). -- Typical examples are -- -- * @file:\/\/\/home\/gnome\/pict.jpg@ -- * @http:\/\/www.gnome.org@ -- * @mailto:me\@gnome.org@ -- -- -- Ideally the timestamp is taken from the event triggering -- the 'GI.Gtk.Functions.showUri' call. If timestamp is not known you can take -- 'GI.Gdk.Constants.CURRENT_TIME'. -- -- This is the recommended call to be used as it passes information -- necessary for sandbox helpers to parent their dialogs properly. -- -- /Since: 3.22/ showUriOnWindow :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) => Maybe (a) -- ^ /@parent@/: parent window -> T.Text -- ^ /@uri@/: the uri to show -> Word32 -- ^ /@timestamp@/: a timestamp to prevent focus stealing -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ showUriOnWindow :: Maybe a -> Text -> Word32 -> m () showUriOnWindow parent :: Maybe a parent uri :: Text uri timestamp :: Word32 timestamp = 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 maybeParent <- case Maybe a parent of Nothing -> Ptr Window -> IO (Ptr Window) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Window forall a. Ptr a nullPtr Just jParent :: a jParent -> do Ptr Window jParent' <- a -> IO (Ptr Window) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jParent Ptr Window -> IO (Ptr Window) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Window jParent' CString uri' <- Text -> IO CString textToCString Text uri IO () -> IO () -> IO () forall a b. IO a -> IO b -> IO a onException (do CInt _ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt) -> (Ptr (Ptr GError) -> IO CInt) -> IO CInt forall a b. (a -> b) -> a -> b $ Ptr Window -> CString -> Word32 -> Ptr (Ptr GError) -> IO CInt gtk_show_uri_on_window Ptr Window maybeParent CString uri' Word32 timestamp Maybe a -> (a -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a parent a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr CString -> IO () forall a. Ptr a -> IO () freeMem CString uri' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () ) (do CString -> IO () forall a. Ptr a -> IO () freeMem CString uri' ) -- function gtk_show_uri -- Args: [ Arg -- { argCName = "screen" -- , argType = TInterface Name { namespace = "Gdk" , name = "Screen" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "screen to show the uri on\n or %NULL for the default screen" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "uri" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the uri to show" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "timestamp" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a timestamp to prevent focus stealing" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "gtk_show_uri" gtk_show_uri :: Ptr Gdk.Screen.Screen -> -- screen : TInterface (Name {namespace = "Gdk", name = "Screen"}) CString -> -- uri : TBasicType TUTF8 Word32 -> -- timestamp : TBasicType TUInt32 Ptr (Ptr GError) -> -- error IO CInt -- | A convenience function for launching the default application -- to show the uri. Like 'GI.Gtk.Functions.showUriOnWindow', but takes a screen -- as transient parent instead of a window. -- -- Note that this function is deprecated as it does not pass the necessary -- information for helpers to parent their dialog properly, when run from -- sandboxed applications for example. -- -- /Since: 2.14/ showUri :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Screen.IsScreen a) => Maybe (a) -- ^ /@screen@/: screen to show the uri on -- or 'P.Nothing' for the default screen -> T.Text -- ^ /@uri@/: the uri to show -> Word32 -- ^ /@timestamp@/: a timestamp to prevent focus stealing -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ showUri :: Maybe a -> Text -> Word32 -> m () showUri screen :: Maybe a screen uri :: Text uri timestamp :: Word32 timestamp = 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 Screen maybeScreen <- case Maybe a screen of Nothing -> Ptr Screen -> IO (Ptr Screen) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Screen forall a. Ptr a nullPtr Just jScreen :: a jScreen -> do Ptr Screen jScreen' <- a -> IO (Ptr Screen) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jScreen Ptr Screen -> IO (Ptr Screen) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Screen jScreen' CString uri' <- Text -> IO CString textToCString Text uri IO () -> IO () -> IO () forall a b. IO a -> IO b -> IO a onException (do CInt _ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt) -> (Ptr (Ptr GError) -> IO CInt) -> IO CInt forall a b. (a -> b) -> a -> b $ Ptr Screen -> CString -> Word32 -> Ptr (Ptr GError) -> IO CInt gtk_show_uri Ptr Screen maybeScreen CString uri' Word32 timestamp Maybe a -> (a -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a screen a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr CString -> IO () forall a. Ptr a -> IO () freeMem CString uri' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () ) (do CString -> IO () forall a. Ptr a -> IO () freeMem CString uri' ) -- function gtk_set_debug_flags -- Args: [ Arg -- { argCName = "flags" -- , argType = TBasicType TUInt -- , 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 "gtk_set_debug_flags" gtk_set_debug_flags :: Word32 -> -- flags : TBasicType TUInt IO () -- | Sets the GTK+ debug flags. setDebugFlags :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -> m () setDebugFlags :: Word32 -> m () setDebugFlags flags :: Word32 flags = 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 () gtk_set_debug_flags Word32 flags () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_selection_remove_all -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkWidget" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_selection_remove_all" gtk_selection_remove_all :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) IO () -- | Removes all handlers and unsets ownership of all -- selections for a widget. Called when widget is being -- destroyed. This function will not generally be -- called by applications. selectionRemoveAll :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: a t'GI.Gtk.Objects.Widget.Widget' -> m () selectionRemoveAll :: a -> m () selectionRemoveAll widget :: a widget = 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 Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget Ptr Widget -> IO () gtk_selection_remove_all Ptr Widget widget' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_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 where the selection is set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "new selection owner (a #GtkWidget), or %NULL." -- , 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 interned atom representing the selection to claim." -- , 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 with which to claim the selection" -- , 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 "gtk_selection_owner_set_for_display" gtk_selection_owner_set_for_display :: Ptr Gdk.Display.Display -> -- display : TInterface (Name {namespace = "Gdk", name = "Display"}) Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Word32 -> -- time_ : TBasicType TUInt32 IO CInt -- | Claim ownership of a given selection for a particular widget, or, -- if /@widget@/ is 'P.Nothing', release ownership of the selection. -- -- /Since: 2.2/ selectionOwnerSetForDisplay :: (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a, Gtk.Widget.IsWidget b) => a -- ^ /@display@/: the t'GI.Gdk.Objects.Display.Display' where the selection is set -> Maybe (b) -- ^ /@widget@/: new selection owner (a t'GI.Gtk.Objects.Widget.Widget'), or 'P.Nothing'. -> Gdk.Atom.Atom -- ^ /@selection@/: an interned atom representing the selection to claim. -> Word32 -- ^ /@time_@/: timestamp with which to claim the selection -> m Bool -- ^ __Returns:__ TRUE if the operation succeeded selectionOwnerSetForDisplay :: a -> Maybe b -> Atom -> Word32 -> m Bool selectionOwnerSetForDisplay display :: a display widget :: Maybe b widget selection :: Atom selection time_ :: Word32 time_ = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr Display display' <- a -> IO (Ptr Display) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a display Ptr Widget maybeWidget <- case Maybe b widget of Nothing -> Ptr Widget -> IO (Ptr Widget) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Widget forall a. Ptr a nullPtr Just jWidget :: b jWidget -> do Ptr Widget jWidget' <- b -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jWidget Ptr Widget -> IO (Ptr Widget) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Widget jWidget' Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection CInt result <- Ptr Display -> Ptr Widget -> Ptr Atom -> Word32 -> IO CInt gtk_selection_owner_set_for_display Ptr Display display' Ptr Widget maybeWidget Ptr Atom selection' Word32 time_ let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 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 widget b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_selection_owner_set -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkWidget, or %NULL." -- , 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 interned atom representing the selection to claim" -- , 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 with which to claim the selection" -- , 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 "gtk_selection_owner_set" gtk_selection_owner_set :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Word32 -> -- time_ : TBasicType TUInt32 IO CInt -- | Claims ownership of a given selection for a particular widget, -- or, if /@widget@/ is 'P.Nothing', release ownership of the selection. selectionOwnerSet :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => Maybe (a) -- ^ /@widget@/: a t'GI.Gtk.Objects.Widget.Widget', or 'P.Nothing'. -> Gdk.Atom.Atom -- ^ /@selection@/: an interned atom representing the selection to claim -> Word32 -- ^ /@time_@/: timestamp with which to claim the selection -> m Bool -- ^ __Returns:__ 'P.True' if the operation succeeded selectionOwnerSet :: Maybe a -> Atom -> Word32 -> m Bool selectionOwnerSet widget :: Maybe a widget selection :: Atom selection time_ :: Word32 time_ = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr Widget maybeWidget <- case Maybe a widget of Nothing -> Ptr Widget -> IO (Ptr Widget) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Widget forall a. Ptr a nullPtr Just jWidget :: a jWidget -> do Ptr Widget jWidget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jWidget Ptr Widget -> IO (Ptr Widget) forall (m :: * -> *) a. Monad m => a -> m a return Ptr Widget jWidget' Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection CInt result <- Ptr Widget -> Ptr Atom -> Word32 -> IO CInt gtk_selection_owner_set Ptr Widget maybeWidget Ptr Atom selection' Word32 time_ let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result Maybe a -> (a -> IO ()) -> IO () forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a widget a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_selection_convert -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The widget which acts as requestor" -- , 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 "Which selection to get" -- , 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 "Form of information desired (e.g., STRING)" -- , 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 -- "Time of request (usually of triggering event)\n In emergency, you could use #GDK_CURRENT_TIME" -- , 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 "gtk_selection_convert" gtk_selection_convert :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) 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 CInt -- | Requests the contents of a selection. When received, -- a “selection-received” signal will be generated. selectionConvert :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: The widget which acts as requestor -> Gdk.Atom.Atom -- ^ /@selection@/: Which selection to get -> Gdk.Atom.Atom -- ^ /@target@/: Form of information desired (e.g., STRING) -> Word32 -- ^ /@time_@/: Time of request (usually of triggering event) -- In emergency, you could use 'GI.Gdk.Constants.CURRENT_TIME' -> m Bool -- ^ __Returns:__ 'P.True' if requested succeeded. 'P.False' if we could not process -- request. (e.g., there was already a request in process for -- this widget). selectionConvert :: a -> Atom -> Atom -> Word32 -> m Bool selectionConvert widget :: a widget selection :: Atom selection target :: Atom target time_ :: Word32 time_ = IO Bool -> m Bool forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool forall a b. (a -> b) -> a -> b $ do Ptr Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget 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 CInt result <- Ptr Widget -> Ptr Atom -> Ptr Atom -> Word32 -> IO CInt gtk_selection_convert Ptr Widget widget' Ptr Atom selection' Ptr Atom target' Word32 time_ let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= 0) CInt result a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom target Bool -> IO Bool forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function gtk_selection_clear_targets -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkWidget" , 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 representing a selection" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_selection_clear_targets" gtk_selection_clear_targets :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) IO () -- | Remove all targets registered for the given selection for the -- widget. selectionClearTargets :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: a t'GI.Gtk.Objects.Widget.Widget' -> Gdk.Atom.Atom -- ^ /@selection@/: an atom representing a selection -> m () selectionClearTargets :: a -> Atom -> m () selectionClearTargets widget :: a widget selection :: Atom selection = 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 Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection Ptr Widget -> Ptr Atom -> IO () gtk_selection_clear_targets Ptr Widget widget' Ptr Atom selection' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_selection_add_targets -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkWidget" , 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 "the selection" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "targets" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface Name { namespace = "Gtk" , name = "TargetEntry" }) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a table of targets to add" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "ntargets" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of entries in @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "ntargets" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of entries in @targets" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_selection_add_targets" gtk_selection_add_targets :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Ptr Gtk.TargetEntry.TargetEntry -> -- targets : TCArray False (-1) 3 (TInterface (Name {namespace = "Gtk", name = "TargetEntry"})) Word32 -> -- ntargets : TBasicType TUInt IO () -- | Prepends a table of targets to the list of supported targets -- for a given widget and selection. selectionAddTargets :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: a t'GI.Gtk.Objects.Widget.Widget' -> Gdk.Atom.Atom -- ^ /@selection@/: the selection -> [Gtk.TargetEntry.TargetEntry] -- ^ /@targets@/: a table of targets to add -> m () selectionAddTargets :: a -> Atom -> [TargetEntry] -> m () selectionAddTargets widget :: a widget selection :: Atom selection targets :: [TargetEntry] targets = 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 ntargets :: Word32 ntargets = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [TargetEntry] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [TargetEntry] targets Ptr Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget Ptr Atom selection' <- Atom -> IO (Ptr Atom) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Atom selection [Ptr TargetEntry] targets' <- (TargetEntry -> IO (Ptr TargetEntry)) -> [TargetEntry] -> IO [Ptr TargetEntry] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM TargetEntry -> IO (Ptr TargetEntry) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [TargetEntry] targets Ptr TargetEntry targets'' <- Int -> [Ptr TargetEntry] -> IO (Ptr TargetEntry) forall a. Int -> [Ptr a] -> IO (Ptr a) packBlockArray 16 [Ptr TargetEntry] targets' Ptr Widget -> Ptr Atom -> Ptr TargetEntry -> Word32 -> IO () gtk_selection_add_targets Ptr Widget widget' Ptr Atom selection' Ptr TargetEntry targets'' Word32 ntargets a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget Atom -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Atom selection (TargetEntry -> IO ()) -> [TargetEntry] -> IO () forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ TargetEntry -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr [TargetEntry] targets Ptr TargetEntry -> IO () forall a. Ptr a -> IO () freeMem Ptr TargetEntry targets'' () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_selection_add_target -- Args: [ Arg -- { argCName = "widget" -- , argType = TInterface Name { namespace = "Gtk" , name = "Widget" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkWidget" , 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 "the selection" , 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 to add." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "info" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "A unsigned integer which will be passed back to the application." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_selection_add_target" gtk_selection_add_target :: Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) Ptr Gdk.Atom.Atom -> -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"}) Ptr Gdk.Atom.Atom -> -- target : TInterface (Name {namespace = "Gdk", name = "Atom"}) Word32 -> -- info : TBasicType TUInt IO () -- | Appends a specified target to the list of supported targets for a -- given widget and selection. selectionAddTarget :: (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) => a -- ^ /@widget@/: a t'GI.Gtk.Objects.Widget.Widget' -> Gdk.Atom.Atom -- ^ /@selection@/: the selection -> Gdk.Atom.Atom -- ^ /@target@/: target to add. -> Word32 -- ^ /@info@/: A unsigned integer which will be passed back to the application. -> m () selectionAddTarget :: a -> Atom -> Atom -> Word32 -> m () selectionAddTarget widget :: a widget selection :: Atom selection target :: Atom target info :: Word32 info = 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 Widget widget' <- a -> IO (Ptr Widget) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a widget 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 Widget -> Ptr Atom -> Ptr Atom -> Word32 -> IO () gtk_selection_add_target Ptr Widget widget' Ptr Atom selection' Ptr Atom target' Word32 info a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a widget 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 gtk_rgb_to_hsv -- Args: [ Arg -- { argCName = "r" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Just "Red" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "g" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Green" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "b" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation { rawDocText = Just "Blue" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "h" -- , argType = TBasicType TDouble -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Return value for the hue component" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "s" -- , argType = TBasicType TDouble -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Return value for the saturation component" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "v" -- , argType = TBasicType TDouble -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Return value for the value component" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_rgb_to_hsv" gtk_rgb_to_hsv :: CDouble -> -- r : TBasicType TDouble CDouble -> -- g : TBasicType TDouble CDouble -> -- b : TBasicType TDouble Ptr CDouble -> -- h : TBasicType TDouble Ptr CDouble -> -- s : TBasicType TDouble Ptr CDouble -> -- v : TBasicType TDouble IO () -- | Converts a color from RGB space to HSV. -- -- Input values must be in the [0.0, 1.0] range; -- output values will be in the same range. -- -- /Since: 2.14/ rgbToHsv :: (B.CallStack.HasCallStack, MonadIO m) => Double -- ^ /@r@/: Red -> Double -- ^ /@g@/: Green -> Double -- ^ /@b@/: Blue -> m ((Double, Double, Double)) rgbToHsv :: Double -> Double -> Double -> m (Double, Double, Double) rgbToHsv r :: Double r g :: Double g b :: Double b = IO (Double, Double, Double) -> m (Double, Double, Double) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Double, Double, Double) -> m (Double, Double, Double)) -> IO (Double, Double, Double) -> m (Double, Double, Double) forall a b. (a -> b) -> a -> b $ do let r' :: CDouble r' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double r let g' :: CDouble g' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double g let b' :: CDouble b' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double b Ptr CDouble h <- IO (Ptr CDouble) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr CDouble) Ptr CDouble s <- IO (Ptr CDouble) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr CDouble) Ptr CDouble v <- IO (Ptr CDouble) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr CDouble) CDouble -> CDouble -> CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () gtk_rgb_to_hsv CDouble r' CDouble g' CDouble b' Ptr CDouble h Ptr CDouble s Ptr CDouble v CDouble h' <- Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble h let h'' :: Double h'' = CDouble -> Double forall a b. (Real a, Fractional b) => a -> b realToFrac CDouble h' CDouble s' <- Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble s let s'' :: Double s'' = CDouble -> Double forall a b. (Real a, Fractional b) => a -> b realToFrac CDouble s' CDouble v' <- Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble v let v'' :: Double v'' = CDouble -> Double forall a b. (Real a, Fractional b) => a -> b realToFrac CDouble v' Ptr CDouble -> IO () forall a. Ptr a -> IO () freeMem Ptr CDouble h Ptr CDouble -> IO () forall a. Ptr a -> IO () freeMem Ptr CDouble s Ptr CDouble -> IO () forall a. Ptr a -> IO () freeMem Ptr CDouble v (Double, Double, Double) -> IO (Double, Double, Double) forall (m :: * -> *) a. Monad m => a -> m a return (Double h'', Double s'', Double v'') -- function gtk_render_slider -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X origin of the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y origin of the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "width" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "rectangle width" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "height" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "rectangle height" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "orientation" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "Orientation" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "orientation of the slider" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_slider" gtk_render_slider :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) CDouble -> -- x : TBasicType TDouble CDouble -> -- y : TBasicType TDouble CDouble -> -- width : TBasicType TDouble CDouble -> -- height : TBasicType TDouble CUInt -> -- orientation : TInterface (Name {namespace = "Gtk", name = "Orientation"}) IO () -- | Renders a slider (as in t'GI.Gtk.Objects.Scale.Scale') in the rectangle defined by /@x@/, /@y@/, -- /@width@/, /@height@/. /@orientation@/ defines whether the slider is vertical -- or horizontal. -- -- Typical slider rendering: -- -- <<https://developer.gnome.org/gtk3/stable/sliders.png>> -- -- /Since: 3.0/ renderSlider :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> Double -- ^ /@x@/: X origin of the rectangle -> Double -- ^ /@y@/: Y origin of the rectangle -> Double -- ^ /@width@/: rectangle width -> Double -- ^ /@height@/: rectangle height -> Gtk.Enums.Orientation -- ^ /@orientation@/: orientation of the slider -> m () renderSlider :: a -> Context -> Double -> Double -> Double -> Double -> Orientation -> m () renderSlider context :: a context cr :: Context cr x :: Double x y :: Double y width :: Double width height :: Double height orientation :: Orientation orientation = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr let x' :: CDouble x' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x let y' :: CDouble y' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y let width' :: CDouble width' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double width let height' :: CDouble height' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double height let orientation' :: CUInt orientation' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (Orientation -> Int) -> Orientation -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . Orientation -> Int forall a. Enum a => a -> Int fromEnum) Orientation orientation Ptr StyleContext -> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> CUInt -> IO () gtk_render_slider Ptr StyleContext context' Ptr Context cr' CDouble x' CDouble y' CDouble width' CDouble height' CUInt orientation' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_option -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X origin of the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y origin of the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "width" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "rectangle width" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "height" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "rectangle height" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_option" gtk_render_option :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) CDouble -> -- x : TBasicType TDouble CDouble -> -- y : TBasicType TDouble CDouble -> -- width : TBasicType TDouble CDouble -> -- height : TBasicType TDouble IO () -- | Renders an option mark (as in a t'GI.Gtk.Objects.RadioButton.RadioButton'), the 'GI.Gtk.Flags.StateFlagsChecked' -- state will determine whether the option is on or off, and -- 'GI.Gtk.Flags.StateFlagsInconsistent' whether it should be marked as undefined. -- -- Typical option mark rendering: -- -- <<https://developer.gnome.org/gtk3/stable/options.png>> -- -- /Since: 3.0/ renderOption :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> Double -- ^ /@x@/: X origin of the rectangle -> Double -- ^ /@y@/: Y origin of the rectangle -> Double -- ^ /@width@/: rectangle width -> Double -- ^ /@height@/: rectangle height -> m () renderOption :: a -> Context -> Double -> Double -> Double -> Double -> m () renderOption context :: a context cr :: Context cr x :: Double x y :: Double y width :: Double width height :: Double height = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr let x' :: CDouble x' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x let y' :: CDouble y' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y let width' :: CDouble width' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double width let height' :: CDouble height' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double height Ptr StyleContext -> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO () gtk_render_option Ptr StyleContext context' Ptr Context cr' CDouble x' CDouble y' CDouble width' CDouble height' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_line -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x0" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X coordinate for the origin of the line" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y0" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y coordinate for the origin of the line" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x1" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X coordinate for the end of the line" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y1" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y coordinate for the end of the line" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_line" gtk_render_line :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) CDouble -> -- x0 : TBasicType TDouble CDouble -> -- y0 : TBasicType TDouble CDouble -> -- x1 : TBasicType TDouble CDouble -> -- y1 : TBasicType TDouble IO () -- | Renders a line from (x0, y0) to (x1, y1). -- -- /Since: 3.0/ renderLine :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> Double -- ^ /@x0@/: X coordinate for the origin of the line -> Double -- ^ /@y0@/: Y coordinate for the origin of the line -> Double -- ^ /@x1@/: X coordinate for the end of the line -> Double -- ^ /@y1@/: Y coordinate for the end of the line -> m () renderLine :: a -> Context -> Double -> Double -> Double -> Double -> m () renderLine context :: a context cr :: Context cr x0 :: Double x0 y0 :: Double y0 x1 :: Double x1 y1 :: Double y1 = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr let x0' :: CDouble x0' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x0 let y0' :: CDouble y0' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y0 let x1' :: CDouble x1' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x1 let y1' :: CDouble y1' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y1 Ptr StyleContext -> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO () gtk_render_line Ptr StyleContext context' Ptr Context cr' CDouble x0' CDouble y0' CDouble x1' CDouble y1' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_layout -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X origin" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y origin" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "layout" -- , argType = -- TInterface Name { namespace = "Pango" , name = "Layout" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the #PangoLayout to render" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_layout" gtk_render_layout :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) CDouble -> -- x : TBasicType TDouble CDouble -> -- y : TBasicType TDouble Ptr Pango.Layout.Layout -> -- layout : TInterface (Name {namespace = "Pango", name = "Layout"}) IO () -- | Renders /@layout@/ on the coordinates /@x@/, /@y@/ -- -- /Since: 3.0/ renderLayout :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, Pango.Layout.IsLayout b) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> Double -- ^ /@x@/: X origin -> Double -- ^ /@y@/: Y origin -> b -- ^ /@layout@/: the t'GI.Pango.Objects.Layout.Layout' to render -> m () renderLayout :: a -> Context -> Double -> Double -> b -> m () renderLayout context :: a context cr :: Context cr x :: Double x y :: Double y layout :: b layout = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr let x' :: CDouble x' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x let y' :: CDouble y' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y Ptr Layout layout' <- b -> IO (Ptr Layout) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b layout Ptr StyleContext -> Ptr Context -> CDouble -> CDouble -> Ptr Layout -> IO () gtk_render_layout Ptr StyleContext context' Ptr Context cr' CDouble x' CDouble y' Ptr Layout layout' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr b layout () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_insertion_cursor -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X origin" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y origin" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "layout" -- , argType = -- TInterface Name { namespace = "Pango" , name = "Layout" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the #PangoLayout of the text" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the index in the #PangoLayout" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "Pango" , name = "Direction" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the #PangoDirection of the text" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_insertion_cursor" gtk_render_insertion_cursor :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) CDouble -> -- x : TBasicType TDouble CDouble -> -- y : TBasicType TDouble Ptr Pango.Layout.Layout -> -- layout : TInterface (Name {namespace = "Pango", name = "Layout"}) Int32 -> -- index : TBasicType TInt CUInt -> -- direction : TInterface (Name {namespace = "Pango", name = "Direction"}) IO () -- | Draws a text caret on /@cr@/ at the specified index of /@layout@/. -- -- /Since: 3.4/ renderInsertionCursor :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, Pango.Layout.IsLayout b) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> Double -- ^ /@x@/: X origin -> Double -- ^ /@y@/: Y origin -> b -- ^ /@layout@/: the t'GI.Pango.Objects.Layout.Layout' of the text -> Int32 -- ^ /@index@/: the index in the t'GI.Pango.Objects.Layout.Layout' -> Pango.Enums.Direction -- ^ /@direction@/: the t'GI.Pango.Enums.Direction' of the text -> m () renderInsertionCursor :: a -> Context -> Double -> Double -> b -> Int32 -> Direction -> m () renderInsertionCursor context :: a context cr :: Context cr x :: Double x y :: Double y layout :: b layout index :: Int32 index direction :: Direction direction = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr let x' :: CDouble x' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x let y' :: CDouble y' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y Ptr Layout layout' <- b -> IO (Ptr Layout) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b layout let direction' :: CUInt direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (Direction -> Int) -> Direction -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . Direction -> Int forall a. Enum a => a -> Int fromEnum) Direction direction Ptr StyleContext -> Ptr Context -> CDouble -> CDouble -> Ptr Layout -> Int32 -> CUInt -> IO () gtk_render_insertion_cursor Ptr StyleContext context' Ptr Context cr' CDouble x' CDouble y' Ptr Layout layout' Int32 index CUInt direction' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr b layout () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_icon_surface -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "surface" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Surface" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "a #cairo_surface_t containing the icon to draw" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X position for the @icon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y position for the @incon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_icon_surface" gtk_render_icon_surface :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) Ptr Cairo.Surface.Surface -> -- surface : TInterface (Name {namespace = "cairo", name = "Surface"}) CDouble -> -- x : TBasicType TDouble CDouble -> -- y : TBasicType TDouble IO () -- | Renders the icon in /@surface@/ at the specified /@x@/ and /@y@/ coordinates. -- -- /Since: 3.10/ renderIconSurface :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> Cairo.Surface.Surface -- ^ /@surface@/: a t'GI.Cairo.Structs.Surface.Surface' containing the icon to draw -> Double -- ^ /@x@/: X position for the /@icon@/ -> Double -- ^ /@y@/: Y position for the /@incon@/ -> m () renderIconSurface :: a -> Context -> Surface -> Double -> Double -> m () renderIconSurface context :: a context cr :: Context cr surface :: Surface surface x :: Double x y :: Double y = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr Ptr Surface surface' <- Surface -> IO (Ptr Surface) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Surface surface let x' :: CDouble x' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x let y' :: CDouble y' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y Ptr StyleContext -> Ptr Context -> Ptr Surface -> CDouble -> CDouble -> IO () gtk_render_icon_surface Ptr StyleContext context' Ptr Context cr' Ptr Surface surface' CDouble x' CDouble y' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr Surface -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Surface surface () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_icon_pixbuf -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "source" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "IconSource" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #GtkIconSource specifying the icon to render" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the size (#GtkIconSize) to render the icon at.\n A size of `(GtkIconSize) -1` means render at the size of the source\n and don\8217t scale." -- , 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 "gtk_render_icon_pixbuf" gtk_render_icon_pixbuf :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Gtk.IconSource.IconSource -> -- source : TInterface (Name {namespace = "Gtk", name = "IconSource"}) Int32 -> -- size : TBasicType TInt IO (Ptr GdkPixbuf.Pixbuf.Pixbuf) {-# DEPRECATED renderIconPixbuf ["(Since version 3.10)","Use 'GI.Gtk.Objects.IconTheme.iconThemeLoadIcon' instead."] #-} -- | Renders the icon specified by /@source@/ at the given /@size@/, returning the result -- in a pixbuf. -- -- /Since: 3.0/ renderIconPixbuf :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Gtk.IconSource.IconSource -- ^ /@source@/: the t'GI.Gtk.Structs.IconSource.IconSource' specifying the icon to render -> Int32 -- ^ /@size@/: the size (t'GI.Gtk.Enums.IconSize') to render the icon at. -- A size of @(GtkIconSize) -1@ means render at the size of the source -- and don’t scale. -> m GdkPixbuf.Pixbuf.Pixbuf -- ^ __Returns:__ a newly-created t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' containing the rendered icon renderIconPixbuf :: a -> IconSource -> Int32 -> m Pixbuf renderIconPixbuf context :: a context source :: IconSource source size :: Int32 size = IO Pixbuf -> m Pixbuf forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Pixbuf -> m Pixbuf) -> IO Pixbuf -> m Pixbuf forall a b. (a -> b) -> a -> b $ do Ptr StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr IconSource source' <- IconSource -> IO (Ptr IconSource) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr IconSource source Ptr Pixbuf result <- Ptr StyleContext -> Ptr IconSource -> Int32 -> IO (Ptr Pixbuf) gtk_render_icon_pixbuf Ptr StyleContext context' Ptr IconSource source' Int32 size Text -> Ptr Pixbuf -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL "renderIconPixbuf" Ptr Pixbuf result 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 a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context IconSource -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr IconSource source Pixbuf -> IO Pixbuf forall (m :: * -> *) a. Monad m => a -> m a return Pixbuf result' -- function gtk_render_icon -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "pixbuf" -- , argType = -- TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GdkPixbuf containing the icon to draw" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X position for the @pixbuf" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y position for the @pixbuf" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_icon" gtk_render_icon :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) Ptr GdkPixbuf.Pixbuf.Pixbuf -> -- pixbuf : TInterface (Name {namespace = "GdkPixbuf", name = "Pixbuf"}) CDouble -> -- x : TBasicType TDouble CDouble -> -- y : TBasicType TDouble IO () -- | Renders the icon in /@pixbuf@/ at the specified /@x@/ and /@y@/ coordinates. -- -- This function will render the icon in /@pixbuf@/ at exactly its size, -- regardless of scaling factors, which may not be appropriate when -- drawing on displays with high pixel densities. -- -- You probably want to use 'GI.Gtk.Functions.renderIconSurface' instead, if you -- already have a Cairo surface. -- -- /Since: 3.2/ renderIcon :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, GdkPixbuf.Pixbuf.IsPixbuf b) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> b -- ^ /@pixbuf@/: a t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' containing the icon to draw -> Double -- ^ /@x@/: X position for the /@pixbuf@/ -> Double -- ^ /@y@/: Y position for the /@pixbuf@/ -> m () renderIcon :: a -> Context -> b -> Double -> Double -> m () renderIcon context :: a context cr :: Context cr pixbuf :: b pixbuf x :: Double x y :: Double y = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr Ptr Pixbuf pixbuf' <- b -> IO (Ptr Pixbuf) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b pixbuf let x' :: CDouble x' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x let y' :: CDouble y' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y Ptr StyleContext -> Ptr Context -> Ptr Pixbuf -> CDouble -> CDouble -> IO () gtk_render_icon Ptr StyleContext context' Ptr Context cr' Ptr Pixbuf pixbuf' CDouble x' CDouble y' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr b -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr b pixbuf () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_handle -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X origin of the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y origin of the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "width" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "rectangle width" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "height" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "rectangle height" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_handle" gtk_render_handle :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) CDouble -> -- x : TBasicType TDouble CDouble -> -- y : TBasicType TDouble CDouble -> -- width : TBasicType TDouble CDouble -> -- height : TBasicType TDouble IO () -- | Renders a handle (as in t'GI.Gtk.Objects.HandleBox.HandleBox', t'GI.Gtk.Objects.Paned.Paned' and -- t'GI.Gtk.Objects.Window.Window'’s resize grip), in the rectangle -- determined by /@x@/, /@y@/, /@width@/, /@height@/. -- -- Handles rendered for the paned and grip classes: -- -- <<https://developer.gnome.org/gtk3/stable/handles.png>> -- -- /Since: 3.0/ renderHandle :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> Double -- ^ /@x@/: X origin of the rectangle -> Double -- ^ /@y@/: Y origin of the rectangle -> Double -- ^ /@width@/: rectangle width -> Double -- ^ /@height@/: rectangle height -> m () renderHandle :: a -> Context -> Double -> Double -> Double -> Double -> m () renderHandle context :: a context cr :: Context cr x :: Double x y :: Double y width :: Double width height :: Double height = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr let x' :: CDouble x' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x let y' :: CDouble y' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y let width' :: CDouble width' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double width let height' :: CDouble height' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double height Ptr StyleContext -> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO () gtk_render_handle Ptr StyleContext context' Ptr Context cr' CDouble x' CDouble y' CDouble width' CDouble height' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_frame_gap -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X origin of the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y origin of the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "width" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "rectangle width" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "height" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "rectangle height" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "gap_side" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "PositionType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "side where the gap is" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xy0_gap" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "initial coordinate (X or Y depending on @gap_side) for the gap" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xy1_gap" -- , argType = TBasicType TDouble -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "end coordinate (X or Y depending on @gap_side) for the gap" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_render_frame_gap" gtk_render_frame_gap :: Ptr Gtk.StyleContext.StyleContext -> -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"}) Ptr Cairo.Context.Context -> -- cr : TInterface (Name {namespace = "cairo", name = "Context"}) CDouble -> -- x : TBasicType TDouble CDouble -> -- y : TBasicType TDouble CDouble -> -- width : TBasicType TDouble CDouble -> -- height : TBasicType TDouble CUInt -> -- gap_side : TInterface (Name {namespace = "Gtk", name = "PositionType"}) CDouble -> -- xy0_gap : TBasicType TDouble CDouble -> -- xy1_gap : TBasicType TDouble IO () {-# DEPRECATED renderFrameGap ["(Since version 3.24)","Use 'GI.Gtk.Functions.renderFrame' instead. Themes can create gaps"," by omitting borders via CSS."] #-} -- | Renders a frame around the rectangle defined by (/@x@/, /@y@/, /@width@/, /@height@/), -- leaving a gap on one side. /@xy0Gap@/ and /@xy1Gap@/ will mean X coordinates -- for 'GI.Gtk.Enums.PositionTypeTop' and 'GI.Gtk.Enums.PositionTypeBottom' gap sides, and Y coordinates for -- 'GI.Gtk.Enums.PositionTypeLeft' and 'GI.Gtk.Enums.PositionTypeRight'. -- -- Typical rendering of a frame with a gap: -- -- <<https://developer.gnome.org/gtk3/stable/frame-gap.png>> -- -- /Since: 3.0/ renderFrameGap :: (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) => a -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext' -> Cairo.Context.Context -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context' -> Double -- ^ /@x@/: X origin of the rectangle -> Double -- ^ /@y@/: Y origin of the rectangle -> Double -- ^ /@width@/: rectangle width -> Double -- ^ /@height@/: rectangle height -> Gtk.Enums.PositionType -- ^ /@gapSide@/: side where the gap is -> Double -- ^ /@xy0Gap@/: initial coordinate (X or Y depending on /@gapSide@/) for the gap -> Double -- ^ /@xy1Gap@/: end coordinate (X or Y depending on /@gapSide@/) for the gap -> m () renderFrameGap :: a -> Context -> Double -> Double -> Double -> Double -> PositionType -> Double -> Double -> m () renderFrameGap context :: a context cr :: Context cr x :: Double x y :: Double y width :: Double width height :: Double height gapSide :: PositionType gapSide xy0Gap :: Double xy0Gap xy1Gap :: Double xy1Gap = 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 StyleContext context' <- a -> IO (Ptr StyleContext) forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a context Ptr Context cr' <- Context -> IO (Ptr Context) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Context cr let x' :: CDouble x' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double x let y' :: CDouble y' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double y let width' :: CDouble width' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double width let height' :: CDouble height' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double height let gapSide' :: CUInt gapSide' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (PositionType -> Int) -> PositionType -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . PositionType -> Int forall a. Enum a => a -> Int fromEnum) PositionType gapSide let xy0Gap' :: CDouble xy0Gap' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double xy0Gap let xy1Gap' :: CDouble xy1Gap' = Double -> CDouble forall a b. (Real a, Fractional b) => a -> b realToFrac Double xy1Gap Ptr StyleContext -> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> CUInt -> CDouble -> CDouble -> IO () gtk_render_frame_gap Ptr StyleContext context' Ptr Context cr' CDouble x' CDouble y' CDouble width' CDouble height' CUInt gapSide' CDouble xy0Gap' CDouble xy1Gap' a -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a context Context -> IO () forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Context cr () -> IO () forall (m :: * -> *) a. Monad m => a -> m a return () -- function gtk_render_frame -- Args: [ Arg -- { argCName = "context" -- , argType = -- TInterface Name { namespace = "Gtk" , name = "StyleContext" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cr" -- , argType = -- TInterface Name { namespace = "cairo" , name = "Context" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TDouble