gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Functions

Contents

- Methods
  - acceleratorGetAccessibleLabel
  - acceleratorGetDefaultModMask
  - acceleratorGetLabel
  - acceleratorGetLabelWithKeycode
  - acceleratorName
  - acceleratorNameWithKeycode
  - acceleratorParse
  - acceleratorParseWithKeycode
  - acceleratorValid
  - checkVersion
  - cssParserErrorQuark
  - cssParserWarningQuark
  - disablePortalInterfaces
  - disablePortals
  - disableSetlocale
  - distributeNaturalAllocation
  - enumeratePrinters
  - getBinaryAge
  - getDebugFlags
  - getDefaultLanguage
  - getInterfaceAge
  - getLocaleDirection
  - getMajorVersion
  - getMicroVersion
  - getMinorVersion
  - hsvToRgb
  - init
  - initCheck
  - isInitialized
  - paramSpecExpression
  - printRunPageSetupDialog
  - printRunPageSetupDialogAsync
  - renderActivity
  - renderArrow
  - renderBackground
  - renderCheck
  - renderExpander
  - renderFocus
  - renderFrame
  - renderHandle
  - renderIcon
  - renderLayout
  - renderLine
  - renderOption
  - rgbToHsv
  - setDebugFlags
  - showUri
  - showUriFull
  - showUriFullFinish
  - testAccessibleAssertionMessageRole
  - testAccessibleHasProperty
  - testAccessibleHasRelation
  - testAccessibleHasRole
  - testAccessibleHasState
  - testListAllTypes
  - testRegisterAllTypes
  - testWidgetWaitForDraw
  - treeCreateRowDragContent
  - treeGetRowDragData
  - valueDupExpression
  - valueGetExpression
  - valueSetExpression
  - valueTakeExpression

Description

Synopsis

