Class Gtk
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAn attribute for the background color, expressed as an RGB value encoded in a string using the format:{r8},{g8},{b8}.static final StringAn attribute for the font family name.static final StringAn attribute for the foreground color, expressed as an RGB value encoded in a string using the format:{r8},{g8},{b8}.static final StringAn attribute for the overline style.static final StringThe "none" overline value forGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE.static final StringThe "single" overline value forGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE.static final StringAn attribute for the font size, expressed in points.static final StringAn attribute for the font stretch type.static final StringThe "condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringThe "expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringThe "extra condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringThe "extra expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringThe "normal" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringThe "semi condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringThe "semi expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringThe "ultra condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringThe "ultra expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.static final StringAn attribute for strikethrough text.static final StringAn attribute for the font style.static final StringThe "italic" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE.static final StringThe "normal" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE.static final StringThe "oblique" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE.static final StringAn attribute for the underline style.static final StringThe "double" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE.static final StringThe "error" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE.static final StringThe "none" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE.static final StringThe "single" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE.static final StringAn attribute for the font variant.static final StringThe "all petite caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.static final StringThe "all small caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.static final StringThe "petite caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.static final StringThe "small caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.static final StringThe "title caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.static final StringThe "unicase" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.static final StringAn attribute for the font weight.static final intAn undefined value.static final intLikegetBinaryAge(), but from the headers used at application compile time, rather than from the library linked against at application run time.static final StringThe default name of the extension point.static final intConstant to return from a signal handler for the ::input signal in case of conversion failure.static final intLikegetInterfaceAge(), but from the headers used at application compile time, rather than from the library linked against at application run time.static final intThe value used to refer to a guaranteed invalid position in aGListModel.static final StringThe name used for the stock full offset included byGtkLevelBar.static final StringThe name used for the stock high offset included byGtkLevelBar.static final StringThe name used for the stock low offset included byGtkLevelBar.static final intLikegetMajorVersion(), but from the headers used at application compile time, rather than from the library linked against at application run time.static final intEvaluates to the maximum length of a compose sequence.static final StringThe default extension point name for media file.static final intLikegetMicroVersion(), but from the headers used at application compile time, rather than from the library linked against at application run time.static final intLikegetMinorVersion(), but from the headers used at application compile time, rather than from the library linked against at application run time.static final StringName for the A3 paper size.static final StringName for the A4 paper size.static final StringName for the A5 paper size.static final StringName for the B5 paper size.static final StringName for the Executive paper size.static final StringName for the Legal paper size.static final StringName for the Letter paper size.static final StringThe key used by the “Print to file” printer to store whether to collate the printed pages.static final StringThe key used by the “Print to file” printer to store the default source.static final StringThe key used by the “Print to file” printer to store the dither used.static final StringThe key used by the “Print to file” printer to store whether to print the output in duplex.static final StringThe key used by the “Print to file” printer to store the finishings.static final StringThe key used by the “Print to file” printer to store the media type.static final StringThe key used by the “Print to file” printer to store the number of copies.static final StringThe key used by the “Print to file” printer to store the number of pages per sheet.static final StringThe key used by the “Print to file” printer to store the number of pages per sheet in number-up mode.static final StringThe key used by the “Print to file” printer to store the orientation.static final StringThe key used by the “Print to file” printer to store the file name of the output without the path to the directory and the file extension.static final StringThe key used by the “Print to file” printer to store the output bin.static final StringThe key used by the “Print to file” printer to store the directory to which the output should be written.static final StringThe key used by the “Print to file” printer to store the format of the output.static final StringThe key used by the “Print to file” printer to store the URI to which the output should be written.static final StringThe key used by the “Print to file” printer to store the array of page ranges to print.static final StringThe key used by the “Print to file” printer to store the set of pages to print.static final StringThe key used by the “Print to file” printer to store the page format.static final StringThe key used by the “Print to file” printer to store the page height.static final StringThe key used by the “Print to file” printer to store the paper width.static final StringThe key used by the “Print to file” printer to store which pages to print.static final StringThe key used by the “Print to file” printer to store the printer name.static final StringThe key used by the “Print to file” printer to store the resolution in lines per inch.static final StringThe key used by the “Print to file” printer to store the printing quality.static final StringThe key used by the “Print to file” printer to store the resolution in DPI.static final StringThe key used by the “Print to file” printer to store the horizontal resolution in DPI.static final StringThe key used by the “Print to file” printer to store the vertical resolution in DPI.static final StringThe key used by the “Print to file” printer to store whether to reverse the order of the printed pages.static final StringThe key used by the “Print to file” printer to store the scale.static final StringThe key used by the “Print to file” printer to store whether to print with colors.static final StringThe key used by the “Print to file” printer to store 32-bit Windows extra driver.static final StringThe key used by the “Print to file” printer to store the 32-bit Windows driver version.static final intUse this priority for functionality related to size allocation.static final intA priority that can be used when adding aGtkStyleProviderfor application-specific style information.static final intThe priority used for default style information that is used in the absence of themes.static final intThe priority used for style information provided viaGtkSettings.static final intThe priority used for style information provided by themes.static final intThe priority used for the style information from$XDG_CONFIG_HOME/gtk-4.0/gtk.css.static final intThe priority at which the text view validates onscreen lines in an idle job in the background.static final intDeprecated.There is no replacementstatic final intDeprecated.There is no replacement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<ModifierType> Gets the modifier mask.static StringacceleratorGetLabel(int acceleratorKey, Set<ModifierType> acceleratorMods) Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.static StringacceleratorGetLabel(int acceleratorKey, ModifierType... acceleratorMods) Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.static StringacceleratorGetLabelWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, Set<ModifierType> acceleratorMods) Converts an accelerator keyval and modifier mask into a string that can be displayed to the user.static StringacceleratorGetLabelWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, ModifierType... acceleratorMods) Converts an accelerator keyval and modifier mask into a string that can be displayed to the user.static StringacceleratorName(int acceleratorKey, Set<ModifierType> acceleratorMods) Converts an accelerator keyval and modifier mask into a string that can be parsed byacceleratorParse(java.lang.String, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>).static StringacceleratorName(int acceleratorKey, ModifierType... acceleratorMods) Converts an accelerator keyval and modifier mask into a string that can be parsed byacceleratorParse(java.lang.String, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>).static StringacceleratorNameWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, Set<ModifierType> acceleratorMods) Converts an accelerator keyval and modifier mask into a string that can be parsed byacceleratorParseWithKeycode(java.lang.String, org.gnome.gdk.Display, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<int[]>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>).static StringacceleratorNameWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, ModifierType... acceleratorMods) Converts an accelerator keyval and modifier mask into a string that can be parsed byacceleratorParseWithKeycode(java.lang.String, org.gnome.gdk.Display, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<int[]>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>).static booleanacceleratorParse(String accelerator, @Nullable Out<Integer> acceleratorKey, @Nullable Out<Set<ModifierType>> acceleratorMods) Parses a string representing an accelerator.static booleanacceleratorParseWithKeycode(String accelerator, @Nullable Display display, @Nullable Out<Integer> acceleratorKey, @Nullable Out<int[]> acceleratorCodes, @Nullable Out<Set<ModifierType>> acceleratorMods) Parses a string representing an accelerator.static booleanacceleratorValid(int keyval, Set<ModifierType> modifiers) Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.static booleanacceleratorValid(int keyval, ModifierType... modifiers) Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.static @Nullable StringcheckVersion(int requiredMajor, int requiredMinor, int requiredMicro) Checks that the GTK library in use is compatible with the given version.static QuarkRegisters an error quark for CSS parsing errors.static QuarkRegisters an error quark for CSS parsing warnings.static voidPrevents GTK from using portals.static voidstatic intdistributeNaturalAllocation(int extraSpace, @Nullable RequestedSize @Nullable [] sizes) DistributesextraSpaceto childsizesby bringing smaller children up to natural size first.static voidenumeratePrinters(@Nullable PrinterFunc func, boolean wait_) Calls a function for all printers that are known to GTK.static intReturns the binary age as passed tolibtool.static Set<DebugFlags> Returns the GTK debug flags that are currently active.static LanguageReturns thePangoLanguagefor the default language currently in effect.static intReturns the interface age as passed tolibtool.static TextDirectionGets the direction of the current locale.static intReturns the major version number of the GTK library.static intReturns the micro version number of the GTK library.static intReturns the minor version number of the GTK library.static voidConverts a color from HSV space to RGB.static voidinit()Initializes GTK.static voidinitAbiCheck(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) static booleanInitializes GTK.static booleaninitCheckAbiCheck(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) static booleanReturns whether GTK has been initialized.static voidstatic ParamSpecparamSpecExpression(String name, String nick, String blurb, Set<ParamFlags> flags) Creates a newGParamSpecinstance for a property holding aGtkExpression.static ParamSpecparamSpecExpression(String name, String nick, String blurb, ParamFlags... flags) Creates a newGParamSpecinstance for a property holding aGtkExpression.static PageSetupprintRunPageSetupDialog(@Nullable Window parent, @Nullable PageSetup pageSetup, PrintSettings settings) Runs a page setup dialog, letting the user modify the values frompageSetup.static voidprintRunPageSetupDialogAsync(@Nullable Window parent, @Nullable PageSetup pageSetup, PrintSettings settings, @Nullable PageSetupDoneFunc doneCb) Runs a page setup dialog, letting the user modify the values frompageSetup.static voidrenderActivity(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static voidrenderArrow(StyleContext context, org.freedesktop.cairo.Context cr, double angle, double x, double y, double size) Deprecated.static voidrenderBackground(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static voidrenderCheck(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static voidrenderExpander(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static voidrenderFocus(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static voidrenderFrame(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static voidrenderHandle(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static voidrenderIcon(StyleContext context, org.freedesktop.cairo.Context cr, Texture texture, double x, double y) Deprecated.static voidrenderLayout(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, Layout layout) Deprecated.static voidrenderLine(StyleContext context, org.freedesktop.cairo.Context cr, double x0, double y0, double x1, double y1) Deprecated.static voidrenderOption(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static voidConverts a color from RGB space to HSV.static voidsetDebugFlags(Set<DebugFlags> flags) Sets the GTK debug flags.static voidsetDebugFlags(DebugFlags... flags) Sets the GTK debug flags.static voidshowAboutDialog(@Nullable Window parent, String firstPropertyName, Object... varargs) A convenience function for showing an application’s about dialog.static voidstatic voidshowUriFull(@Nullable Window parent, String uri, int timestamp, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) static booleanshowUriFullFinish(Window parent, AsyncResult result) static voidstyleContextAddProviderForDisplay(Display display, StyleProvider provider, int priority) Adds a global style provider todisplay,which will be used in style construction for allGtkStyleContextsunderdisplay.static voidstyleContextRemoveProviderForDisplay(Display display, StyleProvider provider) Removesproviderfrom the global style providers list indisplay.static voidtestAccessibleAssertionMessageRole(String domain, String file, int line, String func, String expr, Accessible accessible, AccessibleRole expectedRole, AccessibleRole actualRole) Prints an assertion message for gtk_test_accessible_assert_role().static StringtestAccessibleCheckProperty(Accessible accessible, AccessibleProperty property, Object... varargs) Checks whether the accessiblepropertyofaccessibleis set to a specific value.static StringtestAccessibleCheckRelation(Accessible accessible, AccessibleRelation relation, Object... varargs) Checks whether the accessiblerelationofaccessibleis set to a specific value.static StringtestAccessibleCheckState(Accessible accessible, AccessibleState state, Object... varargs) Checks whether the accessiblestateofaccessibleis set to a specific value.static booleantestAccessibleHasProperty(Accessible accessible, AccessibleProperty property) Checks whether theGtkAccessiblehaspropertyset.static booleantestAccessibleHasRelation(Accessible accessible, AccessibleRelation relation) Checks whether theGtkAccessiblehasrelationset.static booleantestAccessibleHasRole(Accessible accessible, AccessibleRole role) Checks whether theGtkAccessible:accessible-roleof the accessible isrole.static booleantestAccessibleHasState(Accessible accessible, AccessibleState state) Checks whether theGtkAccessiblehasstateset.static voidThis function is used to initialize a GTK test program.static Type[]Return the type ids that have been registered after calling gtk_test_register_all_types().static voidForce registration of all core GTK object types.static voidtestWidgetWaitForDraw(Widget widget) Enters the main loop and waits forwidgetto be “drawn”.static ContentProvidertreeCreateRowDragContent(TreeModel treeModel, TreePath path) Deprecated.Use list models insteadstatic booleanDeprecated.Use list models insteadstatic @Nullable ExpressionvalueDupExpression(Value value) Retrieves theGtkExpressionstored inside the givenvalue, and acquires a reference to it.static @Nullable ExpressionvalueGetExpression(Value value) Retrieves theGtkExpressionstored inside the givenvalue.static voidvalueSetExpression(Value value, Expression expression) Stores the givenGtkExpressioninsidevalue.static voidvalueTakeExpression(Value value, @Nullable Expression expression) Stores the givenGtkExpressioninsidevalue.
-
Field Details
-
ACCESSIBLE_ATTRIBUTE_BACKGROUND
An attribute for the background color, expressed as an RGB value encoded in a string using the format:{r8},{g8},{b8}.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_FAMILY
An attribute for the font family name.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_FOREGROUND
An attribute for the foreground color, expressed as an RGB value encoded in a string using the format:{r8},{g8},{b8}.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_OVERLINE
An attribute for the overline style.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_NONEGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE
- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE
The "none" overline value forGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE
The "single" overline value forGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_SIZE
An attribute for the font size, expressed in points.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH
An attribute for the font stretch type.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSEDGtk.ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSEDGtk.ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSEDGtk.ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED
- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED
The "condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_EXPANDED
The "expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED
The "extra condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_EXPANDED
The "extra expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_NORMAL
The "normal" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED
The "semi condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_EXPANDED
The "semi expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED
The "ultra condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_EXPANDED
The "ultra expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRIKETHROUGH
An attribute for strikethrough text.Possible values are
trueorfalse.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STYLE
An attribute for the font style.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_NORMALGtk.ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUEGtk.ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC
- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC
The "italic" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL
The "normal" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE
The "oblique" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE
An attribute for the underline style.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONEGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLEGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLEGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR
- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE
The "double" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR
The "error" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE
The "none" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE
The "single" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT
An attribute for the font variant.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPSGtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPSGtk.ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPSGtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPSGtk.ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASEGtk.ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS
- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS
The "all petite caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS
The "all small caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS
The "petite caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS
The "small caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS
The "title caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE
The "unicase" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_ATTRIBUTE_WEIGHT
An attribute for the font weight.- Since:
- 4.14
- See Also:
-
ACCESSIBLE_VALUE_UNDEFINED
public static final int ACCESSIBLE_VALUE_UNDEFINEDAn undefined value. The accessible attribute is either unset, or its value is undefined.- See Also:
-
BINARY_AGE
public static final int BINARY_AGELikegetBinaryAge(), but from the headers used at application compile time, rather than from the library linked against at application run time.- See Also:
-
IM_MODULE_EXTENSION_POINT_NAME
The default name of the extension point.- See Also:
-
INPUT_ERROR
public static final int INPUT_ERRORConstant to return from a signal handler for the ::input signal in case of conversion failure.See
Gtk.SpinButton::input.- See Also:
-
INTERFACE_AGE
public static final int INTERFACE_AGELikegetInterfaceAge(), but from the headers used at application compile time, rather than from the library linked against at application run time.- See Also:
-
INVALID_LIST_POSITION
public static final int INVALID_LIST_POSITIONThe value used to refer to a guaranteed invalid position in aGListModel.This value may be returned from some functions, others may accept it as input. Its interpretation may differ for different functions.
Refer to each function's documentation for if this value is allowed and what it does.
- See Also:
-
LEVEL_BAR_OFFSET_FULL
The name used for the stock full offset included byGtkLevelBar.- See Also:
-
LEVEL_BAR_OFFSET_HIGH
The name used for the stock high offset included byGtkLevelBar.- See Also:
-
LEVEL_BAR_OFFSET_LOW
The name used for the stock low offset included byGtkLevelBar.- See Also:
-
MAJOR_VERSION
public static final int MAJOR_VERSIONLikegetMajorVersion(), but from the headers used at application compile time, rather than from the library linked against at application run time.- See Also:
-
MAX_COMPOSE_LEN
public static final int MAX_COMPOSE_LENEvaluates to the maximum length of a compose sequence.This macro is longer used by GTK.
- See Also:
-
MEDIA_FILE_EXTENSION_POINT_NAME
The default extension point name for media file.- See Also:
-
MICRO_VERSION
public static final int MICRO_VERSIONLikegetMicroVersion(), but from the headers used at application compile time, rather than from the library linked against at application run time.- See Also:
-
MINOR_VERSION
public static final int MINOR_VERSIONLikegetMinorVersion(), but from the headers used at application compile time, rather than from the library linked against at application run time.- See Also:
-
PAPER_NAME_A3
-
PAPER_NAME_A4
-
PAPER_NAME_A5
-
PAPER_NAME_B5
-
PAPER_NAME_EXECUTIVE
-
PAPER_NAME_LEGAL
-
PAPER_NAME_LETTER
-
PRINT_SETTINGS_COLLATE
The key used by the “Print to file” printer to store whether to collate the printed pages.- See Also:
-
PRINT_SETTINGS_DEFAULT_SOURCE
The key used by the “Print to file” printer to store the default source.- See Also:
-
PRINT_SETTINGS_DITHER
The key used by the “Print to file” printer to store the dither used.- See Also:
-
PRINT_SETTINGS_DUPLEX
The key used by the “Print to file” printer to store whether to print the output in duplex.- See Also:
-
PRINT_SETTINGS_FINISHINGS
The key used by the “Print to file” printer to store the finishings.- See Also:
-
PRINT_SETTINGS_MEDIA_TYPE
The key used by the “Print to file” printer to store the media type.The set of media types is defined in PWG 5101.1-2002 PWG.
- See Also:
-
PRINT_SETTINGS_NUMBER_UP
The key used by the “Print to file” printer to store the number of pages per sheet.- See Also:
-
PRINT_SETTINGS_NUMBER_UP_LAYOUT
The key used by the “Print to file” printer to store the number of pages per sheet in number-up mode.- See Also:
-
PRINT_SETTINGS_N_COPIES
The key used by the “Print to file” printer to store the number of copies.- See Also:
-
PRINT_SETTINGS_ORIENTATION
The key used by the “Print to file” printer to store the orientation.- See Also:
-
PRINT_SETTINGS_OUTPUT_BASENAME
The key used by the “Print to file” printer to store the file name of the output without the path to the directory and the file extension.- See Also:
-
PRINT_SETTINGS_OUTPUT_BIN
The key used by the “Print to file” printer to store the output bin.- See Also:
-
PRINT_SETTINGS_OUTPUT_DIR
The key used by the “Print to file” printer to store the directory to which the output should be written.- See Also:
-
PRINT_SETTINGS_OUTPUT_FILE_FORMAT
The key used by the “Print to file” printer to store the format of the output. The supported values are “PS” and “PDF”.- See Also:
-
PRINT_SETTINGS_OUTPUT_URI
The key used by the “Print to file” printer to store the URI to which the output should be written. GTK itself supports only “file://” URIs.- See Also:
-
PRINT_SETTINGS_PAGE_RANGES
The key used by the “Print to file” printer to store the array of page ranges to print.- See Also:
-
PRINT_SETTINGS_PAGE_SET
The key used by the “Print to file” printer to store the set of pages to print.- See Also:
-
PRINT_SETTINGS_PAPER_FORMAT
The key used by the “Print to file” printer to store the page format.- See Also:
-
PRINT_SETTINGS_PAPER_HEIGHT
The key used by the “Print to file” printer to store the page height.- See Also:
-
PRINT_SETTINGS_PAPER_WIDTH
The key used by the “Print to file” printer to store the paper width.- See Also:
-
PRINT_SETTINGS_PRINTER
The key used by the “Print to file” printer to store the printer name.- See Also:
-
PRINT_SETTINGS_PRINTER_LPI
The key used by the “Print to file” printer to store the resolution in lines per inch.- See Also:
-
PRINT_SETTINGS_PRINT_PAGES
The key used by the “Print to file” printer to store which pages to print.- See Also:
-
PRINT_SETTINGS_QUALITY
The key used by the “Print to file” printer to store the printing quality.- See Also:
-
PRINT_SETTINGS_RESOLUTION
The key used by the “Print to file” printer to store the resolution in DPI.- See Also:
-
PRINT_SETTINGS_RESOLUTION_X
The key used by the “Print to file” printer to store the horizontal resolution in DPI.- See Also:
-
PRINT_SETTINGS_RESOLUTION_Y
The key used by the “Print to file” printer to store the vertical resolution in DPI.- See Also:
-
PRINT_SETTINGS_REVERSE
The key used by the “Print to file” printer to store whether to reverse the order of the printed pages.- See Also:
-
PRINT_SETTINGS_SCALE
The key used by the “Print to file” printer to store the scale.- See Also:
-
PRINT_SETTINGS_USE_COLOR
The key used by the “Print to file” printer to store whether to print with colors.- See Also:
-
PRINT_SETTINGS_WIN32_DRIVER_EXTRA
The key used by the “Print to file” printer to store 32-bit Windows extra driver.- See Also:
-
PRINT_SETTINGS_WIN32_DRIVER_VERSION
The key used by the “Print to file” printer to store the 32-bit Windows driver version.- See Also:
-
PRIORITY_RESIZE
public static final int PRIORITY_RESIZEUse this priority for functionality related to size allocation.It is used internally by GTK+ to compute the sizes of widgets. This priority is higher than
GDK_PRIORITY_REDRAWto avoid resizing a widget which was just redrawn.- See Also:
-
STYLE_PROVIDER_PRIORITY_APPLICATION
public static final int STYLE_PROVIDER_PRIORITY_APPLICATIONA priority that can be used when adding aGtkStyleProviderfor application-specific style information.- See Also:
-
STYLE_PROVIDER_PRIORITY_FALLBACK
public static final int STYLE_PROVIDER_PRIORITY_FALLBACKThe priority used for default style information that is used in the absence of themes.Note that this is not very useful for providing default styling for custom style classes - themes are likely to override styling provided at this priority with catch-all
* {...}rules.- See Also:
-
STYLE_PROVIDER_PRIORITY_SETTINGS
public static final int STYLE_PROVIDER_PRIORITY_SETTINGSThe priority used for style information provided viaGtkSettings.This priority is higher than
GTK_STYLE_PROVIDER_PRIORITY_THEMEto let settings override themes.- See Also:
-
STYLE_PROVIDER_PRIORITY_THEME
public static final int STYLE_PROVIDER_PRIORITY_THEMEThe priority used for style information provided by themes.- See Also:
-
STYLE_PROVIDER_PRIORITY_USER
public static final int STYLE_PROVIDER_PRIORITY_USERThe priority used for the style information from$XDG_CONFIG_HOME/gtk-4.0/gtk.css.You should not use priorities higher than this, to give the user the last word.
- See Also:
-
TEXT_VIEW_PRIORITY_VALIDATE
public static final int TEXT_VIEW_PRIORITY_VALIDATEThe priority at which the text view validates onscreen lines in an idle job in the background.- See Also:
-
TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
Deprecated.There is no replacementUses the default sort function in aTreeSortable.See also:
TreeSortable.setSortColumnId(int, org.gnome.gtk.SortType)- See Also:
-
TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID
Deprecated.There is no replacementDisables sorting in aTreeSortable.See also:
TreeSortable.setSortColumnId(int, org.gnome.gtk.SortType)- See Also:
-
-
Constructor Details
-
Gtk
public Gtk()
-
-
Method Details
-
javagi$ensureInitialized
public static void javagi$ensureInitialized() -
acceleratorGetDefaultModMask
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.- Returns:
- the modifier mask for accelerators
-
acceleratorGetLabel
Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.- Parameters:
acceleratorKey- accelerator keyvalacceleratorMods- accelerator modifier mask- Returns:
- a newly-allocated string representing the accelerator
-
acceleratorGetLabel
Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.- Parameters:
acceleratorKey- accelerator keyvalacceleratorMods- accelerator modifier mask- Returns:
- a newly-allocated string representing the accelerator
-
acceleratorGetLabelWithKeycode
public static String acceleratorGetLabelWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, Set<ModifierType> acceleratorMods) 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(int, java.util.Set<org.gnome.gdk.ModifierType>), but handling keycodes. This is only useful for system-level components, applications should useacceleratorGetLabel(int, java.util.Set<org.gnome.gdk.ModifierType>)instead.- Parameters:
display- aGdkDisplayacceleratorKey- accelerator keyvalkeycode- accelerator keycodeacceleratorMods- accelerator modifier mask- Returns:
- a newly-allocated string representing the accelerator
-
acceleratorGetLabelWithKeycode
public static String acceleratorGetLabelWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, ModifierType... acceleratorMods) 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(int, java.util.Set<org.gnome.gdk.ModifierType>), but handling keycodes. This is only useful for system-level components, applications should useacceleratorGetLabel(int, java.util.Set<org.gnome.gdk.ModifierType>)instead.- Parameters:
display- aGdkDisplayacceleratorKey- accelerator keyvalkeycode- accelerator keycodeacceleratorMods- accelerator modifier mask- Returns:
- a newly-allocated string representing the accelerator
-
acceleratorName
Converts an accelerator keyval and modifier mask into a string that can be parsed byacceleratorParse(java.lang.String, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>).For example, if you pass in
GDK_KEY_qandGDK_CONTROL_MASK, this function returns<Control>q.If you need to display accelerators in the user interface, see
acceleratorGetLabel(int, java.util.Set<org.gnome.gdk.ModifierType>).- Parameters:
acceleratorKey- accelerator keyvalacceleratorMods- accelerator modifier mask- Returns:
- a newly-allocated accelerator name
-
acceleratorName
Converts an accelerator keyval and modifier mask into a string that can be parsed byacceleratorParse(java.lang.String, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>).For example, if you pass in
GDK_KEY_qandGDK_CONTROL_MASK, this function returns<Control>q.If you need to display accelerators in the user interface, see
acceleratorGetLabel(int, java.util.Set<org.gnome.gdk.ModifierType>).- Parameters:
acceleratorKey- accelerator keyvalacceleratorMods- accelerator modifier mask- Returns:
- a newly-allocated accelerator name
-
acceleratorNameWithKeycode
public static String acceleratorNameWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, Set<ModifierType> acceleratorMods) Converts an accelerator keyval and modifier mask into a string that can be parsed byacceleratorParseWithKeycode(java.lang.String, org.gnome.gdk.Display, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<int[]>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>).This is similar to
acceleratorName(int, java.util.Set<org.gnome.gdk.ModifierType>)but handling keycodes. This is only useful for system-level components, applications should useacceleratorName(int, java.util.Set<org.gnome.gdk.ModifierType>)instead.- Parameters:
display- aGdkDisplayacceleratorKey- accelerator keyvalkeycode- accelerator keycodeacceleratorMods- accelerator modifier mask- Returns:
- a newly allocated accelerator name.
-
acceleratorNameWithKeycode
public static String acceleratorNameWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, ModifierType... acceleratorMods) Converts an accelerator keyval and modifier mask into a string that can be parsed byacceleratorParseWithKeycode(java.lang.String, org.gnome.gdk.Display, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<int[]>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>).This is similar to
acceleratorName(int, java.util.Set<org.gnome.gdk.ModifierType>)but handling keycodes. This is only useful for system-level components, applications should useacceleratorName(int, java.util.Set<org.gnome.gdk.ModifierType>)instead.- Parameters:
display- aGdkDisplayacceleratorKey- accelerator keyvalkeycode- accelerator keycodeacceleratorMods- accelerator modifier mask- Returns:
- a newly allocated accelerator name.
-
acceleratorParse
public static boolean acceleratorParse(String accelerator, @Nullable Out<Integer> acceleratorKey, @Nullable Out<Set<ModifierType>> acceleratorMods) 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
Gdk.keyvalFromName(java.lang.String). 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 theGdk.ModifierTypemask:<Shift>forGDK_SHIFT_MASK<Ctrl>forGDK_CONTROL_MASK<Alt>forGDK_ALT_MASK<Meta>forGDK_META_MASK<Super>forGDK_SUPER_MASK<Hyper>forGDK_HYPER_MASK
If the parse operation fails,
acceleratorKeyandacceleratorModswill be set to 0 (zero).- Parameters:
accelerator- string representing an acceleratoracceleratorKey- return location for accelerator keyvalacceleratorMods- return location for accelerator modifier mask- Returns:
- whether parsing succeeded
-
acceleratorParseWithKeycode
public static boolean acceleratorParseWithKeycode(String accelerator, @Nullable Display display, @Nullable Out<Integer> acceleratorKey, @Nullable Out<int[]> acceleratorCodes, @Nullable Out<Set<ModifierType>> acceleratorMods) Parses a string representing an accelerator.This is similar to
acceleratorParse(java.lang.String, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>)but handles keycodes as well. This is only useful for system-level components, applications should useacceleratorParse(java.lang.String, org.javagi.base.Out<java.lang.Integer>, org.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>)instead.If
acceleratorCodesis given and the result stored in it is non-null, the result must be freed with g_free().If a keycode is present in the accelerator and no
acceleratorCodesis given, the parse will fail.If the parse fails,
acceleratorKey,acceleratorModsandacceleratorCodeswill be set to 0 (zero).- Parameters:
accelerator- string representing an acceleratordisplay- theGdkDisplayto look upacceleratorCodesinacceleratorKey- return location for accelerator keyvalacceleratorCodes- return location for accelerator keycodesacceleratorMods- return location for accelerator modifier mask- Returns:
- true if parsing succeeded
-
acceleratorValid
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.For example, the
GDK_KEY_akeyval plusGDK_CONTROL_MASKmask is valid, and matches the “Ctrl+a” accelerator. But, you can't, for instance, use theGDK_KEY_Control_Lkeyval as an accelerator.- Parameters:
keyval- a GDK keyvalmodifiers- modifier mask- Returns:
- true if the accelerator is valid
-
acceleratorValid
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.For example, the
GDK_KEY_akeyval plusGDK_CONTROL_MASKmask is valid, and matches the “Ctrl+a” accelerator. But, you can't, for instance, use theGDK_KEY_Control_Lkeyval as an accelerator.- Parameters:
keyval- a GDK keyvalmodifiers- modifier mask- Returns:
- true if the accelerator is valid
-
checkVersion
public static @Nullable String checkVersion(int requiredMajor, int requiredMinor, int requiredMicro) 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_VERSIONas 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
requiredMicro.Second the running library must be binary compatible with the versionrequiredMicro(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 gtk_check_version(), but still get loaded into an application using a newer version of GTK.
- Parameters:
requiredMajor- the required major versionrequiredMinor- the required minor versionrequiredMicro- the required micro version- Returns:
nullif 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.
-
cssParserErrorQuark
Registers an error quark for CSS parsing errors.- Returns:
- the error quark
-
cssParserWarningQuark
Registers an error quark for CSS parsing warnings.- Returns:
- the warning quark
-
disablePortals
public static void disablePortals()Prevents GTK from using portals.This is equivalent to setting
GDK_DEBUG=no-portalsin the environment.This should only be used in portal implementations, apps must not call it.
- Since:
- 4.18
-
disableSetlocale
public static void disableSetlocale()Preventsinit()andinitCheck()from callingsetlocale().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
public static int distributeNaturalAllocation(int extraSpace, @Nullable RequestedSize @Nullable [] sizes) DistributesextraSpaceto childsizesby bringing smaller children up to natural size first.The remaining space will be added to the
minimumSizemember of theGtkRequestedSizestruct. If all sizes reach their natural size then the remaining space is returned.- Parameters:
extraSpace- Extra space to redistribute among children after subtracting minimum sizes and any child padding from the overall allocationsizes- An array of structs with a client pointer and a minimum/natural size in the orientation of the allocation.- Returns:
- The remainder of
extraSpaceafter redistributing space tosizes.
-
enumeratePrinters
Calls a function for all printers that are known to GTK.If
funcreturns true, the enumeration is stopped.- Parameters:
func- a function to call for each printerwait_- if true, wait in a recursive mainloop until all printers are enumerated; otherwise return early
-
getBinaryAge
public static int getBinaryAge()Returns the binary age as passed tolibtool.If
libtoolmeans nothing to you, don't worry about it.- Returns:
- the binary age of the GTK library
-
getDebugFlags
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.
- Returns:
- the GTK debug flags.
-
getDefaultLanguage
Returns thePangoLanguagefor 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.getDefault(). See that function for details.- Returns:
- the default language
-
getInterfaceAge
public static int getInterfaceAge()Returns the interface age as passed tolibtool.If
libtoolmeans nothing to you, don't worry about it.- Returns:
- the interface age of the GTK library
-
getLocaleDirection
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 theGTK_TEXT_DIR_LTRdirection otherwise.GTK_TEXT_DIR_NONEwill never be returned.GTK sets the default text direction according to the locale during
init(), and you should normally useWidget.getDirection()orWidget.getDefaultDirection()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 ()); }- Returns:
- the direction of the current locale
-
getMajorVersion
public static int getMajorVersion()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_VERSIONmacro, which represents the major version of the GTK headers you have included when compiling your code.- Returns:
- the major version number of the GTK library
-
getMicroVersion
public static int getMicroVersion()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_VERSIONmacro, which represents the micro version of the GTK headers you have included when compiling your code.- Returns:
- the micro version number of the GTK library
-
getMinorVersion
public static int getMinorVersion()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_VERSIONmacro, which represents the minor version of the GTK headers you have included when compiling your code.- Returns:
- the minor version number of the GTK library
-
hsvToRgb
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.
- Parameters:
h- Hues- Saturationv- Valuer- Return value for the red componentg- Return value for the green componentb- Return value for the blue component
-
init
public static void init()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.getDefault()).If you are using
Application, you usually don't have to call this function; theApplication.startup()handler does it for you. Though, if you are usingGApplicationmethods that will be invoked beforestartup, such aslocal_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 gtk_init(), but notice that other libraries (e.g. libdbus or gvfs) might do similar things. -
initCheck
public static boolean initCheck()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.
- Returns:
- true if the windowing system has been successfully initialized, false otherwise
-
isInitialized
public static boolean isInitialized()Returns whether GTK has been initialized.See
init().- Returns:
- the initialization status
-
paramSpecExpression
public static ParamSpec paramSpecExpression(String name, String nick, String blurb, Set<ParamFlags> flags) Creates a newGParamSpecinstance for a property holding aGtkExpression.See
g_param_spec_internal()for details on the property strings.- Parameters:
name- canonical name of the propertynick- a user-readable name for the propertyblurb- a user-readable description of the propertyflags- flags for the property- Returns:
- a newly created property specification
-
paramSpecExpression
public static ParamSpec paramSpecExpression(String name, String nick, String blurb, ParamFlags... flags) Creates a newGParamSpecinstance for a property holding aGtkExpression.See
g_param_spec_internal()for details on the property strings.- Parameters:
name- canonical name of the propertynick- a user-readable name for the propertyblurb- a user-readable description of the propertyflags- flags for the property- Returns:
- a newly created property specification
-
printRunPageSetupDialog
public static PageSetup printRunPageSetupDialog(@Nullable Window parent, @Nullable PageSetup pageSetup, PrintSettings settings) Runs a page setup dialog, letting the user modify the values frompageSetup.If the user cancels the dialog, the returned
GtkPageSetupis identical to the passed inpageSetup,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(org.gnome.gtk.Window, org.gnome.gtk.PageSetup, org.gnome.gtk.PrintSettings, org.gnome.gtk.PageSetupDoneFunc)if this is a problem.- Parameters:
parent- transient parentpageSetup- an existingGtkPageSetupsettings- aGtkPrintSettings- Returns:
- a new
GtkPageSetup
-
printRunPageSetupDialogAsync
public static void printRunPageSetupDialogAsync(@Nullable Window parent, @Nullable PageSetup pageSetup, PrintSettings settings, @Nullable PageSetupDoneFunc doneCb) Runs a page setup dialog, letting the user modify the values frompageSetup.In contrast to
printRunPageSetupDialog(org.gnome.gtk.Window, org.gnome.gtk.PageSetup, org.gnome.gtk.PrintSettings), this function returns after showing the page setup dialog on platforms that support this, and callsdoneCbfrom a signal handler for the ::response signal of the dialog.- Parameters:
parent- transient parentpageSetup- an existingGtkPageSetupsettings- aGtkPrintSettingsdoneCb- a function to call when the user saves the modified page setup
-
renderActivity
@Deprecated public static void renderActivity(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.Renders an activity indicator (such as inGtkSpinner). The stateStateFlags.CHECKEDdetermines whether there is activity going on.- Parameters:
context- aGtkStyleContextcr- acairo_tx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderArrow
@Deprecated public static void renderArrow(StyleContext context, org.freedesktop.cairo.Context cr, double angle, double x, double y, double size) Deprecated.Renders an arrow pointing toangle.Typical arrow rendering at 0, 1⁄2 π;, π; and 3⁄2 π:

- Parameters:
context- aGtkStyleContextcr- acairo_tangle- arrow angle from 0 to 2 *G_PI, being 0 the arrow pointing to the northx- X origin of the render areay- Y origin of the render areasize- square side for render area
-
renderBackground
@Deprecated public static void renderBackground(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.Renders the background of an element.Typical background rendering, showing the effect of
background-image,border-widthandborder-radius:
- Parameters:
context- aGtkStyleContextcr- acairo_tx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderCheck
@Deprecated public static void renderCheck(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.Renders a checkmark (as in aGtkCheckButton).The
StateFlags.CHECKEDstate determines whether the check is on or off, andStateFlags.INCONSISTENTdetermines whether it should be marked as undefined.Typical checkmark rendering:

- Parameters:
context- aGtkStyleContextcr- acairo_tx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderExpander
@Deprecated public static void renderExpander(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.Renders an expander (as used inGtkTreeViewandGtkExpander) in the area defined byx,y,width,height.The stateStateFlags.CHECKEDdetermines whether the expander is collapsed or expanded.Typical expander rendering:

- Parameters:
context- aGtkStyleContextcr- acairo_tx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderFocus
@Deprecated public static void renderFocus(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.Renders a focus indicator on the rectangle determined byx,y,width,height.Typical focus rendering:

- Parameters:
context- aGtkStyleContextcr- acairo_tx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderFrame
@Deprecated public static void renderFrame(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.Renders a frame around the rectangle defined byx,y,width,height.Examples of frame rendering, showing the effect of
border-image,border-color,border-width,border-radiusand junctions:
- Parameters:
context- aGtkStyleContextcr- acairo_tx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderHandle
@Deprecated public static void renderHandle(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.Renders a handle (as inGtkPanedandGtkWindow’s resize grip), in the rectangle determined byx,y,width,height.Handles rendered for the paned and grip classes:

- Parameters:
context- aGtkStyleContextcr- acairo_tx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderIcon
@Deprecated public static void renderIcon(StyleContext context, org.freedesktop.cairo.Context cr, Texture texture, double x, double y) Deprecated.Renders the icon intextureat the specifiedxandycoordinates.This function will render the icon in
textureat exactly its size, regardless of scaling factors, which may not be appropriate when drawing on displays with high pixel densities.- Parameters:
context- aGtkStyleContextcr- acairo_ttexture- aGdkTexturecontaining the icon to drawx- X position for thetexturey- Y position for thetexture
-
renderLayout
@Deprecated public static void renderLayout(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, Layout layout) Deprecated.Renderslayouton the coordinatesx,y- Parameters:
context- aGtkStyleContextcr- acairo_tx- X originy- Y originlayout- thePangoLayoutto render
-
renderLine
@Deprecated public static void renderLine(StyleContext context, org.freedesktop.cairo.Context cr, double x0, double y0, double x1, double y1) Deprecated.Renders a line from (x0, y0) to (x1, y1).- Parameters:
context- aGtkStyleContextcr- acairo_tx0- X coordinate for the origin of the liney0- Y coordinate for the origin of the linex1- X coordinate for the end of the liney1- Y coordinate for the end of the line
-
renderOption
@Deprecated public static void renderOption(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.Renders an option mark (as in a radio button), theStateFlags.CHECKEDstate will determine whether the option is on or off, andStateFlags.INCONSISTENTwhether it should be marked as undefined.Typical option mark rendering:

- Parameters:
context- aGtkStyleContextcr- acairo_tx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
rgbToHsv
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.
- Parameters:
r- Redg- Greenb- Blueh- Return value for the hue components- Return value for the saturation componentv- Return value for the value component
-
setDebugFlags
Sets the GTK debug flags.- Parameters:
flags- the debug flags to set
-
setDebugFlags
Sets the GTK debug flags.- Parameters:
flags- the debug flags to set
-
showAboutDialog
public static void showAboutDialog(@Nullable Window parent, String firstPropertyName, Object... varargs) A convenience function for showing an application’s about dialog.The constructed dialog is associated with the parent window and reused for future invocations of this function.
- Parameters:
parent- the parent top-level windowfirstPropertyName- the name of the first propertyvarargs- value of first property, followed by more pairs of property name and value,NULL-terminated
-
showUri
Deprecated.This function launches the default application for showing a given uri, or shows an error dialog if that fails.- Parameters:
parent- parent windowuri- the uri to showtimestamp- timestamp from the event that triggered this call, orGDK_CURRENT_TIME
-
showUriFull
@Deprecated public static void showUriFull(@Nullable Window parent, String uri, int timestamp, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Deprecated.This function launches the default application for showing a given uri.The
callbackwill 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.
- Parameters:
parent- parent windowuri- the uri to showtimestamp- timestamp from the event that triggered this call, orGDK_CURRENT_TIMEcancellable- aGCancellableto cancel the launchcallback- a callback to call when the action is complete
-
showUriFullFinish
@Deprecated public static boolean showUriFullFinish(Window parent, AsyncResult result) throws GErrorException Deprecated.Finishes the gtk_show_uri() call and returns the result of the operation.- Parameters:
parent- theGtkWindowpassed to gtk_show_uri()result-GAsyncResultthat was passed tocallback- Returns:
trueif the URI was shown successfully. Otherwise,falseis returned anderroris set- Throws:
GErrorException- seeGError
-
testAccessibleAssertionMessageRole
public static void testAccessibleAssertionMessageRole(String domain, String file, int line, String func, String expr, Accessible accessible, AccessibleRole expectedRole, AccessibleRole actualRole) Prints an assertion message for gtk_test_accessible_assert_role().- Parameters:
domain- a domainfile- a file nameline- the line infilefunc- a function name infileexpr- the expression being testedaccessible- aGtkAccessibleexpectedRole- the expectedGtkAccessibleRoleactualRole- the actualGtkAccessibleRole
-
testAccessibleCheckProperty
public static String testAccessibleCheckProperty(Accessible accessible, AccessibleProperty property, Object... varargs) Checks whether the accessiblepropertyofaccessibleis set to a specific value.- Parameters:
accessible- aGtkAccessibleproperty- aGtkAccessiblePropertyvarargs- the expected value ofproperty- Returns:
- the value of the accessible property
-
testAccessibleCheckRelation
public static String testAccessibleCheckRelation(Accessible accessible, AccessibleRelation relation, Object... varargs) Checks whether the accessiblerelationofaccessibleis set to a specific value.- Parameters:
accessible- aGtkAccessiblerelation- aGtkAccessibleRelationvarargs- the expected value ofrelation- Returns:
- the value of the accessible relation
-
testAccessibleCheckState
public static String testAccessibleCheckState(Accessible accessible, AccessibleState state, Object... varargs) Checks whether the accessiblestateofaccessibleis set to a specific value.- Parameters:
accessible- aGtkAccessiblestate- aGtkAccessibleStatevarargs- the expected value ofstate- Returns:
- the value of the accessible state
-
testAccessibleHasProperty
Checks whether theGtkAccessiblehaspropertyset.- Parameters:
accessible- aGtkAccessibleproperty- aGtkAccessibleProperty- Returns:
trueif thepropertyis set in theaccessible
-
testAccessibleHasRelation
Checks whether theGtkAccessiblehasrelationset.- Parameters:
accessible- aGtkAccessiblerelation- aGtkAccessibleRelation- Returns:
trueif therelationis set in theaccessible
-
testAccessibleHasRole
Checks whether theGtkAccessible:accessible-roleof the accessible isrole.- Parameters:
accessible- aGtkAccessiblerole- aGtkAccessibleRole- Returns:
trueif the role matches
-
testAccessibleHasState
Checks whether theGtkAccessiblehasstateset.- Parameters:
accessible- aGtkAccessiblestate- aGtkAccessibleState- Returns:
trueif thestateis set in theaccessible
-
testInit
This function is used to initialize a GTK test program.It will in turn call g_test_init() and gtk_init() to properly initialize the testing framework and graphical toolkit. It’ll also set the program’s locale to “C”. This is done to make test program environments as deterministic as possible.
Like gtk_init() and g_test_init(), any known arguments will be processed and stripped from
argcandargv.- Parameters:
argvp- Address of theargvparameter of main(). Any parameters understood by g_test_init() or gtk_init() are stripped before return.varargs- currently unused
-
testListAllTypes
Return the type ids that have been registered after calling gtk_test_register_all_types().- Returns:
- 0-terminated array of type ids
-
testRegisterAllTypes
public static void testRegisterAllTypes()Force registration of all core GTK object types.This allows to refer to any of those object types via g_type_from_name() after calling this function.
-
testWidgetWaitForDraw
Enters the main loop and waits forwidgetto be “drawn”.In this context that means it waits for the frame clock of
widgetto have run a full styling, layout and drawing cycle.This function is intended to be used for syncing with actions that depend on
widgetrelayouting or on interaction with the display server.- Parameters:
widget- the widget to wait for
-
treeCreateRowDragContent
@Deprecated public static ContentProvider treeCreateRowDragContent(TreeModel treeModel, TreePath path) Deprecated.Use list models insteadCreates a content provider for draggingpathfromtreeModel.- Parameters:
treeModel- aGtkTreeModelpath- a row intreeModel- Returns:
- a new
GdkContentProvider
-
treeGetRowDragData
@Deprecated public static boolean treeGetRowDragData(Value value, @Nullable Out<TreeModel> treeModel, @Nullable Out<TreePath> path) Deprecated.Use list models insteadObtains atreeModelandpathfrom value of target typeGTK_TYPE_TREE_ROW_DATA.The returned path must be freed with gtk_tree_path_free().
- Parameters:
value- aGValuetreeModel- aGtkTreeModelpath- row intreeModel- Returns:
trueifselectionDatahad target typeGTK_TYPE_TREE_ROW_DATAis otherwise valid
-
valueDupExpression
Retrieves theGtkExpressionstored inside the givenvalue, and acquires a reference to it.- Parameters:
value- aGValueinitialized with typeGTK_TYPE_EXPRESSION- Returns:
- a
GtkExpression
-
valueGetExpression
Retrieves theGtkExpressionstored inside the givenvalue.- Parameters:
value- aGValueinitialized with typeGTK_TYPE_EXPRESSION- Returns:
- a
GtkExpression
-
valueSetExpression
Stores the givenGtkExpressioninsidevalue.The
GValuewill acquire a reference to theexpression.- Parameters:
value- aGValueinitialized with typeGTK_TYPE_EXPRESSIONexpression- aGtkExpression
-
valueTakeExpression
Stores the givenGtkExpressioninsidevalue.This function transfers the ownership of the
expressionto theGValue.- Parameters:
value- aGValueinitialized with typeGTK_TYPE_EXPRESSIONexpression- aGtkExpression
-
initAbiCheck
public static void initAbiCheck(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) -
initCheckAbiCheck
public static boolean initCheckAbiCheck(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) -
styleContextAddProviderForDisplay
public static void styleContextAddProviderForDisplay(Display display, StyleProvider provider, int priority) Adds a global style provider todisplay,which will be used in style construction for allGtkStyleContextsunderdisplay.GTK uses this to make styling information from
GtkSettingsavailable.Note: If both priorities are the same, A
GtkStyleProvideradded throughStyleContext.addProvider(org.gnome.gtk.StyleProvider, int)takes precedence over another added through this function.- Parameters:
display- aGdkDisplayprovider- aGtkStyleProviderpriority- the priority of the style provider. The lower it is, the earlier it will be used in the style construction. Typically this will be in the range betweenGTK_STYLE_PROVIDER_PRIORITY_FALLBACKandGTK_STYLE_PROVIDER_PRIORITY_USER
-
styleContextRemoveProviderForDisplay
Removesproviderfrom the global style providers list indisplay.- Parameters:
display- aGdkDisplayprovider- aGtkStyleProvider
-