Class Gtk
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
An attribute for the background color, expressed as an RGB value encoded in a string using the format:{r8},{g8},{b8}
.static final String
An attribute for the font family name.static final String
An attribute for the foreground color, expressed as an RGB value encoded in a string using the format:{r8},{g8},{b8}
.static final String
An attribute for the overline style.static final String
The "none" overline value forGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE
.static final String
The "single" overline value forGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE
.static final String
An attribute for the font size, expressed in points.static final String
An attribute for the font stretch type.static final String
The "condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
The "expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
The "extra condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
The "extra expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
The "normal" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
The "semi condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
The "semi expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
The "ultra condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
The "ultra expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.static final String
An attribute for strikethrough text.static final String
An attribute for the font style.static final String
The "italic" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE
.static final String
The "normal" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE
.static final String
The "oblique" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE
.static final String
An attribute for the underline style.static final String
The "double" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE
.static final String
The "error" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE
.static final String
The "none" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE
.static final String
The "single" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE
.static final String
An attribute for the font variant.static final String
The "all petite caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.static final String
The "all small caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.static final String
The "petite caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.static final String
The "small caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.static final String
The "title caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.static final String
The "unicase" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.static final String
An attribute for the font weight.static final int
An undefined value.static final int
LikegetBinaryAge()
, but from the headers used at application compile time, rather than from the library linked against at application run time.static final String
The default name of the extension point.static final int
Constant to return from a signal handler for the ::input signal in case of conversion failure.static final int
LikegetInterfaceAge()
, but from the headers used at application compile time, rather than from the library linked against at application run time.static final int
The value used to refer to a guaranteed invalid position in aGListModel
.static final String
The name used for the stock full offset included byGtkLevelBar
.static final String
The name used for the stock high offset included byGtkLevelBar
.static final String
The name used for the stock low offset included byGtkLevelBar
.static final int
LikegetMajorVersion()
, but from the headers used at application compile time, rather than from the library linked against at application run time.static final int
Evaluates to the maximum length of a compose sequence.static final String
The default extension point name for media file.static final int
LikegetMicroVersion()
, but from the headers used at application compile time, rather than from the library linked against at application run time.static final int
LikegetMinorVersion()
, but from the headers used at application compile time, rather than from the library linked against at application run time.static final String
Name for the A3 paper size.static final String
Name for the A4 paper size.static final String
Name for the A5 paper size.static final String
Name for the B5 paper size.static final String
Name for the Executive paper size.static final String
Name for the Legal paper size.static final String
Name for the Letter paper size.static final String
The key used by the “Print to file” printer to store whether to collate the printed pages.static final String
The key used by the “Print to file” printer to store the default source.static final String
The key used by the “Print to file” printer to store the dither used.static final String
The key used by the “Print to file” printer to store whether to print the output in duplex.static final String
The key used by the “Print to file” printer to store the finishings.static final String
The key used by the “Print to file” printer to store the media type.static final String
The key used by the “Print to file” printer to store the number of copies.static final String
The key used by the “Print to file” printer to store the number of pages per sheet.static final String
The key used by the “Print to file” printer to store the number of pages per sheet in number-up mode.static final String
The key used by the “Print to file” printer to store the orientation.static final String
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.static final String
The key used by the “Print to file” printer to store the output bin.static final String
The key used by the “Print to file” printer to store the directory to which the output should be written.static final String
The key used by the “Print to file” printer to store the format of the output.static final String
The key used by the “Print to file” printer to store the URI to which the output should be written.static final String
The key used by the “Print to file” printer to store the array of page ranges to print.static final String
The key used by the “Print to file” printer to store the set of pages to print.static final String
The key used by the “Print to file” printer to store the page format.static final String
The key used by the “Print to file” printer to store the page height.static final String
The key used by the “Print to file” printer to store the paper width.static final String
The key used by the “Print to file” printer to store which pages to print.static final String
The key used by the “Print to file” printer to store the printer name.static final String
The key used by the “Print to file” printer to store the resolution in lines per inch.static final String
The key used by the “Print to file” printer to store the printing quality.static final String
The key used by the “Print to file” printer to store the resolution in DPI.static final String
The key used by the “Print to file” printer to store the horizontal resolution in DPI.static final String
The key used by the “Print to file” printer to store the vertical resolution in DPI.static final String
The key used by the “Print to file” printer to store whether to reverse the order of the printed pages.static final String
The key used by the “Print to file” printer to store the scale.static final String
The key used by the “Print to file” printer to store whether to print with colors.static final String
The key used by the “Print to file” printer to store 32-bit Windows extra driver.static final String
The key used by the “Print to file” printer to store the 32-bit Windows driver version.static final int
Use this priority for functionality related to size allocation.static final int
A priority that can be used when adding aGtkStyleProvider
for application-specific style information.static final int
The priority used for default style information that is used in the absence of themes.static final int
The priority used for style information provided viaGtkSettings
.static final int
The priority used for style information provided by themes.static final int
The priority used for the style information from$XDG_CONFIG_HOME/gtk-4.0/gtk.css
.static final int
The priority at which the text view validates onscreen lines in an idle job in the background.static final int
Uses the default sort function in aTreeSortable
.static final int
Disables sorting in aTreeSortable
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Set
<ModifierType> Gets the modifier mask.static String
acceleratorGetLabel
(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 String
acceleratorGetLabel
(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 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.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.static String
acceleratorName
(int acceleratorKey, Set<ModifierType> acceleratorMods) Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse().static String
acceleratorName
(int acceleratorKey, ModifierType... acceleratorMods) Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse().static String
acceleratorNameWithKeycode
(@Nullable Display display, int acceleratorKey, int keycode, Set<ModifierType> acceleratorMods) Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse_with_keycode().static String
acceleratorNameWithKeycode
(@Nullable Display display, int acceleratorKey, int keycode, ModifierType... acceleratorMods) Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse_with_keycode().static boolean
acceleratorParse
(String accelerator, @Nullable Out<Integer> acceleratorKey, @Nullable Out<Set<ModifierType>> acceleratorMods) Parses a string representing an accelerator.static boolean
acceleratorParseWithKeycode
(String accelerator, @Nullable Display display, @Nullable Out<Integer> acceleratorKey, @org.jetbrains.annotations.Nullable int[] acceleratorCodes, @Nullable Out<Set<ModifierType>> acceleratorMods) Parses a string representing an accelerator.static boolean
acceleratorValid
(int keyval, Set<ModifierType> modifiers) Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.static boolean
acceleratorValid
(int keyval, ModifierType... modifiers) Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.static String
checkVersion
(int requiredMajor, int requiredMinor, int requiredMicro) Checks that the GTK library in use is compatible with the given version.static Quark
Registers an error quark for CSS parsing errors.static Quark
Registers an error quark for CSS parsing warnings.static void
static int
distributeNaturalAllocation
(int extraSpace, RequestedSize[] sizes) DistributesextraSpace
to childsizes
by bringing smaller children up to natural size first.static void
enumeratePrinters
(PrinterFunc func, boolean wait_) Calls a function for allGtkPrinter
s.static int
Returns the binary age as passed tolibtool
.static Set
<DebugFlags> Returns the GTK debug flags that are currently active.static Language
Returns thePangoLanguage
for the default language currently in effect.static int
Returns the interface age as passed tolibtool
.static TextDirection
Get the direction of the current locale.static int
Returns the major version number of the GTK library.static int
Returns the micro version number of the GTK library.static int
Returns the minor version number of the GTK library.static void
Converts a color from HSV space to RGB.static void
init()
Call this function before using any other GTK functions in your GUI applications.static void
initAbiCheck
(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) static boolean
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.static boolean
initCheckAbiCheck
(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) static boolean
Use this function to check if GTK has been initialized.static void
static ParamSpec
paramSpecExpression
(String name, String nick, String blurb, Set<ParamFlags> flags) Creates a newGParamSpec
instance for a property holding aGtkExpression
.static ParamSpec
paramSpecExpression
(String name, String nick, String blurb, ParamFlags... flags) Creates a newGParamSpec
instance for a property holding aGtkExpression
.static PageSetup
printRunPageSetupDialog
(@Nullable Window parent, @Nullable PageSetup pageSetup, PrintSettings settings) Runs a page setup dialog, letting the user modify the values frompageSetup
.static void
printRunPageSetupDialogAsync
(@Nullable Window parent, @Nullable PageSetup pageSetup, PrintSettings settings, PageSetupDoneFunc doneCb) Runs a page setup dialog, letting the user modify the values frompageSetup
.static void
renderActivity
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static void
renderArrow
(StyleContext context, org.freedesktop.cairo.Context cr, double angle, double x, double y, double size) Deprecated.static void
renderBackground
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static void
renderCheck
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static void
renderExpander
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static void
renderFocus
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static void
renderFrame
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static void
renderHandle
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static void
renderIcon
(StyleContext context, org.freedesktop.cairo.Context cr, Texture texture, double x, double y) Deprecated.static void
renderLayout
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, Layout layout) Deprecated.static void
renderLine
(StyleContext context, org.freedesktop.cairo.Context cr, double x0, double y0, double x1, double y1) Deprecated.static void
renderOption
(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, double width, double height) Deprecated.static void
Converts a color from RGB space to HSV.static void
setDebugFlags
(Set<DebugFlags> flags) Sets the GTK debug flags.static void
setDebugFlags
(DebugFlags... flags) Sets the GTK debug flags.static void
showAboutDialog
(@Nullable Window parent, String firstPropertyName, Object... varargs) A convenience function for showing an application’s about dialog.static void
Deprecated.static void
showUriFull
(@Nullable Window parent, String uri, int timestamp, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) static boolean
showUriFullFinish
(Window parent, AsyncResult result) static void
styleContextAddProviderForDisplay
(Display display, StyleProvider provider, int priority) Adds a global style provider todisplay
, which will be used in style construction for allGtkStyleContexts
underdisplay
.static void
styleContextRemoveProviderForDisplay
(Display display, StyleProvider provider) Removesprovider
from the global style providers list indisplay
.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().static String
testAccessibleCheckProperty
(Accessible accessible, AccessibleProperty property, Object... varargs) Checks whether the accessibleproperty
ofaccessible
is set to a specific value.static String
testAccessibleCheckRelation
(Accessible accessible, AccessibleRelation relation, Object... varargs) Checks whether the accessiblerelation
ofaccessible
is set to a specific value.static String
testAccessibleCheckState
(Accessible accessible, AccessibleState state, Object... varargs) Checks whether the accessiblestate
ofaccessible
is set to a specific value.static boolean
testAccessibleHasProperty
(Accessible accessible, AccessibleProperty property) Checks whether theGtkAccessible
hasproperty
set.static boolean
testAccessibleHasRelation
(Accessible accessible, AccessibleRelation relation) Checks whether theGtkAccessible
hasrelation
set.static boolean
testAccessibleHasRole
(Accessible accessible, AccessibleRole role) Checks whether theGtkAccessible:accessible-role
of the accessible isrole
.static boolean
testAccessibleHasState
(Accessible accessible, AccessibleState state) Checks whether theGtkAccessible
hasstate
set.static void
This 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 void
Force registration of all core GTK object types.static void
testWidgetWaitForDraw
(Widget widget) Enters the main loop and waits forwidget
to be “drawn”.static ContentProvider
treeCreateRowDragContent
(TreeModel treeModel, TreePath path) Deprecated.Use list models insteadstatic boolean
Deprecated.Use list models insteadstatic Expression
valueDupExpression
(Value value) Retrieves theGtkExpression
stored inside the givenvalue
, and acquires a reference to it.static Expression
valueGetExpression
(Value value) Retrieves theGtkExpression
stored inside the givenvalue
.static void
valueSetExpression
(Value value, Expression expression) Stores the givenGtkExpression
insidevalue
.static void
valueTakeExpression
(Value value, @Nullable Expression expression) Stores the givenGtkExpression
insidevalue
.
-
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}
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_FAMILY
An attribute for the font family name.- 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}
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_OVERLINE
An attribute for the overline style.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE
Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE
- See Also:
-
ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE
The "none" overline value forGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE
The "single" overline value forGtk.ACCESSIBLE_ATTRIBUTE_OVERLINE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_SIZE
An attribute for the font size, expressed in points.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH
An attribute for the font stretch type.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED
Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED
Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED
Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED
The "condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_EXPANDED
The "expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED
The "extra condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_EXPANDED
The "extra expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_NORMAL
The "normal" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED
The "semi condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_EXPANDED
The "semi expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED
The "ultra condensed" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_EXPANDED
The "ultra expanded" stretch value forGtk.ACCESSIBLE_ATTRIBUTE_STRETCH
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STRIKETHROUGH
An attribute for strikethrough text.Possible values are
true
orfalse
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STYLE
An attribute for the font style.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL
Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE
Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC
- See Also:
-
ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC
The "italic" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL
The "normal" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE
The "oblique" style value forGtk.ACCESSIBLE_ATTRIBUTE_STYLE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE
An attribute for the underline style.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE
Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE
Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE
Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR
- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE
The "double" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR
The "error" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE
The "none" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE
The "single" underline value forGtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT
An attribute for the font variant.Possible values are:
Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS
Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS
Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS
Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS
Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE
Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS
- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS
The "all petite caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS
The "all small caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS
The "petite caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS
The "small caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS
The "title caps" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE
The "unicase" variant value forGtk.ACCESSIBLE_ATTRIBUTE_VARIANT
.- See Also:
-
ACCESSIBLE_ATTRIBUTE_WEIGHT
-
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_REDRAW
to 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 aGtkStyleProvider
for 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_THEME
to 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
public static final int TREE_SORTABLE_DEFAULT_SORT_COLUMN_IDUses the default sort function in aTreeSortable
.See also:
TreeSortable.setSortColumnId(int, org.gnome.gtk.SortType)
- See Also:
-
TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID
public static final int TREE_SORTABLE_UNSORTED_SORT_COLUMN_IDDisables 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
ModifierType.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 @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
- aGdkDisplay
ornull
to use the default displayacceleratorKey
- accelerator keyvalkeycode
- accelerator keycodeacceleratorMods
- accelerator modifier mask- Returns:
- a newly-allocated string representing the accelerator
-
acceleratorGetLabelWithKeycode
public static String acceleratorGetLabelWithKeycode(@Nullable @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
- aGdkDisplay
ornull
to use the default displayacceleratorKey
- 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 parseable by gtk_accelerator_parse().For example, if you pass in
GDK_KEY_q
andModifierType.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 parseable by gtk_accelerator_parse().For example, if you pass in
GDK_KEY_q
andModifierType.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 @Nullable Display display, int acceleratorKey, int keycode, Set<ModifierType> acceleratorMods) Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse_with_keycode().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
- aGdkDisplay
ornull
to use the default displayacceleratorKey
- accelerator keyvalkeycode
- accelerator keycodeacceleratorMods
- accelerator modifier mask- Returns:
- a newly allocated accelerator name.
-
acceleratorNameWithKeycode
public static String acceleratorNameWithKeycode(@Nullable @Nullable Display display, int acceleratorKey, int keycode, ModifierType... acceleratorMods) Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse_with_keycode().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
- aGdkDisplay
ornull
to use the default displayacceleratorKey
- accelerator keyvalkeycode
- accelerator keycodeacceleratorMods
- accelerator modifier mask- Returns:
- a newly allocated accelerator name.
-
acceleratorParse
public static boolean acceleratorParse(String accelerator, @Nullable @Nullable Out<Integer> acceleratorKey, @Nullable @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.ModifierType
mask:<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,
acceleratorKey
andacceleratorMods
will 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 @Nullable Display display, @Nullable @Nullable Out<Integer> acceleratorKey, @Nullable @org.jetbrains.annotations.Nullable int[] acceleratorCodes, @Nullable @Nullable Out<Set<ModifierType>> acceleratorMods) Parses a string representing an accelerator.This is similar to
acceleratorParse(java.lang.String, io.github.jwharm.javagi.base.Out<java.lang.Integer>, io.github.jwharm.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, io.github.jwharm.javagi.base.Out<java.lang.Integer>, io.github.jwharm.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>)
instead.If
acceleratorCodes
is 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
acceleratorCodes
is given, the parse will fail.If the parse fails,
acceleratorKey
,acceleratorMods
andacceleratorCodes
will be set to 0 (zero).- Parameters:
accelerator
- string representing an acceleratordisplay
- theGdkDisplay
to look upacceleratorCodes
inacceleratorKey
- 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_a
keyval plusModifierType.CONTROL_MASK
mark is valid, and matches the “Ctrl+a” accelerator. But, you can't, for instance, use theGDK_KEY_Control_L
keyval 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_a
keyval plusModifierType.CONTROL_MASK
mark is valid, and matches the “Ctrl+a” accelerator. But, you can't, for instance, use theGDK_KEY_Control_L
keyval as an accelerator.- Parameters:
keyval
- a GDK keyvalmodifiers
- modifier mask- Returns:
true
if the accelerator is valid
-
checkVersion
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
requiredMajor
.required_minor.requiredMicro
. Second the running library must be binary compatible with the versionrequiredMajor
.required_minor.requiredMicro
(same major version.)This function is primarily for GTK modules; the module can call this function to check that it wasn’t loaded into an incompatible version of GTK. However, such a check isn’t completely reliable, since the module may be linked against an old version of GTK and calling the old version of 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:
null
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.
-
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
-
disableSetlocale
public static void disableSetlocale()Preventsinit()
andinitCheck()
from automatically callingsetlocale (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.
-
distributeNaturalAllocation
DistributesextraSpace
to childsizes
by bringing smaller children up to natural size first.The remaining space will be added to the
minimumSize
member of theGtkRequestedSize
struct. 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
extraSpace
after redistributing space tosizes
.
-
enumeratePrinters
Calls a function for allGtkPrinter
s.If
func
returnstrue
, the enumeration is stopped.- Parameters:
func
- a function to call for each printerwait_
- iftrue
, 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
libtool
means 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 thePangoLanguage
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.getDefault()
. See that function for details.- Returns:
- the default language
-
getInterfaceAge
public static int getInterfaceAge()Returns the interface age as passed tolibtool
.If
libtool
means nothing to you, don't worry about it.- Returns:
- the interface age of the GTK library
-
getLocaleDirection
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
TextDirection.LTR
direction otherwise.TextDirection.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:
#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_VERSION
macro, 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_VERSION
macro, 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_VERSION
macro, 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()Call this function before using any other GTK functions in your GUI applications. It will initialize everything needed to operate the toolkit.If you are using
GtkApplication
, you usually don't have to call this function; theGApplication::startup
handler does it for you. Though, if you are using GApplication methods that will be invoked beforestartup
, such aslocal_command_line
, you may need to initialize stuff 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()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 returnsfalse
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()Use this function to check if 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 newGParamSpec
instance 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 newGParamSpec
instance 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 @Nullable Window parent, @Nullable @Nullable PageSetup pageSetup, PrintSettings settings) Runs a page setup dialog, letting the user modify the values frompageSetup
. If the user cancels the dialog, the returnedGtkPageSetup
is 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 gtk_print_run_page_setup_dialog_async() if this is a problem.
- Parameters:
parent
- transient parentpageSetup
- an existingGtkPageSetup
settings
- aGtkPrintSettings
- Returns:
- a new
GtkPageSetup
-
printRunPageSetupDialogAsync
public static void printRunPageSetupDialogAsync(@Nullable @Nullable Window parent, @Nullable @Nullable PageSetup pageSetup, PrintSettings settings, PageSetupDoneFunc doneCb) Runs a page setup dialog, letting the user modify the values frompageSetup
.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
doneCb
from a signal handler for the ::response signal of the dialog.- Parameters:
parent
- transient parentpageSetup
- an existingGtkPageSetup
settings
- aGtkPrintSettings
doneCb
- 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.CHECKED
determines whether there is activity going on.- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
x
- 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
- aGtkStyleContext
cr
- acairo_t
angle
- 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-width
andborder-radius
:- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
x
- 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.CHECKED
state determines whether the check is on or off, andStateFlags.INCONSISTENT
determines whether it should be marked as undefined.Typical checkmark rendering:
- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
x
- 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 inGtkTreeView
andGtkExpander
) in the area defined byx
,y
,width
,height
. The stateStateFlags.CHECKED
determines whether the expander is collapsed or expanded.Typical expander rendering:
- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
x
- 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
- aGtkStyleContext
cr
- acairo_t
x
- 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-radius
and junctions:- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
x
- 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 inGtkPaned
andGtkWindow
’s resize grip), in the rectangle determined byx
,y
,width
,height
.Handles rendered for the paned and grip classes:
- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
x
- 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 intexture
at the specifiedx
andy
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.- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
texture
- aGdkTexture
containing the icon to drawx
- X position for thetexture
y
- Y position for thetexture
-
renderLayout
@Deprecated public static void renderLayout(StyleContext context, org.freedesktop.cairo.Context cr, double x, double y, Layout layout) Deprecated.Renderslayout
on the coordinatesx
,y
- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
x
- X originy
- Y originlayout
- thePangoLayout
to 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
- aGtkStyleContext
cr
- acairo_t
x0
- 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.CHECKED
state will determine whether the option is on or off, andStateFlags.INCONSISTENT
whether it should be marked as undefined.Typical option mark rendering:
- Parameters:
context
- aGtkStyleContext
cr
- acairo_t
x
- 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 @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 public static void showUri(@Nullable @Nullable Window parent, String uri, int timestamp) 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 @Nullable Window parent, String uri, int timestamp, @Nullable @Nullable Cancellable cancellable, @Nullable @Nullable AsyncReadyCallback callback) Deprecated.This function launches the default application for showing a given uri.The
callback
will be called when the launch is completed.This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly.
- Parameters:
parent
- parent windowuri
- the uri to showtimestamp
- timestamp from the event that triggered this call, orGDK_CURRENT_TIME
cancellable
- aGCancellable
to 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
- theGtkWindow
passed to gtk_show_uri()result
-GAsyncResult
that was passed tocallback
- Returns:
true
if the URI was shown successfully. Otherwise,false
is returned anderror
is 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 infile
func
- a function name infile
expr
- the expression being testedaccessible
- aGtkAccessible
expectedRole
- the expectedGtkAccessibleRole
actualRole
- the actualGtkAccessibleRole
-
testAccessibleCheckProperty
public static String testAccessibleCheckProperty(Accessible accessible, AccessibleProperty property, Object... varargs) Checks whether the accessibleproperty
ofaccessible
is set to a specific value.- Parameters:
accessible
- aGtkAccessible
property
- aGtkAccessibleProperty
varargs
- 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 accessiblerelation
ofaccessible
is set to a specific value.- Parameters:
accessible
- aGtkAccessible
relation
- aGtkAccessibleRelation
varargs
- 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 accessiblestate
ofaccessible
is set to a specific value.- Parameters:
accessible
- aGtkAccessible
state
- aGtkAccessibleState
varargs
- the expected value ofstate
- Returns:
- the value of the accessible state
-
testAccessibleHasProperty
Checks whether theGtkAccessible
hasproperty
set.- Parameters:
accessible
- aGtkAccessible
property
- aGtkAccessibleProperty
- Returns:
true
if theproperty
is set in theaccessible
-
testAccessibleHasRelation
Checks whether theGtkAccessible
hasrelation
set.- Parameters:
accessible
- aGtkAccessible
relation
- aGtkAccessibleRelation
- Returns:
true
if therelation
is set in theaccessible
-
testAccessibleHasRole
Checks whether theGtkAccessible:accessible-role
of the accessible isrole
.- Parameters:
accessible
- aGtkAccessible
role
- aGtkAccessibleRole
- Returns:
true
if the role matches
-
testAccessibleHasState
Checks whether theGtkAccessible
hasstate
set.- Parameters:
accessible
- aGtkAccessible
state
- aGtkAccessibleState
- Returns:
true
if thestate
is 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
argc
andargv
.- Parameters:
argvp
- Address of theargv
parameter 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 forwidget
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.- 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 draggingpath
fromtreeModel
.- Parameters:
treeModel
- aGtkTreeModel
path
- a row intreeModel
- Returns:
- a new
GdkContentProvider
-
treeGetRowDragData
@Deprecated public static boolean treeGetRowDragData(Value value, @Nullable @Nullable Out<TreeModel> treeModel, @Nullable @Nullable Out<TreePath> path) Deprecated.Use list models insteadObtains atreeModel
andpath
from value of target typeGTK_TYPE_TREE_ROW_DATA
.The returned path must be freed with gtk_tree_path_free().
- Parameters:
value
- aGValue
treeModel
- aGtkTreeModel
path
- row intreeModel
- Returns:
true
ifselectionData
had target typeGTK_TYPE_TREE_ROW_DATA
is otherwise valid
-
valueDupExpression
Retrieves theGtkExpression
stored inside the givenvalue
, and acquires a reference to it.- Parameters:
value
- aGValue
initialized with typeGTK_TYPE_EXPRESSION
- Returns:
- a
GtkExpression
-
valueGetExpression
Retrieves theGtkExpression
stored inside the givenvalue
.- Parameters:
value
- aGValue
initialized with typeGTK_TYPE_EXPRESSION
- Returns:
- a
GtkExpression
-
valueSetExpression
Stores the givenGtkExpression
insidevalue
.The
GValue
will acquire a reference to theexpression
.- Parameters:
value
- aGValue
initialized with typeGTK_TYPE_EXPRESSION
expression
- aGtkExpression
-
valueTakeExpression
Stores the givenGtkExpression
insidevalue
.This function transfers the ownership of the
expression
to theGValue
.- Parameters:
value
- aGValue
initialized with typeGTK_TYPE_EXPRESSION
expression
- aGtkExpression
-
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 allGtkStyleContexts
underdisplay
.GTK uses this to make styling information from
GtkSettings
available.Note: If both priorities are the same, A
GtkStyleProvider
added throughStyleContext.addProvider(org.gnome.gtk.StyleProvider, int)
takes precedence over another added through this function.- Parameters:
display
- aGdkDisplay
provider
- aGtkStyleProvider
priority
- 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_FALLBACK
andGTK_STYLE_PROVIDER_PRIORITY_USER
-
styleContextRemoveProviderForDisplay
Removesprovider
from the global style providers list indisplay
.- Parameters:
display
- aGdkDisplay
provider
- aGtkStyleProvider
-
initAbiCheck
public static void initAbiCheck(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) -
initCheckAbiCheck
public static boolean initCheckAbiCheck(int numChecks, long sizeofGtkWindow, long sizeofGtkBox)
-
FileLauncher.launch(org.gnome.gtk.Window, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
orUriLauncher.launch(org.gnome.gtk.Window, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
instead