- acceleratorGetAccessibleLabel :: (HasCallStack, MonadIO m) => Word32 -> [ModifierType] -> m Text
- acceleratorGetDefaultModMask :: (HasCallStack, MonadIO m) => m [ModifierType]
- acceleratorGetLabel :: (HasCallStack, MonadIO m) => Word32 -> [ModifierType] -> m Text
- acceleratorGetLabelWithKeycode :: (HasCallStack, MonadIO m, IsDisplay a) => Maybe a -> Word32 -> Word32 -> [ModifierType] -> m Text
- acceleratorName :: (HasCallStack, MonadIO m) => Word32 -> [ModifierType] -> m Text
- acceleratorNameWithKeycode :: (HasCallStack, MonadIO m, IsDisplay a) => Maybe a -> Word32 -> Word32 -> [ModifierType] -> m Text
- acceleratorParse :: (HasCallStack, MonadIO m) => Text -> m (Bool, Word32, [ModifierType])
- acceleratorParseWithKeycode :: (HasCallStack, MonadIO m, IsDisplay a) => Text -> Maybe a -> m (Bool, Word32, [Word32], [ModifierType])
- acceleratorValid :: (HasCallStack, MonadIO m) => Word32 -> [ModifierType] -> m Bool
- checkVersion :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> Word32 -> m (Maybe Text)
- cssParserErrorQuark :: (HasCallStack, MonadIO m) => m Word32
- cssParserWarningQuark :: (HasCallStack, MonadIO m) => m Word32
- disablePortalInterfaces :: (HasCallStack, MonadIO m) => [Text] -> m ()
- disablePortals :: (HasCallStack, MonadIO m) => m ()
- disableSetlocale :: (HasCallStack, MonadIO m) => m ()
- distributeNaturalAllocation :: (HasCallStack, MonadIO m) => Int32 -> [RequestedSize] -> m Int32
- enumeratePrinters :: (HasCallStack, MonadIO m) => PrinterFunc -> Bool -> m ()
- getBinaryAge :: (HasCallStack, MonadIO m) => m Word32
- getDebugFlags :: (HasCallStack, MonadIO m) => m [DebugFlags]
- getDefaultLanguage :: (HasCallStack, MonadIO m) => m Language
- getInterfaceAge :: (HasCallStack, MonadIO m) => m Word32
- getLocaleDirection :: (HasCallStack, MonadIO m) => m TextDirection
- getMajorVersion :: (HasCallStack, MonadIO m) => m Word32
- getMicroVersion :: (HasCallStack, MonadIO m) => m Word32
- getMinorVersion :: (HasCallStack, MonadIO m) => m Word32
- hsvToRgb :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> m (Float, Float, Float)
- init :: (HasCallStack, MonadIO m) => m ()
- initCheck :: (HasCallStack, MonadIO m) => m Bool
- isInitialized :: (HasCallStack, MonadIO m) => m Bool
- paramSpecExpression :: (HasCallStack, MonadIO m) => Text -> Text -> Text -> [ParamFlags] -> m GParamSpec
- printRunPageSetupDialog :: (HasCallStack, MonadIO m, IsWindow a, IsPageSetup b, IsPrintSettings c) => Maybe a -> Maybe b -> c -> m PageSetup
- printRunPageSetupDialogAsync :: (HasCallStack, MonadIO m, IsWindow a, IsPageSetup b, IsPrintSettings c) => Maybe a -> Maybe b -> c -> PageSetupDoneFunc -> m ()
- renderActivity :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderArrow :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderBackground :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderCheck :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderExpander :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderFocus :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderFrame :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderHandle :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderIcon :: (HasCallStack, MonadIO m, IsStyleContext a, IsTexture b) => a -> Context -> b -> Double -> Double -> m ()
- renderLayout :: (HasCallStack, MonadIO m, IsStyleContext a, IsLayout b) => a -> Context -> Double -> Double -> b -> m ()
- renderLine :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- renderOption :: (HasCallStack, MonadIO m, IsStyleContext a) => a -> Context -> Double -> Double -> Double -> Double -> m ()
- rgbToHsv :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> m (Float, Float, Float)
- setDebugFlags :: (HasCallStack, MonadIO m) => [DebugFlags] -> m ()
- showUri :: (HasCallStack, MonadIO m, IsWindow a) => Maybe a -> Text -> Word32 -> m ()
- showUriFull :: (HasCallStack, MonadIO m, IsWindow a, IsCancellable b) => Maybe a -> Text -> Word32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- showUriFullFinish :: (HasCallStack, MonadIO m, IsWindow a, IsAsyncResult b) => a -> b -> m ()
- testAccessibleAssertionMessageRole :: (HasCallStack, MonadIO m, IsAccessible a) => Text -> Text -> Int32 -> Text -> Text -> a -> AccessibleRole -> AccessibleRole -> m ()
- testAccessibleHasProperty :: (HasCallStack, MonadIO m, IsAccessible a) => a -> AccessibleProperty -> m Bool
- testAccessibleHasRelation :: (HasCallStack, MonadIO m, IsAccessible a) => a -> AccessibleRelation -> m Bool
- testAccessibleHasRole :: (HasCallStack, MonadIO m, IsAccessible a) => a -> AccessibleRole -> m Bool
- testAccessibleHasState :: (HasCallStack, MonadIO m, IsAccessible a) => a -> AccessibleState -> m Bool
- testListAllTypes :: (HasCallStack, MonadIO m) => m ([GType], Word32)
- testRegisterAllTypes :: (HasCallStack, MonadIO m) => m ()
- testWidgetWaitForDraw :: (HasCallStack, MonadIO m, IsWidget a) => a -> m ()
- treeCreateRowDragContent :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreePath -> m ContentProvider
- treeGetRowDragData :: (HasCallStack, MonadIO m) => GValue -> m (Bool, Maybe TreeModel, Maybe TreePath)
- valueDupExpression :: (HasCallStack, MonadIO m) => GValue -> m (Maybe Expression)
- valueGetExpression :: (HasCallStack, MonadIO m) => GValue -> m (Maybe Expression)
- valueSetExpression :: (HasCallStack, MonadIO m, IsExpression a) => GValue -> a -> m ()
- valueTakeExpression :: (HasCallStack, MonadIO m, IsExpression a) => GValue -> Maybe a -> m ()

# Methods

## acceleratorGetAccessibleLabel

acceleratorGetAccessibleLabel Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Word32 | `acceleratorKey`: accelerator keyval
-> [ModifierType] | `acceleratorMods`: accelerator modifier mask
-> m Text | Returns: a newly-allocated string representing the accelerator

Generates an accessible description of an accelerator.

