Generates an accessible description of an accelerator.
This function is similar to
accelerator-get-label but it is
meant for accessibility layers labels rather than user-facing labels.
The output of this function is fit for
Gtk.AccessibleProperty.KEY_SHORTCUTS.
For more information, see the WAI-ARIA reference.
Passed: an unsigned 32-bit integer.
accelerator keyval
Passed: a <GdkModifierType>, or a list of
its symbols, or one of them.
accelerator modifier mask
Returned: a string.
a newly-allocated string representing the accelerator
Gets the modifier mask.
The modifier mask determines which modifiers are considered significant
for keyboard accelerators. This includes all keyboard modifiers except
for lock-mask.
Returned: a <GdkModifierType>.
the modifier mask for accelerators
Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.
Passed: an unsigned 32-bit integer.
accelerator keyval
Passed: a <GdkModifierType>, or a list of
its symbols, or one of them.
accelerator modifier mask
Returned: a string.
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
accelerator-get-label, but handling
keycodes. This is only useful for system-level components, applications
should use accelerator-get-label
instead.
Passed: a <GdkDisplay>, or #f.
Passed: an unsigned 32-bit integer.
accelerator keyval
Passed: an unsigned 32-bit integer.
accelerator keycode
Passed: a <GdkModifierType>, or a list of
its symbols, or one of them.
accelerator modifier mask
Returned: a string.
a newly-allocated string representing the accelerator
Converts an accelerator keyval and modifier mask into a string that can
be parsed by accelerator-parse.
For example, if you pass in GDK_KEY_q and
control-mask, this function returns
<Control>q.
If you need to display accelerators in the user interface, see
accelerator-get-label.
Passed: an unsigned 32-bit integer.
accelerator keyval
Passed: a <GdkModifierType>, or a list of
its symbols, or one of them.
accelerator modifier mask
Returned: a string.
a newly-allocated accelerator name
Converts an accelerator keyval and modifier mask into a string that can
be parsed by
accelerator-parse-with-keycode.
This is similar to accelerator-name but
handling keycodes. This is only useful for system-level components,
applications should use accelerator-name
instead.
Passed: a <GdkDisplay>, or #f.
Passed: an unsigned 32-bit integer.
accelerator keyval
Passed: an unsigned 32-bit integer.
accelerator keycode
Passed: a <GdkModifierType>, or a list of
its symbols, or one of them.
accelerator modifier mask
Returned: a string.
a newly allocated accelerator name.
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 [func@Gdk.keyval_from_name]. 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 control-mask
<Alt> for alt-mask
<Meta> for meta-mask
<Super> for super-mask
<Hyper> for hyper-mask
If the parse operation fails, accelerator-key and accelerator-mods will be set to 0 (zero).
Passed: a string.
string representing an accelerator
Returned: a boolean.
whether parsing succeeded
Returned: an unsigned 32-bit integer.
return location for accelerator keyval
Returned: a <GdkModifierType>.
return location for accelerator modifier mask
Parses a string representing an accelerator.
This is similar to accelerator-parse but
handles keycodes as well. This is only useful for system-level
components, applications should use
accelerator-parse instead.
If accelerator-codes is given and the result stored in it is
non-#f, the result must be freed with
byte-array: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).
Passed: a string.
string representing an accelerator
Passed, or left out: a <GdkDisplay>, or
#f.
the <GdkDisplay> to look up
accelerator-codes in
Returned: a boolean.
true if parsing succeeded
Returned: an unsigned 32-bit integer.
return location for accelerator keyval
Returned: an u32vector.
return location for accelerator keycodes
Returned: a <GdkModifierType>.
return location for accelerator modifier mask
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.
For example, the GDK_KEY_a keyval plus
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.
Passed: an unsigned 32-bit integer.
a GDK keyval
Passed: a <GdkModifierType>, or a list of
its symbols, or one of them.
modifier mask
Returned: a boolean.
true if the accelerator is valid
Initializes value with the appropriate type for the property.
This function is mostly meant for language bindings, in conjunction with
gtk_accessible_update_property_value().
Passed: a <GtkAccessibleProperty>, or
one of its symbols.
Passed: a <GValue>.
an uninitialized <GValue>
Initializes value with the appropriate type for the relation.
This function is mostly meant for language bindings, in conjunction with
gtk_accessible_update_relation_value().
Passed: a <GtkAccessibleRelation>, or
one of its symbols.
Passed: a <GValue>.
an uninitialized <GValue>
Initializes value with the appropriate type for the state.
This function is mostly meant for language bindings, in conjunction with
gtk_accessible_update_relation_state().
Passed: a <GtkAccessibleState>, or one of
its symbols.
Passed: a <GValue>.
an uninitialized <GValue>
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
#f.
Passed, filled in, and returned: a
<GtkBitsetIter>.
a pointer to an uninitialized <GtkBitsetIter>
Passed: a <GtkBitset>.
Passed: an unsigned 32-bit integer.
target value to start iterating at
Returned: a boolean.
#t if a value was found.
Returned: an unsigned 32-bit integer.
Set to the found value in set
Initializes an iterator for set and points it to the first value in set.
If set is empty, #f is returned and value is set to
G_MAXUINT.
Passed, filled in, and returned: a
<GtkBitsetIter>.
a pointer to an uninitialized <GtkBitsetIter>
Passed: a <GtkBitset>.
Returned: a boolean.
#t if set isn’t empty.
Returned: an unsigned 32-bit integer.
Set to the first value in set
Initializes an iterator for set and points it to the last value in set.
If set is empty, #f is returned.
Passed, filled in, and returned: a
<GtkBitsetIter>.
a pointer to an uninitialized <GtkBitsetIter>
Passed: a <GtkBitset>.
Returned: a boolean.
#t if set isn’t empty.
Returned: an unsigned 32-bit integer.
Set to the last value in set
Registers an error quark for <GtkBuilder> errors.
Returned: an unsigned 32-bit integer.
the error quark
Checks that the GTK library in use is compatible with the given version.
Generally you would pass in the constants GTK_MAJOR_VERSION,
GTK_MINOR_VERSION, GTK_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 required-major.required_minor.required-micro. Second the running library must be binary compatible with the version required-major.required_minor.required-micro (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 check-version, but still get loaded into
an application using a newer version of GTK.
Passed: an unsigned 32-bit integer.
the required major version
Passed: an unsigned 32-bit integer.
the required minor version
Passed: an unsigned 32-bit integer.
the required micro version
Returned: a string, or #f.
#f 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.
Registers an error quark for VFL error parsing.
Returned: an unsigned 32-bit integer.
the error quark
Registers an error quark for CSS parsing errors.
Returned: an unsigned 32-bit integer.
the error quark
Registers an error quark for CSS parsing warnings.
Returned: an unsigned 32-bit integer.
the warning quark
Registers an error quark for an operation that requires a dialog if necessary.
Returned: an unsigned 32-bit integer.
the error quark
Prevents GTK from using the specified portals.
This should only be used in portal implementations, apps must not call it.
Passed: a list or vector, each a string.
a #f-terminated array of portal interface names to disable
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.
Prevents init and
init-check? 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.
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.
Passed: a 32-bit integer.
Extra space to redistribute among children after subtracting minimum sizes and any child padding from the overall allocation
Passed: a list or vector, each a
<GtkRequestedSize>.
An array of structs with a client pointer and a minimum/natural size in the orientation of the allocation.
Returned: a 32-bit integer.
The remainder of extra-space after redistributing space to sizes.
Not passed: guile-gi gives the length of sizes.
Number of requests to fit into the allocation
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.
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.
Calls a function for all printers that are known to GTK.
If func returns true, the enumeration is stopped.
Passed: a procedure.
a function to call for each printer
See GtkPrinterFunc for how it is called.
Passed: a boolean.
if true, wait in a recursive mainloop until all printers are enumerated; otherwise return early
Not passed: guile-gi supplies it.
user data to pass to func
Not passed: guile-gi supplies it.
function to call if data is no longer needed
See GDestroyNotify for how it is
called.
Registers an error quark for GtkFileChooser errors.
Returned: an unsigned 32-bit integer.
The error quark used for GtkFileChooser errors.
Returns the binary age as passed to libtool.
If libtool means nothing to you, don’t worry about it.
Returned: an unsigned 32-bit integer.
the binary age of the GTK library
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.
Returned: a <GtkDebugFlags>.
the GTK debug flags.
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 language:get-default. See that function for
details.
Returned: a <PangoLanguage>.
the default language
Returns the interface age as passed to libtool.
If libtool means nothing to you, don’t worry about it.
Returned: an unsigned 32-bit integer.
the interface age of the GTK library
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
ltr direction otherwise.
none will never be returned.
GTK sets the default text direction according to the locale during
init, and you should normally use widget:get-direction or 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:
#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 ());
}
Returned: a <GtkTextDirection>.
the direction of the current locale
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.
Returned: an unsigned 32-bit integer.
the major 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 GTK_MICRO_VERSION
macro, which represents the micro version of the GTK headers you have
included when compiling your code.
Returned: an unsigned 32-bit integer.
the micro 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 GTK_MINOR_VERSION
macro, which represents the minor version of the GTK headers you have
included when compiling your code.
Returned: an unsigned 32-bit integer.
the minor version number of the GTK library
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.
Passed: a real number.
Hue
Passed: a real number.
Saturation
Passed: a real number.
Value
Returned: a real number.
Return value for the red component
Returned: a real number.
Return value for the green component
Returned: a real number.
Return value for the blue component
Registers an error quark for <GtkIconTheme>
errors.
Returned: an unsigned 32-bit integer.
the error quark
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 display:get-default).
If you are using <GtkApplication>, you usually
don’t have to call this function; the application:do-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 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 init, but notice that other
libraries (e.g. libdbus or gvfs) might do similar things.
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.
Returned: a boolean.
true if the windowing system has been successfully initialized, false otherwise
Returns whether GTK has been initialized.
See init.
Returned: a boolean.
the initialization status
Finds the <GtkNative> associated with the surface.
Passed: a <GdkSurface>.
Returned: a <GtkNative>, or #f.
the <GtkNative> that is associated with
surface
Returns the name of the default paper size, which depends on the current locale.
Returned: a string.
the name of the default paper size. The string is owned by GTK and should not be modified.
Creates a list of known paper sizes.
Passed: a boolean.
whether to include custom paper sizes as defined in the page setup dialog
Returned: a list, each a <GtkPaperSize>.
a newly allocated list of newly allocated
<GtkPaperSize> objects
Creates a new <GParam> instance for a
property holding a <GtkExpression>.
See g_param_spec_internal() for details on the property strings.
Passed: a string.
canonical name of the property
Passed: a string.
a user-readable name for the property
Passed: a string.
a user-readable description of the property
Passed: a <%GParamFlags>, or a list of
its symbols, or one of them.
flags for the property
Returned: a <GParam>.
a newly created property specification
Registers an error quark for
<GtkPrintOperation> if necessary.
Returned: an unsigned 32-bit integer.
The error quark used for
<GtkPrintOperation> errors.
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
print-run-page-setup-dialog-async
if this is a problem.
Passed: a <GtkWindow>, or #f.
transient parent
Passed: a <GtkPageSetup>, or #f.
an existing <GtkPageSetup>
Passed: a <GtkPrintSettings>.
Returned: a <GtkPageSetup>.
a new <GtkPageSetup>
Runs a page setup dialog, letting the user modify the values from page-setup.
In contrast to
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.
Passed: a <GtkWindow>, or #f.
transient parent
Passed: a <GtkPageSetup>, or #f.
an existing <GtkPageSetup>
Passed: a <GtkPrintSettings>.
Passed: a procedure.
a function to call when the user saves the modified page setup
See GtkPageSetupDoneFunc for how it is
called.
Not passed: guile-gi supplies it.
user data to pass to done-cb
Registers an error quark for RecentManager errors.
Returned: an unsigned 32-bit integer.
the error quark
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.
Passed: a real number.
Red
Passed: a real number.
Green
Passed: a real number.
Blue
Returned: a real number.
Return value for the hue component
Returned: a real number.
Return value for the saturation component
Returned: a real number.
Return value for the value component
Sets the GTK debug flags.
Passed: a <GtkDebugFlags>, or a list of its
symbols, or one of them.
the debug flags to set
Returns context information about what XML attribute the parsing error occurred in.
Passed: a <GError>.
an error in the <GtkSvgError> domain
Returned: a string, or #f.
the attribute name
Returns context information about what XML element the parsing error occurred in.
Passed: a <GError>.
an error in the <GtkSvgError> domain
Returned: a string, or #f.
the element name
Returned: an unsigned 32-bit integer.
Prints an assertion message for
gtk_test_accessible_assert_role().
Passed: a string.
a domain
Passed: a string.
a file name
Passed: a 32-bit integer.
the line in file
Passed: a string.
a function name in file
Passed: a string.
the expression being tested
Passed: a <GtkAccessible>.
Passed: a <GtkAccessibleRole>, or one of
its symbols.
the expected <GtkAccessibleRole>
Passed: a <GtkAccessibleRole>, or one of
its symbols.
the actual <GtkAccessibleRole>
Checks whether the <GtkAccessible> has
property set.
Passed: a <GtkAccessible>.
Passed: a <GtkAccessibleProperty>, or
one of its symbols.
Returned: a boolean.
#t if the property is set in the accessible
Checks whether the <GtkAccessible> has
relation set.
Passed: a <GtkAccessible>.
Passed: a <GtkAccessibleRelation>, or
one of its symbols.
Returned: a boolean.
#t if the relation is set in the accessible
Checks whether the accessible:accessible-role of the accessible is
role.
Passed: a <GtkAccessible>.
Passed: a <GtkAccessibleRole>, or one of
its symbols.
Returned: a boolean.
#t if the role matches
Checks whether the <GtkAccessible> has
state set.
Passed: a <GtkAccessible>.
Passed: a <GtkAccessibleState>, or one of
its symbols.
Returned: a boolean.
#t if the state is set in the accessible
Return the type ids that have been registered after calling
test-register-all-types.
Returned: a vector, each a class, or a GType number.
0-terminated array of type ids
Not returned: it is the length of %return.
location to store number of types
Force registration of all core GTK object types.
This allows to refer to any of those object types via
type-from-name after calling this
function.
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.
Passed: a <GtkWidget>.
the widget to wait for
Retrieves the <GtkExpression> stored inside the
given value, and acquires a reference to it.
Passed: a <GValue>.
a <GValue> initialized with type
GTK_TYPE_EXPRESSION
Returned: a <GtkExpression>, or #f.
Retrieves the <GtkExpression> stored inside the
given value.
Passed: a <GValue>.
a <GValue> initialized with type
GTK_TYPE_EXPRESSION
Returned: a <GtkExpression>, or #f.
Stores the given <GtkExpression> inside
value.
The <GValue> will acquire a reference to the
expression.
Passed: a <GValue>.
a <GValue> initialized with type
GTK_TYPE_EXPRESSION
Passed: a <GtkExpression>.
Stores the given <GtkExpression> inside
value.
This function transfers the ownership of the expression to the
<GValue>.
Passed: a <GValue>.
a <GValue> initialized with type
GTK_TYPE_EXPRESSION
Passed, or left out: a <GtkExpression>, or
#f.