Functions

The following functions are available globally.

  • Convenience constructor for an application reference

    Declaration

    Swift

    @inlinable
    public func App(_ p: gpointer!) -> ApplicationRef

    Parameters

    p

    gpointer to the running app

    Return Value

    ApplicationRef wrapper for the pointer

  • 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.

    Declaration

    Swift

    @inlinable
    public func acceleratorGetDefaultModMask() -> Gdk.ModifierType
  • Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.

    Declaration

    Swift

    @inlinable
    public func acceleratorGetLabel(acceleratorKey: Int, acceleratorMods: Gdk.ModifierType) -> String!
  • 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 [funcGtk.accelerator_get_label], but handling keycodes. This is only useful for system-level components, applications should use [funcGtk.accelerator_get_label] instead.

    Declaration

    Swift

    @inlinable
    public func acceleratorGetLabelWithKeycode(display: Gdk.DisplayRef? = nil, acceleratorKey: Int, keycode: Int, acceleratorMods: Gdk.ModifierType) -> String!
  • 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 [funcGtk.accelerator_get_label], but handling keycodes. This is only useful for system-level components, applications should use [funcGtk.accelerator_get_label] instead.

    Declaration

    Swift

    @inlinable
    public func acceleratorGetLabelWithKeycode<DisplayT>(display: DisplayT?, acceleratorKey: Int, keycode: Int, acceleratorMods: Gdk.ModifierType) -> String! where DisplayT : DisplayProtocol
  • Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse().

    For example, if you pass in GDK_KEY_q and GDK_CONTROL_MASK, this function returns &lt;Control&gt;q.

    If you need to display accelerators in the user interface, see [funcGtk.accelerator_get_label].

    Declaration

    Swift

    @inlinable
    public func acceleratorName(acceleratorKey: Int, acceleratorMods: Gdk.ModifierType) -> String!
  • Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse_with_keycode().

    This is similar to [funcGtk.accelerator_name] but handling keycodes. This is only useful for system-level components, applications should use [funcGtk.accelerator_name] instead.

    Declaration

    Swift

    @inlinable
    public func acceleratorNameWithKeycode(display: Gdk.DisplayRef? = nil, acceleratorKey: Int, keycode: Int, acceleratorMods: Gdk.ModifierType) -> String!
  • Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse_with_keycode().

    This is similar to [funcGtk.accelerator_name] but handling keycodes. This is only useful for system-level components, applications should use [funcGtk.accelerator_name] instead.

    Declaration

    Swift

    @inlinable
    public func acceleratorNameWithKeycode<DisplayT>(display: DisplayT?, acceleratorKey: Int, keycode: Int, acceleratorMods: Gdk.ModifierType) -> String! where DisplayT : DisplayProtocol
  • Parses a string representing an accelerator.

    The format looks like “&lt;Control&gt;a” or “&lt;Shift&gt;&lt;Alt&gt;F1”.

    The parser is fairly liberal and allows lower or upper case, and also abbreviations such as “&lt;Ctl&gt;” and “&lt;Ctrl&gt;”.

    Key names are parsed using [funcGdk.keyval_from_name]. For character keys the name is not the symbol, but the lowercase name, e.g. one would use “&lt;Ctrl&gt;minus” instead of “&lt;Ctrl&gt;-”.

    Modifiers are enclosed in angular brackets &lt;&gt;, and match the [enumGdk.ModifierType] mask:

    • &lt;Shift&gt; for GDK_SHIFT_MASK
    • &lt;Ctrl&gt; for GDK_CONTROL_MASK
    • &lt;Alt&gt; for GDK_ALT_MASK
    • &lt;Meta&gt; for GDK_META_MASK
    • &lt;Super&gt; for GDK_SUPER_MASK
    • &lt;Hyper&gt; for GDK_HYPER_MASK

    If the parse operation fails, accelerator_key and accelerator_mods will be set to 0 (zero).

    Declaration

    Swift

    @inlinable
    public func acceleratorParse(accelerator: UnsafePointer<CChar>!, acceleratorKey: UnsafeMutablePointer<guint>! = nil, acceleratorMods: UnsafeMutablePointer<GdkModifierType>! = nil) -> Bool
  • Parses a string representing an accelerator.

    This is similar to [funcGtk.accelerator_parse] but handles keycodes as well. This is only useful for system-level components, applications should use [funcGtk.accelerator_parse] instead.

    If accelerator_codes is given and the result stored in it is non-nil, the result must be freed with g_free().

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

    If the parse fails, accelerator_key, accelerator_mods and accelerator_codes will be set to 0 (zero).

    Declaration

    Swift

    @inlinable
    public func acceleratorParseWithKeycode(accelerator: UnsafePointer<CChar>!, display: Gdk.DisplayRef? = nil, acceleratorKey: UnsafeMutablePointer<guint>! = nil, acceleratorCodes: UnsafeMutablePointer<UnsafeMutablePointer<guint>?>! = nil, acceleratorMods: UnsafeMutablePointer<GdkModifierType>! = nil) -> Bool
  • Parses a string representing an accelerator.

    This is similar to [funcGtk.accelerator_parse] but handles keycodes as well. This is only useful for system-level components, applications should use [funcGtk.accelerator_parse] instead.

    If accelerator_codes is given and the result stored in it is non-nil, the result must be freed with g_free().

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

    If the parse fails, accelerator_key, accelerator_mods and accelerator_codes will be set to 0 (zero).

    Declaration

    Swift

    @inlinable
    public func acceleratorParseWithKeycode<DisplayT>(accelerator: UnsafePointer<CChar>!, display: DisplayT?, acceleratorKey: UnsafeMutablePointer<guint>! = nil, acceleratorCodes: UnsafeMutablePointer<UnsafeMutablePointer<guint>?>! = nil, acceleratorMods: UnsafeMutablePointer<GdkModifierType>! = nil) -> Bool where DisplayT : DisplayProtocol
  • Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.

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

    Declaration

    Swift

    @inlinable
    public func acceleratorValid(keyval: Int, modifiers: Gdk.ModifierType) -> Bool
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func accessiblePropertyInitValue<ValueT>(property: GtkAccessibleProperty, value: ValueT) where ValueT : ValueProtocol
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func accessibleRelationInitValue<ValueT>(relation: GtkAccessibleRelation, value: ValueT) where ValueT : ValueProtocol
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func accessibleStateInitValue<ValueT>(state: GtkAccessibleState, value: ValueT) where ValueT : ValueProtocol
  • Initializes iter to point to target.

    If target is not found, finds the next value after it. If no value >= target exists in set, this function returns false.

    Declaration

    Swift

    @inlinable
    public func bitsetIterInitAt<BitsetIterT, BitsetT>(iter: BitsetIterT, set: BitsetT, target: Int, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetIterT : BitsetIterProtocol, BitsetT : BitsetProtocol
  • Initializes an iterator for set and points it to the first value in set.

    If set is empty, false is returned and value is set to G_MAXUINT.

    Declaration

    Swift

    @inlinable
    public func bitsetIterInitFirst<BitsetIterT, BitsetT>(iter: BitsetIterT, set: BitsetT, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetIterT : BitsetIterProtocol, BitsetT : BitsetProtocol
  • Initializes an iterator for set and points it to the last value in set.

    If set is empty, false is returned.

    Declaration

    Swift

    @inlinable
    public func bitsetIterInitLast<BitsetIterT, BitsetT>(iter: BitsetIterT, set: BitsetT, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetIterT : BitsetIterProtocol, BitsetT : BitsetProtocol
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func builderErrorQuark() -> GQuark
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func constraintVflParserErrorQuark() -> GQuark
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func cssParserErrorQuark() -> GQuark
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func cssParserWarningQuark() -> GQuark
  • Prevents [idgtk_init] and [idgtk_init_check] from automatically calling setlocale (LC_ALL, "").

    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.

    Declaration

    Swift

    @inlinable
    public func disableSetlocale()
  • Distributes extra_space to child sizes by bringing smaller children up to natural size first.

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

    Declaration

    Swift

    @inlinable
    public func distributeNaturalAllocation(extraSpace: Int, nRequestedSizes: Int, sizes: UnsafeMutablePointer<GtkRequestedSize>!) -> Int
  • Gets a property of the GtkEditable delegate for object.

    This is helper function that should be called in the get_property function of your GtkEditable implementation, before handling your own properties.

    Declaration

    Swift

    @inlinable
    public func editableDelegateGetProperty<ObjectT, ParamSpecT, ValueT>(object: ObjectT, propId: Int, value: ValueT, pspec: ParamSpecT) -> Bool where ObjectT : ObjectProtocol, ParamSpecT : ParamSpecProtocol, ValueT : ValueProtocol
  • Sets a property on the GtkEditable delegate for object.

    This is a helper function that should be called in the set_property function of your GtkEditable implementation, before handling your own properties.

    Declaration

    Swift

    @inlinable
    public func editableDelegateSetProperty<ObjectT, ParamSpecT, ValueT>(object: ObjectT, propId: Int, value: ValueT, pspec: ParamSpecT) -> Bool where ObjectT : ObjectProtocol, ParamSpecT : ParamSpecProtocol, ValueT : ValueProtocol
  • Overrides the GtkEditable properties for class.

    This is a helper function that should be called in class_init, after installing your own properties.

    Note that your class must have “text”, “cursor-position”, “selection-bound”, “editable”, “width-chars”, “max-width-chars”, “xalign” and “enable-undo” properties for this function to work.

    To handle the properties in your set_property and get_property functions, you can either use [funcGtk.Editable.delegate_set_property] and funcGtk.Editable.delegate_get_property, or remember the first_prop offset and add it to the values in the [enumGtk.EditableProperties] enumeration to get the property IDs for these properties.

    Declaration

    Swift

    @inlinable
    public func editableInstallProperties<ObjectClassT>(objectClass: ObjectClassT, firstProp: Int) -> Int where ObjectClassT : ObjectClassProtocol
  • Calls a function for all GtkPrinters.

    If func returns true, the enumeration is stopped.

    Declaration

    Swift

    @inlinable
    public func enumeratePrinters(func: GtkPrinterFunc?, data: gpointer! = nil, destroy: GDestroyNotify?, wait: Bool)
  • Registers an error quark for GtkFileChooser errors.

    Declaration

    Swift

    @inlinable
    public func fileChooserErrorQuark() -> GQuark
  • Returns the binary age as passed to libtool.

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

    Declaration

    Swift

    @inlinable
    public func getBinaryAge() -> Int
  • 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.

    Declaration

    Swift

    @inlinable
    public func getDebugFlags() -> DebugFlags
  • 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 [funcPango.Language.get_default]. See that function for details.

    Declaration

    Swift

    @inlinable
    public func getDefaultLanguage() -> Pango.LanguageRef!
  • Returns the interface age as passed to libtool.

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

    Declaration

    Swift

    @inlinable
    public func getInterfaceAge() -> Int
  • Get 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 gtk_init(), and you should normally use gtk_widget_get_direction() or gtk_widget_get_default_direction() 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 Language Example):

    setlocale (LC_ALL, new_locale);
    direction = gtk_get_locale_direction ();
    gtk_widget_set_default_direction (direction);
    

    Declaration

    Swift

    @inlinable
    public func getLocaleDirection() -> GtkTextDirection
  • 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 GTK_MAJOR_VERSION macro, which represents the major version of the GTK headers you have included when compiling your code.

    Declaration

    Swift

    @inlinable
    public func getMajorVersion() -> Int
  • 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 GTK_MICRO_VERSION macro, which represents the micro version of the GTK headers you have included when compiling your code.

    Declaration

    Swift

    @inlinable
    public func getMicroVersion() -> Int
  • 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 GTK_MINOR_VERSION macro, which represents the minor version of the GTK headers you have included when compiling your code.

    Declaration

    Swift

    @inlinable
    public func getMinorVersion() -> Int
  • 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.

    Declaration

    Swift

    @inlinable
    public func hsvToRgb(h: CFloat, s: CFloat, v: CFloat, r: UnsafeMutablePointer<CFloat>!, g: UnsafeMutablePointer<CFloat>!, b: UnsafeMutablePointer<CFloat>!)
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func iconThemeErrorQuark() -> GQuark
  • Call this function before using any other GTK functions in your GUI applications. It will initialize everything needed to operate the toolkit and parses some standard command line options.

    If you are using GtkApplication, you don’t have to call gtk_init() or gtk_init_check(); the GApplicationstartup`` handler does it for you.

    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 you want to call gtk_init_check() 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 gtk_init(), but notice that other libraries (e.g. libdbus or gvfs) might do similar things.

    Declaration

    Swift

    @inlinable
    public func init_()
  • This function does the same work as gtk_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.

    Declaration

    Swift

    @inlinable
    public func initCheck() -> Bool
  • Use this function to check if GTK has been initialized with gtk_init() or gtk_init_check().

    Declaration

    Swift

    @inlinable
    public func isInitialized() -> Bool
  • Finds the GtkNative associated with the surface.

    Declaration

    Swift

    @inlinable
    public func nativeGetFor<SurfaceT>(surface: SurfaceT) -> NativeRef! where SurfaceT : SurfaceProtocol
  • Converts the result of a GCompareFunc like strcmp() to a GtkOrdering value.

    Declaration

    Swift

    @inlinable
    public func orderingFromCmpfunc(cmpfuncResult: Int) -> GtkOrdering
  • Returns the name of the default paper size, which depends on the current locale.

    Declaration

    Swift

    @inlinable
    public func paperSizeGetDefault() -> String!
  • Creates a list of known paper sizes.

    Declaration

    Swift

    @inlinable
    public func paperSizeGetPaperSizes(includeCustom: Bool) -> GLib.ListRef!
  • Creates a new GParamSpec instance for a property holding a GtkExpression.

    See g_param_spec_internal() for details on the property strings.

    Declaration

    Swift

    @inlinable
    public func paramSpecExpression(name: UnsafePointer<CChar>!, nick: UnsafePointer<CChar>!, blurb: UnsafePointer<CChar>!, flags: GLibObject.ParamFlags) -> GLibObject.ParamSpecRef!
  • Registers an error quark for GtkPrintOperation if necessary.

    Declaration

    Swift

    @inlinable
    public func printErrorQuark() -> GQuark
  • Runs a page setup dialog, letting the user modify the values from page_setup. If the user cancels the dialog, the returned GtkPageSetup is identical to the passed in page_setup, 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 gtk_print_run_page_setup_dialog_async() if this is a problem.

    Declaration

    Swift

    @inlinable
    public func printRunPageSetupDialog<PrintSettingsT>(parent: WindowRef? = nil, pageSetup: PageSetupRef? = nil, settings: PrintSettingsT) -> PageSetupRef! where PrintSettingsT : PrintSettingsProtocol
  • Runs a page setup dialog, letting the user modify the values from page_setup. If the user cancels the dialog, the returned GtkPageSetup is identical to the passed in page_setup, 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 gtk_print_run_page_setup_dialog_async() if this is a problem.

    Declaration

    Swift

    @inlinable
    public func printRunPageSetupDialog<PageSetupT, PrintSettingsT, WindowT>(parent: WindowT?, pageSetup: PageSetupT?, settings: PrintSettingsT) -> PageSetupRef! where PageSetupT : PageSetupProtocol, PrintSettingsT : PrintSettingsProtocol, WindowT : WindowProtocol
  • Runs a page setup dialog, letting the user modify the values from page_setup.

    In contrast to gtk_print_run_page_setup_dialog(), this function returns after showing the page setup dialog on platforms that support this, and calls done_cb from a signal handler for the response signal of the dialog.

    Declaration

    Swift

    @inlinable
    public func printRunPageSetupDialogAsync<PrintSettingsT>(parent: WindowRef? = nil, pageSetup: PageSetupRef? = nil, settings: PrintSettingsT, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PrintSettingsT : PrintSettingsProtocol
  • Runs a page setup dialog, letting the user modify the values from page_setup.

    In contrast to gtk_print_run_page_setup_dialog(), this function returns after showing the page setup dialog on platforms that support this, and calls done_cb from a signal handler for the response signal of the dialog.

    Declaration

    Swift

    @inlinable
    public func printRunPageSetupDialogAsync<PageSetupT, PrintSettingsT, WindowT>(parent: WindowT?, pageSetup: PageSetupT?, settings: PrintSettingsT, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PageSetupT : PageSetupProtocol, PrintSettingsT : PrintSettingsProtocol, WindowT : WindowProtocol
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func recentManagerErrorQuark() -> GQuark
  • Renders an activity indicator (such as in GtkSpinner). The state GTK_STATE_FLAG_CHECKED determines whether there is activity going on.

    Declaration

    Swift

    @inlinable
    public func renderActivity<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, width: CDouble, height: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • Renders an arrow pointing to angle.

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

    Declaration

    Swift

    @inlinable
    public func renderArrow<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, angle: CDouble, x: CDouble, y: CDouble, size: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • Renders the background of an element.

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

    Declaration

    Swift

    @inlinable
    public func renderBackground<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, width: CDouble, height: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • Renders a checkmark (as in a GtkCheckButton).

    The GTK_STATE_FLAG_CHECKED state determines whether the check is on or off, and GTK_STATE_FLAG_INCONSISTENT determines whether it should be marked as undefined.

    Typical checkmark rendering:

    Declaration

    Swift

    @inlinable
    public func renderCheck<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, width: CDouble, height: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • Renders an expander (as used in GtkTreeView and GtkExpander) in the area defined by x, y, width, height. The state GTK_STATE_FLAG_CHECKED determines whether the expander is collapsed or expanded.

    Typical expander rendering:

    Declaration

    Swift

    @inlinable
    public func renderExpander<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, width: CDouble, height: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • Renders a focus indicator on the rectangle determined by x, y, width, height.

    Typical focus rendering:

    Declaration

    Swift

    @inlinable
    public func renderFocus<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, width: CDouble, height: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • 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:

    Declaration

    Swift

    @inlinable
    public func renderFrame<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, width: CDouble, height: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • 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:

    Declaration

    Swift

    @inlinable
    public func renderHandle<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, width: CDouble, height: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • 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.

    Declaration

    Swift

    @inlinable
    public func renderIcon<ContextT, StyleContextT, TextureT>(context: StyleContextT, cr: ContextT, texture: TextureT, x: CDouble, y: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol, TextureT : TextureProtocol
  • Renders layout on the coordinates x, y

    Declaration

    Swift

    @inlinable
    public func renderLayout<ContextT, LayoutT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, layout: LayoutT) where ContextT : ContextProtocol, LayoutT : LayoutProtocol, StyleContextT : StyleContextProtocol
  • Renders a line from (x0, y0) to (x1, y1).

    Declaration

    Swift

    @inlinable
    public func renderLine<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x0: CDouble, y0: CDouble, x1: CDouble, y1: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • Renders an option mark (as in a radio button), the GTK_STATE_FLAG_CHECKED state will determine whether the option is on or off, and GTK_STATE_FLAG_INCONSISTENT whether it should be marked as undefined.

    Typical option mark rendering:

    Declaration

    Swift

    @inlinable
    public func renderOption<ContextT, StyleContextT>(context: StyleContextT, cr: ContextT, x: CDouble, y: CDouble, width: CDouble, height: CDouble) where ContextT : ContextProtocol, StyleContextT : StyleContextProtocol
  • 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.

    Declaration

    Swift

    @inlinable
    public func rgbToHsv(r: CFloat, g: CFloat, b: CFloat, h: UnsafeMutablePointer<CFloat>!, s: UnsafeMutablePointer<CFloat>!, v: UnsafeMutablePointer<CFloat>!)
  • Sets the GTK debug flags.

    Declaration

    Swift

    @inlinable
    public func setDebug(flags: DebugFlags)
  • This function launches the default application for showing a given uri, or shows an error dialog if that fails.

    Declaration

    Swift

    @inlinable
    public func showUri(parent: WindowRef? = nil, uri: UnsafePointer<CChar>!, timestamp: guint32)
  • This function launches the default application for showing a given uri, or shows an error dialog if that fails.

    Declaration

    Swift

    @inlinable
    public func showUri<WindowT>(parent: WindowT?, uri: UnsafePointer<CChar>!, timestamp: guint32) where WindowT : WindowProtocol
  • This function launches the default application for showing a given uri.

    The callback will be called when the launch is completed. It should call gtk_show_uri_full_finish() to obtain the result.

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

    Declaration

    Swift

    @inlinable
    public func showUriFull(parent: WindowRef? = nil, uri: UnsafePointer<CChar>!, timestamp: guint32, cancellable: GIO.CancellableRef? = nil, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil)
  • This function launches the default application for showing a given uri.

    The callback will be called when the launch is completed. It should call gtk_show_uri_full_finish() to obtain the result.

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

    Declaration

    Swift

    @inlinable
    public func showUriFull<CancellableT, WindowT>(parent: WindowT?, uri: UnsafePointer<CChar>!, timestamp: guint32, cancellable: CancellableT?, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil) where CancellableT : CancellableProtocol, WindowT : WindowProtocol
  • Finishes the gtk_show_uri() call and returns the result of the operation.

    Declaration

    Swift

    @inlinable
    public func showUriFullFinish<AsyncResultT, WindowT>(parent: WindowT, result: AsyncResultT) throws -> Bool where AsyncResultT : AsyncResultProtocol, WindowT : WindowProtocol
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func testAccessibleAssertionMessageRole<AccessibleT>(domain: UnsafePointer<CChar>!, file: UnsafePointer<CChar>!, line: Int, func: UnsafePointer<CChar>!, expr: UnsafePointer<CChar>!, accessible: AccessibleT, expectedRole: GtkAccessibleRole, actualRole: GtkAccessibleRole) where AccessibleT : AccessibleProtocol
  • Checks whether the GtkAccessible has property set.

    Declaration

    Swift

    @inlinable
    public func testAccessibleHasProperty<AccessibleT>(accessible: AccessibleT, property: GtkAccessibleProperty) -> Bool where AccessibleT : AccessibleProtocol
  • Checks whether the GtkAccessible has relation set.

    Declaration

    Swift

    @inlinable
    public func testAccessibleHasRelation<AccessibleT>(accessible: AccessibleT, relation: GtkAccessibleRelation) -> Bool where AccessibleT : AccessibleProtocol
  • Checks whether the GtkAccessible:accessible-role of the accessible is role.

    Declaration

    Swift

    @inlinable
    public func testAccessibleHasRole<AccessibleT>(accessible: AccessibleT, role: GtkAccessibleRole) -> Bool where AccessibleT : AccessibleProtocol
  • Checks whether the GtkAccessible has state set.

    Declaration

    Swift

    @inlinable
    public func testAccessibleHasState<AccessibleT>(accessible: AccessibleT, state: GtkAccessibleState) -> Bool where AccessibleT : AccessibleProtocol
  • Return the type ids that have been registered after calling gtk_test_register_all_types().

    Declaration

    Swift

    @inlinable
    public func testListAllTypes(nTypes: UnsafeMutablePointer<guint>!) -> UnsafePointer<GType>!
  • Force registration of all core GTK object types.

    This allowes to refer to any of those object types via g_type_from_name() after calling this function.

    Declaration

    Swift

    @inlinable
    public func testRegisterAllTypes()
  • 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.

    Declaration

    Swift

    @inlinable
    public func testWidgetWaitForDraw<WidgetT>(widget: WidgetT) where WidgetT : WidgetProtocol
  • Creates a content provider for dragging path from tree_model.

    Declaration

    Swift

    @inlinable
    public func treeCreateRowDragContent<TreeModelT, TreePathT>(treeModel: TreeModelT, path: TreePathT) -> Gdk.ContentProviderRef! where TreeModelT : TreeModelProtocol, TreePathT : TreePathProtocol
  • Obtains a tree_model and path from value of target type GTK_TYPE_TREE_ROW_DATA.

    The returned path must be freed with gtk_tree_path_free().

    Declaration

    Swift

    @inlinable
    public func treeGetRowDragData<ValueT>(value: ValueT, treeModel: UnsafeMutablePointer<UnsafeMutablePointer<GtkTreeModel>?>? = nil, path: UnsafeMutablePointer<UnsafeMutablePointer<GtkTreePath>?>? = nil) -> Bool where ValueT : ValueProtocol
  • Lets a set of row reference created by gtk_tree_row_reference_new_proxy() know that the model emitted the row-deleted signal.

    Declaration

    Swift

    @inlinable
    public func treeRowReferenceDeleted<ObjectT, TreePathT>(proxy: ObjectT, path: TreePathT) where ObjectT : ObjectProtocol, TreePathT : TreePathProtocol
  • Lets a set of row reference created by gtk_tree_row_reference_new_proxy() know that the model emitted the row-inserted signal.

    Declaration

    Swift

    @inlinable
    public func treeRowReferenceInserted<ObjectT, TreePathT>(proxy: ObjectT, path: TreePathT) where ObjectT : ObjectProtocol, TreePathT : TreePathProtocol
  • Lets a set of row reference created by gtk_tree_row_reference_new_proxy() know that the model emitted the rows-reordered signal.

    Declaration

    Swift

    @inlinable
    public func treeRowReferenceReordered<ObjectT, TreeIterT, TreePathT>(proxy: ObjectT, path: TreePathT, iter: TreeIterT, newOrder: UnsafeMutablePointer<CInt>!) where ObjectT : ObjectProtocol, TreeIterT : TreeIterProtocol, TreePathT : TreePathProtocol
  • Retrieves the GtkExpression stored inside the given value, and acquires a reference to it.

    Declaration

    Swift

    @inlinable
    public func valueDupExpression<ValueT>(value: ValueT) -> ExpressionRef! where ValueT : ValueProtocol
  • Retrieves the GtkExpression stored inside the given value.

    Declaration

    Swift

    @inlinable
    public func valueGetExpression<ValueT>(value: ValueT) -> ExpressionRef! where ValueT : ValueProtocol
  • Stores the given GtkExpression inside value.

    The GValue will acquire a reference to the expression.

    Declaration

    Swift

    @inlinable
    public func valueSetExpression<ExpressionT, ValueT>(value: ValueT, expression: ExpressionT) where ExpressionT : ExpressionProtocol, ValueT : ValueProtocol
  • Stores the given GtkExpression inside value.

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

    Declaration

    Swift

    @inlinable
    public func valueTakeExpression<ValueT>(value: ValueT, expression: ExpressionRef? = nil) where ValueT : ValueProtocol
  • Stores the given GtkExpression inside value.

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

    Declaration

    Swift

    @inlinable
    public func valueTakeExpression<ExpressionT, ValueT>(value: ValueT, expression: ExpressionT?) where ExpressionT : ExpressionProtocol, ValueT : ValueProtocol