This function is similar to `acceleratorGetLabel` but it is meant for accessibility layers labels rather than user-facing labels. The output of this function is fit for `AccessiblePropertyKeyShortcuts`.

For more information, see the WAI-ARIA reference.

Since: 4.22

## acceleratorGetDefaultModMask

acceleratorGetDefaultModMask Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m [ModifierType] | Returns: the modifier mask for accelerators

Gets the modifier mask.

The modifier mask determines which modifiers are considered significant for keyboard accelerators. This includes all keyboard modifiers except for `GDK_LOCK_MASK`.

## acceleratorGetLabel

acceleratorGetLabel Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Word32 | `acceleratorKey`: accelerator keyval
-> [ModifierType] | `acceleratorMods`: accelerator modifier mask
-> m Text | Returns: a newly-allocated string representing the accelerator

Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.

## acceleratorGetLabelWithKeycode

acceleratorGetLabelWithKeycode Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> Maybe a | `display`: a `GdkDisplay`
-> Word32 | `acceleratorKey`: accelerator keyval
-> Word32 | `keycode`: accelerator keycode
-> [ModifierType] | `acceleratorMods`: accelerator modifier mask
-> m Text | Returns: a newly-allocated string representing the accelerator

Converts an accelerator keyval and modifier mask into a string that can be displayed to the user.

The string may be translated.

This function is similar to `acceleratorGetLabel`, but handling keycodes. This is only useful for system-level components, applications should use `acceleratorGetLabel` instead.

## acceleratorName

acceleratorName Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Word32 | `acceleratorKey`: accelerator keyval
-> [ModifierType] | `acceleratorMods`: accelerator modifier mask
-> m Text | Returns: a newly-allocated accelerator name

Converts an accelerator keyval and modifier mask into a string that can be parsed by `acceleratorParse`.

For example, if you pass in `GDK_KEY_q` and `GDK_CONTROL_MASK`, this function returns `<Control>q`.

If you need to display accelerators in the user interface, see `acceleratorGetLabel`.

## acceleratorNameWithKeycode

acceleratorNameWithKeycode Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> Maybe a | `display`: a `GdkDisplay`
-> Word32 | `acceleratorKey`: accelerator keyval
-> Word32 | `keycode`: accelerator keycode
-> [ModifierType] | `acceleratorMods`: accelerator modifier mask
-> m Text | Returns: a newly allocated accelerator name.

Converts an accelerator keyval and modifier mask into a string that can be parsed by `acceleratorParseWithKeycode`.

This is similar to `acceleratorName` but handling keycodes. This is only useful for system-level components, applications should use `acceleratorName` instead.

## acceleratorParse

acceleratorParse Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `accelerator`: string representing an accelerator
-> m (Bool, Word32, [ModifierType]) | Returns: whether parsing succeeded

Parses a string representing an accelerator.

The format looks like “`<Control>a`” or “`<Shift><Alt>F1`”.

The parser is fairly liberal and allows lower or upper case, and also abbreviations such as “`<Ctl>`” and “`<Ctrl>`”.

Key names are parsed using `keyvalFromName`. For character keys the name is not the symbol, but the lowercase name, e.g. one would use “`<Ctrl>minus`” instead of “`<Ctrl>-`”.

Modifiers are enclosed in angular brackets `<>`, and match the [flags`gdk`.ModifierType] mask:

- `<Shift>` for `GDK_SHIFT_MASK`
- `<Ctrl>` for `GDK_CONTROL_MASK`
- `<Alt>` for `GDK_ALT_MASK`
- `<Meta>` for `GDK_META_MASK`
- `<Super>` for `GDK_SUPER_MASK`
- `<Hyper>` for `GDK_HYPER_MASK`

If the parse operation fails, `acceleratorKey` and `acceleratorMods` will be set to 0 (zero).

## acceleratorParseWithKeycode

acceleratorParseWithKeycode Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> Text | `accelerator`: string representing an accelerator
-> Maybe a | `display`: the `GdkDisplay` to look up `acceleratorCodes` in
-> m (Bool, Word32, [Word32], [ModifierType]) | Returns: true if parsing succeeded

Parses a string representing an accelerator.

This is similar to `acceleratorParse` but handles keycodes as well. This is only useful for system-level components, applications should use `acceleratorParse` instead.

If `acceleratorCodes` is given and the result stored in it is non-`Nothing`, the result must be freed with `free`.

If a keycode is present in the accelerator and no `acceleratorCodes` is given, the parse will fail.

If the parse fails, `acceleratorKey`, `acceleratorMods` and `acceleratorCodes` will be set to 0 (zero).

## acceleratorValid

acceleratorValid Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Word32 | `keyval`: a GDK keyval
-> [ModifierType] | `modifiers`: modifier mask
-> m Bool | Returns: true if the accelerator is valid

Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.

For example, the `GDK_KEY_a` keyval plus `GDK_CONTROL_MASK` mask is valid, and matches the “Ctrl+a” accelerator. But, you can't, for instance, use the `GDK_KEY_Control_L` keyval as an accelerator.

## checkVersion

checkVersion Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Word32 | `requiredMajor`: the required major version
-> Word32 | `requiredMinor`: the required minor version
-> Word32 | `requiredMicro`: the required micro version
-> m (Maybe Text) | Returns: `Nothing` if the GTK library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by GTK and should not be modified or freed.

Checks that the GTK library in use is compatible with the given version.

Generally you would pass in the constants `MAJOR_VERSION`, `MINOR_VERSION`, `MICRO_VERSION` as the three arguments to this function; that produces a check that the library in use is compatible with the version of GTK the application or module was compiled against.

Compatibility is defined by two things: first the version of the running library is newer than the version `requiredMajor`.required_minor.`requiredMicro`. Second the running library must be binary compatible with the version `requiredMajor`.required_minor.`requiredMicro` (same major version.)

This function is primarily for GTK modules; the module can call this function to check that it wasn’t loaded into an incompatible version of GTK. However, such a check isn’t completely reliable, since the module may be linked against an old version of GTK and calling the old version of `checkVersion`, but still get loaded into an application using a newer version of GTK.

## cssParserErrorQuark

cssParserErrorQuark Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Word32 | Returns: the error quark

Registers an error quark for CSS parsing errors.

## cssParserWarningQuark

cssParserWarningQuark Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Word32 | Returns: the warning quark

Registers an error quark for CSS parsing warnings.

## disablePortalInterfaces

disablePortalInterfaces Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> [Text] | `portalInterfaces`: a `Nothing`-terminated array of portal interface names to disable
-> m () |

Prevents GTK from using the specified portals.

This should only be used in portal implementations, apps must not call it.

Since: 4.22

## disablePortals

disablePortals :: (HasCallStack, MonadIO m) => m () Source #

Prevents GTK from using portals.

This is equivalent to setting `GDK_DEBUG=no-portals` in the environment.

This should only be used in portal implementations, apps must not call it.

Since: 4.18

## disableSetlocale

disableSetlocale :: (HasCallStack, MonadIO m) => m () Source #

Prevents `init` and `initCheck` from calling `setlocale()`.

You would want to use this function if you wanted to set the locale for your program to something other than the user’s locale, or if you wanted to set different values for different locale categories.

Most programs should not need to call this function.

## distributeNaturalAllocation

distributeNaturalAllocation Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Int32 | `extraSpace`: Extra space to redistribute among children after subtracting minimum sizes and any child padding from the overall allocation
-> [RequestedSize] | `sizes`: An array of structs with a client pointer and a minimum/natural size in the orientation of the allocation.
-> m Int32 | Returns: The remainder of `extraSpace` after redistributing space to `sizes`.

Distributes `extraSpace` to child `sizes` by bringing smaller children up to natural size first.

The remaining space will be added to the `minimumSize` member of the `GtkRequestedSize` struct. If all sizes reach their natural size then the remaining space is returned.

## enumeratePrinters

enumeratePrinters Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> PrinterFunc | `func`: a function to call for each printer
-> Bool | `wait`: if true, wait in a recursive mainloop until all printers are enumerated; otherwise return early
-> m () |

Calls a function for all printers that are known to GTK.

If `func` returns true, the enumeration is stopped.

## getBinaryAge

getBinaryAge Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Word32 | Returns: the binary age of the GTK library

Returns the binary age as passed to `libtool`.

If `libtool` means nothing to you, don't worry about it.

## getDebugFlags

getDebugFlags Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m [DebugFlags] | Returns: the GTK debug flags.

Returns the GTK debug flags that are currently active.

This function is intended for GTK modules that want to adjust their debug output based on GTK debug flags.

## getDefaultLanguage

getDefaultLanguage Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Language | Returns: the default language

Returns the `PangoLanguage` for the default language currently in effect.

Note that this can change over the life of an application.

The default language is derived from the current locale. It determines, for example, whether GTK uses the right-to-left or left-to-right text direction.

This function is equivalent to `languageGetDefault`. See that function for details.

## getInterfaceAge

getInterfaceAge Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Word32 | Returns: the interface age of the GTK library

Returns the interface age as passed to `libtool`.

If `libtool` means nothing to you, don't worry about it.

## getLocaleDirection

getLocaleDirection Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m TextDirection | Returns: the direction of the current locale

Gets the direction of the current locale.

This is the expected reading direction for text and UI.

This function depends on the current locale being set with `setlocale()` and will default to setting the `GTK_TEXT_DIR_LTR` direction otherwise. `GTK_TEXT_DIR_NONE` will never be returned.

GTK sets the default text direction according to the locale during `init`, and you should normally use `widgetGetDirection` or `widgetGetDefaultDirection` to obtain the current direction.

This function is only needed rare cases when the locale is changed after GTK has already been initialized. In this case, you can use it to update the default text direction as follows:

### c code

    #include <locale.h>

    static void
    update_locale (const char *new_locale)
    {
      setlocale (LC_ALL, new_locale);
      gtk_widget_set_default_direction (gtk_get_locale_direction ());
    }

## getMajorVersion

getMajorVersion Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Word32 | Returns: the major version number of the GTK library

Returns the major version number of the GTK library.

For example, in GTK version 3.1.5 this is 3.

This function is in the library, so it represents the GTK library your code is running against. Contrast with the `MAJOR_VERSION` macro, which represents the major version of the GTK headers you have included when compiling your code.

## getMicroVersion

getMicroVersion Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Word32 | Returns: the micro version number of the GTK library

Returns the micro version number of the GTK library.

For example, in GTK version 3.1.5 this is 5.

This function is in the library, so it represents the GTK library your code is are running against. Contrast with the `MICRO_VERSION` macro, which represents the micro version of the GTK headers you have included when compiling your code.

## getMinorVersion

getMinorVersion Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Word32 | Returns: the minor version number of the GTK library

Returns the minor version number of the GTK library.

For example, in GTK version 3.1.5 this is 1.

This function is in the library, so it represents the GTK library your code is are running against. Contrast with the `MINOR_VERSION` macro, which represents the minor version of the GTK headers you have included when compiling your code.

## hsvToRgb

hsvToRgb Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Float | `h`: Hue
-> Float | `s`: Saturation
-> Float | `v`: Value
-> m (Float, Float, Float) |

Converts a color from HSV space to RGB.

Input values must be in the [0.0, 1.0] range; output values will be in the same range.

## init

init :: (HasCallStack, MonadIO m) => m () Source #

Initializes GTK.

This function must be called before using any other GTK functions in your GUI applications.

It will initialize everything needed to operate the toolkit. In particular, it will open the default display (see `displayGetDefault`).

If you are using `Application`, you usually don't have to call this function; the `Application`.`startup`() handler does it for you. Though, if you are using `GApplication` methods that will be invoked before `startup`, such as `local_command_line`, you may need to initialize GTK explicitly.

This function will terminate your program if it was unable to initialize the windowing system for some reason. If you want your program to fall back to a textual interface, call `initCheck` instead.

GTK calls `signal (SIGPIPE, SIG_IGN)` during initialization, to ignore SIGPIPE signals, since these are almost never wanted in graphical applications. If you do need to handle SIGPIPE for some reason, reset the handler after `init`, but notice that other libraries (e.g. libdbus or gvfs) might do similar things.

## initCheck

initCheck Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Bool | Returns: true if the windowing system has been successfully initialized, false otherwise

Initializes GTK.

This function does the same work as `init` with only a single change: It does not terminate the program if the windowing system can’t be initialized. Instead it returns false on failure.

This way the application can fall back to some other means of communication with the user - for example a curses or command line interface.

## isInitialized

isInitialized Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Bool | Returns: the initialization status

Returns whether GTK has been initialized.

See `init`.

## paramSpecExpression

paramSpecExpression Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `name`: canonical name of the property
-> Text | `nick`: a user-readable name for the property
-> Text | `blurb`: a user-readable description of the property
-> [ParamFlags] | `flags`: flags for the property
-> m GParamSpec | Returns: a newly created property specification

Creates a new `GParamSpec` instance for a property holding a `GtkExpression`.

See `g_param_spec_internal()` for details on the property strings.

## printRunPageSetupDialog

printRunPageSetupDialog Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindow a, IsPageSetup b, IsPrintSettings c) |
=> Maybe a | `parent`: transient parent
-> Maybe b | `pageSetup`: an existing `GtkPageSetup`
-> c | `settings`: a `GtkPrintSettings`
-> m PageSetup | Returns: a new `GtkPageSetup`

Runs a page setup dialog, letting the user modify the values from `pageSetup`.

If the user cancels the dialog, the returned `GtkPageSetup` is identical to the passed in `pageSetup`, otherwise it contains the modifications done in the dialog.

Note that this function may use a recursive mainloop to show the page setup dialog. See `printRunPageSetupDialogAsync` if this is a problem.

## printRunPageSetupDialogAsync

printRunPageSetupDialogAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindow a, IsPageSetup b, IsPrintSettings c) |
=> Maybe a | `parent`: transient parent
-> Maybe b | `pageSetup`: an existing `GtkPageSetup`
-> c | `settings`: a `GtkPrintSettings`
-> PageSetupDoneFunc | `doneCb`: a function to call when the user saves the modified page setup
-> m () |

Runs a page setup dialog, letting the user modify the values from `pageSetup`.

In contrast to `printRunPageSetupDialog`, this function returns after showing the page setup dialog on platforms that support this, and calls `doneCb` from a signal handler for the response signal of the dialog.

## renderActivity

renderActivity Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin of the rectangle
-> Double | `y`: Y origin of the rectangle
-> Double | `width`: rectangle width
-> Double | `height`: rectangle height
-> m () |

Deprecated: (Since version 4.10)

Renders an activity indicator (such as in `GtkSpinner`). The state `StateFlagsChecked` determines whether there is activity going on.

## renderArrow

renderArrow Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `angle`: arrow angle from 0 to 2 * `PI`, being 0 the arrow pointing to the north
-> Double | `x`: X origin of the render area
-> Double | `y`: Y origin of the render area
-> Double | `size`: square side for render area
-> m () |

Deprecated: (Since version 4.10)

Renders an arrow pointing to `angle`.

Typical arrow rendering at 0, 1⁄2 π;, π; and 3⁄2 π:

## renderBackground

renderBackground Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin of the rectangle
-> Double | `y`: Y origin of the rectangle
-> Double | `width`: rectangle width
-> Double | `height`: rectangle height
-> m () |

Deprecated: (Since version 4.10)

Renders the background of an element.

Typical background rendering, showing the effect of `background-image`, `border-width` and `border-radius`:

## renderCheck

renderCheck Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin of the rectangle
-> Double | `y`: Y origin of the rectangle
-> Double | `width`: rectangle width
-> Double | `height`: rectangle height
-> m () |

Deprecated: (Since version 4.10)

Renders a checkmark (as in a `GtkCheckButton`).

The `StateFlagsChecked` state determines whether the check is on or off, and `StateFlagsInconsistent` determines whether it should be marked as undefined.

Typical checkmark rendering:

## renderExpander

renderExpander Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin of the rectangle
-> Double | `y`: Y origin of the rectangle
-> Double | `width`: rectangle width
-> Double | `height`: rectangle height
-> m () |

Deprecated: (Since version 4.10)

Renders an expander (as used in `GtkTreeView` and `GtkExpander`) in the area defined by `x`, `y`, `width`, `height`. The state `StateFlagsChecked` determines whether the expander is collapsed or expanded.

Typical expander rendering:

## renderFocus

renderFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin of the rectangle
-> Double | `y`: Y origin of the rectangle
-> Double | `width`: rectangle width
-> Double | `height`: rectangle height
-> m () |

Deprecated: (Since version 4.10)

Renders a focus indicator on the rectangle determined by `x`, `y`, `width`, `height`.

Typical focus rendering:

## renderFrame

renderFrame Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin of the rectangle
-> Double | `y`: Y origin of the rectangle
-> Double | `width`: rectangle width
-> Double | `height`: rectangle height
-> m () |

Deprecated: (Since version 4.10)

Renders a frame around the rectangle defined by `x`, `y`, `width`, `height`.

Examples of frame rendering, showing the effect of `border-image`, `border-color`, `border-width`, `border-radius` and junctions:

## renderHandle

renderHandle Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin of the rectangle
-> Double | `y`: Y origin of the rectangle
-> Double | `width`: rectangle width
-> Double | `height`: rectangle height
-> m () |

Deprecated: (Since version 4.10)

Renders a handle (as in `GtkPaned` and `GtkWindow`’s resize grip), in the rectangle determined by `x`, `y`, `width`, `height`.

Handles rendered for the paned and grip classes:

## renderIcon

renderIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a, IsTexture b) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> b | `texture`: a `GdkTexture` containing the icon to draw
-> Double | `x`: X position for the `texture`
-> Double | `y`: Y position for the `texture`
-> m () |

Deprecated: (Since version 4.10)

Renders the icon in `texture` at the specified `x` and `y` coordinates.

This function will render the icon in `texture` at exactly its size, regardless of scaling factors, which may not be appropriate when drawing on displays with high pixel densities.

## renderLayout

renderLayout Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a, IsLayout b) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin
-> Double | `y`: Y origin
-> b | `layout`: the `PangoLayout` to render
-> m () |

Deprecated: (Since version 4.10)

Renders `layout` on the coordinates `x`, `y`

## renderLine

renderLine Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> 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 () |

Deprecated: (Since version 4.10)

Renders a line from (x0, y0) to (x1, y1).

## renderOption

renderOption Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleContext a) |
=> a | `context`: a `GtkStyleContext`
-> Context | `cr`: a `cairo_t`
-> Double | `x`: X origin of the rectangle
-> Double | `y`: Y origin of the rectangle
-> Double | `width`: rectangle width
-> Double | `height`: rectangle height
-> m () |

Deprecated: (Since version 4.10)

Renders an option mark (as in a radio button), the `StateFlagsChecked` state will determine whether the option is on or off, and `StateFlagsInconsistent` whether it should be marked as undefined.

Typical option mark rendering:

## rgbToHsv

rgbToHsv Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Float | `r`: Red
-> Float | `g`: Green
-> Float | `b`: Blue
-> m (Float, Float, Float) |

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.

## setDebugFlags

setDebugFlags Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> [DebugFlags] | `flags`: the debug flags to set
-> m () |

Sets the GTK debug flags.

## showUri

showUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindow a) |
=> Maybe a | `parent`: parent window
-> Text | `uri`: the uri to show
-> Word32 | `timestamp`: timestamp from the event that triggered this call, or `CURRENT_TIME`
-> m () |

Deprecated: (Since version 4.10)Use `fileLauncherLaunch` or`uriLauncherLaunch` instead

This function launches the default application for showing a given uri, or shows an error dialog if that fails.

## showUriFull

showUriFull Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindow a, IsCancellable b) |
=> Maybe a | `parent`: parent window
-> Text | `uri`: the uri to show
-> Word32 | `timestamp`: timestamp from the event that triggered this call, or `CURRENT_TIME`
-> Maybe b | `cancellable`: a `GCancellable` to cancel the launch
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the action is complete
-> m () |

Deprecated: (Since version 4.10)Use `fileLauncherLaunch` or`uriLauncherLaunch` instead

This function launches the default application for showing a given uri.

The `callback` will be called when the launch is completed.

This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly.

## showUriFullFinish

showUriFullFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindow a, IsAsyncResult b) |
=> a | `parent`: the `GtkWindow` passed to `showUri`
-> b | `result`: `GAsyncResult` that was passed to `callback`
-> m () | (Can throw `GError`)

Deprecated: (Since version 4.10)Use `fileLauncherLaunch` or`uriLauncherLaunch` instead

Finishes the `showUri` call and returns the result of the operation.

## testAccessibleAssertionMessageRole

testAccessibleAssertionMessageRole Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) |
=> Text | `domain`: a domain
-> Text | `file`: a file name
-> Int32 | `line`: the line in `file`
-> Text | `func`: a function name in `file`
-> Text | `expr`: the expression being tested
-> a | `accessible`: a `GtkAccessible`
-> AccessibleRole | `expectedRole`: the expected `GtkAccessibleRole`
-> AccessibleRole | `actualRole`: the actual `GtkAccessibleRole`
-> m () |

Prints an assertion message for `gtk_test_accessible_assert_role()`.

## testAccessibleHasProperty

testAccessibleHasProperty Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) |
=> a | `accessible`: a `GtkAccessible`
-> AccessibleProperty | `property`: a `GtkAccessibleProperty`
-> m Bool | Returns: `True` if the `property` is set in the `accessible`

Checks whether the `GtkAccessible` has `property` set.

## testAccessibleHasRelation

testAccessibleHasRelation Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) |
=> a | `accessible`: a `GtkAccessible`
-> AccessibleRelation | `relation`: a `GtkAccessibleRelation`
-> m Bool | Returns: `True` if the `relation` is set in the `accessible`

Checks whether the `GtkAccessible` has `relation` set.

## testAccessibleHasRole

testAccessibleHasRole Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) |
=> a | `accessible`: a `GtkAccessible`
-> AccessibleRole | `role`: a `GtkAccessibleRole`
-> m Bool | Returns: `True` if the role matches

Checks whether the `GtkAccessible:accessible-role` of the accessible is `role`.

## testAccessibleHasState

testAccessibleHasState Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) |
=> a | `accessible`: a `GtkAccessible`
-> AccessibleState | `state`: a `GtkAccessibleState`
-> m Bool | Returns: `True` if the `state` is set in the `accessible`

Checks whether the `GtkAccessible` has `state` set.

## testListAllTypes

testListAllTypes Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m ([GType], Word32) | Returns: 0-terminated array of type ids

Return the type ids that have been registered after calling `testRegisterAllTypes`.

## testRegisterAllTypes

testRegisterAllTypes :: (HasCallStack, MonadIO m) => m () Source #

Force registration of all core GTK object types.

This allows to refer to any of those object types via `typeFromName` after calling this function.

## testWidgetWaitForDraw

testWidgetWaitForDraw Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a) |
=> a | `widget`: the widget to wait for
-> m () |

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.

## treeCreateRowDragContent

treeCreateRowDragContent Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeModel a) |
=> a | `treeModel`: a `GtkTreeModel`
-> TreePath | `path`: a row in `treeModel`
-> m ContentProvider | Returns: a new `GdkContentProvider`

Deprecated: (Since version 4.10)Use list models instead

Creates a content provider for dragging `path` from `treeModel`.

## treeGetRowDragData

treeGetRowDragData Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GValue | `value`: a `GValue`
-> m (Bool, Maybe TreeModel, Maybe TreePath) | Returns: `True` if `selectionData` had target type `GTK_TYPE_TREE_ROW_DATA` is otherwise valid

Deprecated: (Since version 4.10)Use list models instead

Obtains a `treeModel` and `path` from value of target type `GTK_TYPE_TREE_ROW_DATA`.

The returned path must be freed with `treePathFree`.

## valueDupExpression

valueDupExpression Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GValue | `value`: a `GValue` initialized with type `GTK_TYPE_EXPRESSION`
-> m (Maybe Expression) | Returns: a `GtkExpression`

Retrieves the `GtkExpression` stored inside the given `value`, and acquires a reference to it.

## valueGetExpression

valueGetExpression Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GValue | `value`: a `GValue` initialized with type `GTK_TYPE_EXPRESSION`
-> m (Maybe Expression) | Returns: a `GtkExpression`

Retrieves the `GtkExpression` stored inside the given `value`.

## valueSetExpression

valueSetExpression Source #

Arguments

:: (HasCallStack, MonadIO m, IsExpression a) |
=> GValue | `value`: a `GValue` initialized with type `GTK_TYPE_EXPRESSION`
-> a | `expression`: a `GtkExpression`
-> m () |

Stores the given `GtkExpression` inside `value`.

The `GValue` will acquire a reference to the `expression`.

## valueTakeExpression

valueTakeExpression Source #

Arguments

:: (HasCallStack, MonadIO m, IsExpression a) |
=> GValue | `value`: a `GValue` initialized with type `GTK_TYPE_EXPRESSION`
-> Maybe a | `expression`: a `GtkExpression`
-> m () |

Stores the given `GtkExpression` inside `value`.

This function transfers the ownership of the `expression` to the `GValue`.