All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gnome.gtk.Gtk Maven / Gradle / Ivy

// This file was automatically generated by Java-GI. Do not edit this file
// directly! Visit  for more information.
//
// The API documentation in this file was derived from GObject-Introspection
// metadata and may include text or comments from the original C sources.
//
// Copyright (c), upstream authors as identified in the GObject-Introspection
// metadata.
//
// This generated file is distributed under the same license as the original
// GObject-Introspection data, unless otherwise specified. Users of this file
// are responsible for complying with any licenses or terms required by the
// original authors.
//
// THIS FILE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
//
package org.gnome.gtk;

import io.github.jwharm.javagi.base.GErrorException;
import io.github.jwharm.javagi.base.Out;
import io.github.jwharm.javagi.gobject.InstanceCache;
import io.github.jwharm.javagi.gobject.types.TypeCache;
import io.github.jwharm.javagi.interop.ArenaCloseAction;
import io.github.jwharm.javagi.interop.Arenas;
import io.github.jwharm.javagi.interop.Interop;
import io.github.jwharm.javagi.interop.MemoryCleaner;
import io.github.jwharm.javagi.interop.Platform;
import java.lang.Deprecated;
import java.lang.Float;
import java.lang.Integer;
import java.lang.Object;
import java.lang.String;
import java.lang.foreign.Arena;
import java.lang.foreign.FunctionDescriptor;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.ValueLayout;
import java.lang.invoke.MethodHandle;
import java.util.EnumSet;
import java.util.Set;
import javax.annotation.processing.Generated;
import org.freedesktop.cairo.Context;
import org.gnome.gdk.ContentProvider;
import org.gnome.gdk.Display;
import org.gnome.gdk.ModifierType;
import org.gnome.gdk.Texture;
import org.gnome.gio.AsyncReadyCallback;
import org.gnome.gio.AsyncResult;
import org.gnome.gio.Cancellable;
import org.gnome.glib.Quark;
import org.gnome.glib.Type;
import org.gnome.gobject.GObjects;
import org.gnome.gobject.ParamFlags;
import org.gnome.gobject.ParamSpec;
import org.gnome.gobject.Value;
import org.gnome.pango.Language;
import org.gnome.pango.Layout;
import org.jetbrains.annotations.Nullable;

/**
 * Constants and functions that are declared in the global Gtk namespace.
 */
@Generated("io.github.jwharm.JavaGI")
public final class Gtk {
    /**
     * An attribute for the background color, expressed as an RGB value
     * encoded in a string using the format: {@code {r8},{g8},{b8}}.
     */
    public static final String ACCESSIBLE_ATTRIBUTE_BACKGROUND = "bg-color";

    /**
     * An attribute for the font family name.
     */
    public static final String ACCESSIBLE_ATTRIBUTE_FAMILY = "family-name";

    /**
     * An attribute for the foreground color, expressed as an RGB value
     * encoded in a string using the format: {@code {r8},{g8},{b8}}.
     */
    public static final String ACCESSIBLE_ATTRIBUTE_FOREGROUND = "fg-color";

    /**
     * An attribute for the overline style.
     * 

* Possible values are: *

    *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE} *
*/ public static final String ACCESSIBLE_ATTRIBUTE_OVERLINE = "overline"; /** * The "none" overline value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE}. */ public static final String ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE = "none"; /** * The "single" overline value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE}. */ public static final String ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE = "single"; /** * An attribute for the font size, expressed in points. */ public static final String ACCESSIBLE_ATTRIBUTE_SIZE = "size"; /** * An attribute for the font stretch type. *

* Possible values are: *

    *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED} *
*/ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH = "stretch"; /** * The "condensed" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED = "condensed"; /** * The "expanded" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_EXPANDED = "expanded"; /** * The "extra condensed" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED = "extra_condensed"; /** * The "extra expanded" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_EXPANDED = "extra_expanded"; /** * The "normal" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_NORMAL = "normal"; /** * The "semi condensed" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED = "semi_condensed"; /** * The "semi expanded" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_EXPANDED = "semi_expanded"; /** * The "ultra condensed" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED = "ultra_condensed"; /** * The "ultra expanded" stretch value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_EXPANDED = "ultra_expanded"; /** * An attribute for strikethrough text. *

* Possible values are {@code true} or {@code false}. */ public static final String ACCESSIBLE_ATTRIBUTE_STRIKETHROUGH = "strikethrough"; /** * An attribute for the font style. *

* Possible values are: *

    *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC} *
*/ public static final String ACCESSIBLE_ATTRIBUTE_STYLE = "style"; /** * The "italic" style value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STYLE}. */ public static final String ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC = "italic"; /** * The "normal" style value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STYLE}. */ public static final String ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL = "normal"; /** * The "oblique" style value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_STYLE}. */ public static final String ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE = "oblique"; /** * An attribute for the underline style. *

* Possible values are: *

    *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR} *
*/ public static final String ACCESSIBLE_ATTRIBUTE_UNDERLINE = "underline"; /** * The "double" underline value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE}. */ public static final String ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE = "double"; /** * The "error" underline value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE}. */ public static final String ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR = "error"; /** * The "none" underline value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE}. */ public static final String ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE = "none"; /** * The "single" underline value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE}. */ public static final String ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE = "single"; /** * An attribute for the font variant. *

* Possible values are: *

    *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE} *
  • {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS} *
*/ public static final String ACCESSIBLE_ATTRIBUTE_VARIANT = "variant"; /** * The "all petite caps" variant value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. */ public static final String ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS = "all-petite-caps"; /** * The "all small caps" variant value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. */ public static final String ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS = "all-small-caps"; /** * The "petite caps" variant value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. */ public static final String ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS = "petite-caps"; /** * The "small caps" variant value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. */ public static final String ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS = "small-caps"; /** * The "title caps" variant value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. */ public static final String ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS = "title-caps"; /** * The "unicase" variant value for {@code Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. */ public static final String ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE = "unicase"; /** * An attribute for the font weight. */ public static final String ACCESSIBLE_ATTRIBUTE_WEIGHT = "weight"; /** * An undefined value. The accessible attribute is either unset, or its * value is undefined. */ public static final int ACCESSIBLE_VALUE_UNDEFINED = -1; /** * Like {@link org.gnome.gtk.Gtk#getBinaryAge}, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ public static final int BINARY_AGE = 1602; /** * The default name of the extension point. */ public static final String IM_MODULE_EXTENSION_POINT_NAME = "gtk-im-module"; /** * Constant to return from a signal handler for the ::input * signal in case of conversion failure. *

* See {@code Gtk.SpinButton::input}. */ public static final int INPUT_ERROR = -1; /** * Like {@link org.gnome.gtk.Gtk#getInterfaceAge}, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ public static final int INTERFACE_AGE = 2; /** * The value used to refer to a guaranteed invalid position * in a {@code GListModel}. *

* 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. */ public static final int INVALID_LIST_POSITION = -1; /** * The name used for the stock full offset included by {@code GtkLevelBar}. */ public static final String LEVEL_BAR_OFFSET_FULL = "full"; /** * The name used for the stock high offset included by {@code GtkLevelBar}. */ public static final String LEVEL_BAR_OFFSET_HIGH = "high"; /** * The name used for the stock low offset included by {@code GtkLevelBar}. */ public static final String LEVEL_BAR_OFFSET_LOW = "low"; /** * Like {@link org.gnome.gtk.Gtk#getMajorVersion}, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ public static final int MAJOR_VERSION = 4; /** * Evaluates to the maximum length of a compose sequence. *

* This macro is longer used by GTK. */ public static final int MAX_COMPOSE_LEN = 7; /** * The default extension point name for media file. */ public static final String MEDIA_FILE_EXTENSION_POINT_NAME = "gtk-media-file"; /** * Like {@link org.gnome.gtk.Gtk#getMicroVersion}, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ public static final int MICRO_VERSION = 2; /** * Like {@link org.gnome.gtk.Gtk#getMinorVersion}, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ public static final int MINOR_VERSION = 16; /** * Name for the A3 paper size. */ public static final String PAPER_NAME_A3 = "iso_a3"; /** * Name for the A4 paper size. */ public static final String PAPER_NAME_A4 = "iso_a4"; /** * Name for the A5 paper size. */ public static final String PAPER_NAME_A5 = "iso_a5"; /** * Name for the B5 paper size. */ public static final String PAPER_NAME_B5 = "iso_b5"; /** * Name for the Executive paper size. */ public static final String PAPER_NAME_EXECUTIVE = "na_executive"; /** * Name for the Legal paper size. */ public static final String PAPER_NAME_LEGAL = "na_legal"; /** * Name for the Letter paper size. */ public static final String PAPER_NAME_LETTER = "na_letter"; /** * The key used by the “Print to file” printer to store whether to collate the * printed pages. */ public static final String PRINT_SETTINGS_COLLATE = "collate"; /** * The key used by the “Print to file” printer to store the default source. */ public static final String PRINT_SETTINGS_DEFAULT_SOURCE = "default-source"; /** * The key used by the “Print to file” printer to store the dither used. */ public static final String PRINT_SETTINGS_DITHER = "dither"; /** * The key used by the “Print to file” printer to store whether to print the * output in duplex. */ public static final String PRINT_SETTINGS_DUPLEX = "duplex"; /** * The key used by the “Print to file” printer to store the finishings. */ public static final String PRINT_SETTINGS_FINISHINGS = "finishings"; /** * 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. */ public static final String PRINT_SETTINGS_MEDIA_TYPE = "media-type"; /** * The key used by the “Print to file” printer to store the number of pages per * sheet. */ public static final String PRINT_SETTINGS_NUMBER_UP = "number-up"; /** * The key used by the “Print to file” printer to store the number of pages per * sheet in number-up mode. */ public static final String PRINT_SETTINGS_NUMBER_UP_LAYOUT = "number-up-layout"; /** * The key used by the “Print to file” printer to store the number of copies. */ public static final String PRINT_SETTINGS_N_COPIES = "n-copies"; /** * The key used by the “Print to file” printer to store the orientation. */ public static final String PRINT_SETTINGS_ORIENTATION = "orientation"; /** * 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. */ public static final String PRINT_SETTINGS_OUTPUT_BASENAME = "output-basename"; /** * The key used by the “Print to file” printer to store the output bin. */ public static final String PRINT_SETTINGS_OUTPUT_BIN = "output-bin"; /** * The key used by the “Print to file” printer to store the * directory to which the output should be written. */ public static final String PRINT_SETTINGS_OUTPUT_DIR = "output-dir"; /** * The key used by the “Print to file” printer to store the format * of the output. The supported values are “PS” and “PDF”. */ public static final String PRINT_SETTINGS_OUTPUT_FILE_FORMAT = "output-file-format"; /** * 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. */ public static final String PRINT_SETTINGS_OUTPUT_URI = "output-uri"; /** * The key used by the “Print to file” printer to store the array of page ranges * to print. */ public static final String PRINT_SETTINGS_PAGE_RANGES = "page-ranges"; /** * The key used by the “Print to file” printer to store the set of pages to print. */ public static final String PRINT_SETTINGS_PAGE_SET = "page-set"; /** * The key used by the “Print to file” printer to store the page format. */ public static final String PRINT_SETTINGS_PAPER_FORMAT = "paper-format"; /** * The key used by the “Print to file” printer to store the page height. */ public static final String PRINT_SETTINGS_PAPER_HEIGHT = "paper-height"; /** * The key used by the “Print to file” printer to store the paper width. */ public static final String PRINT_SETTINGS_PAPER_WIDTH = "paper-width"; /** * The key used by the “Print to file” printer to store the printer name. */ public static final String PRINT_SETTINGS_PRINTER = "printer"; /** * The key used by the “Print to file” printer to store the resolution in lines * per inch. */ public static final String PRINT_SETTINGS_PRINTER_LPI = "printer-lpi"; /** * The key used by the “Print to file” printer to store which pages to print. */ public static final String PRINT_SETTINGS_PRINT_PAGES = "print-pages"; /** * The key used by the “Print to file” printer to store the printing quality. */ public static final String PRINT_SETTINGS_QUALITY = "quality"; /** * The key used by the “Print to file” printer to store the resolution in DPI. */ public static final String PRINT_SETTINGS_RESOLUTION = "resolution"; /** * The key used by the “Print to file” printer to store the horizontal * resolution in DPI. */ public static final String PRINT_SETTINGS_RESOLUTION_X = "resolution-x"; /** * The key used by the “Print to file” printer to store the vertical resolution * in DPI. */ public static final String PRINT_SETTINGS_RESOLUTION_Y = "resolution-y"; /** * The key used by the “Print to file” printer to store whether to reverse the * order of the printed pages. */ public static final String PRINT_SETTINGS_REVERSE = "reverse"; /** * The key used by the “Print to file” printer to store the scale. */ public static final String PRINT_SETTINGS_SCALE = "scale"; /** * The key used by the “Print to file” printer to store whether to print with * colors. */ public static final String PRINT_SETTINGS_USE_COLOR = "use-color"; /** * The key used by the “Print to file” printer to store 32-bit Windows extra * driver. */ public static final String PRINT_SETTINGS_WIN32_DRIVER_EXTRA = "win32-driver-extra"; /** * The key used by the “Print to file” printer to store the 32-bit Windows * driver version. */ public static final String PRINT_SETTINGS_WIN32_DRIVER_VERSION = "win32-driver-version"; /** * Use 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 {@code GDK_PRIORITY_REDRAW} to avoid * resizing a widget which was just redrawn. */ public static final int PRIORITY_RESIZE = 110; /** * A priority that can be used when adding a {@code GtkStyleProvider} * for application-specific style information. */ public static final int STYLE_PROVIDER_PRIORITY_APPLICATION = 600; /** * The 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 {@code * {...}} rules. */ public static final int STYLE_PROVIDER_PRIORITY_FALLBACK = 1; /** * The priority used for style information provided * via {@code GtkSettings}. *

* This priority is higher than {@code GTK_STYLE_PROVIDER_PRIORITY_THEME} * to let settings override themes. */ public static final int STYLE_PROVIDER_PRIORITY_SETTINGS = 400; /** * The priority used for style information provided * by themes. */ public static final int STYLE_PROVIDER_PRIORITY_THEME = 200; /** * The priority used for the style information from * {@code $XDG_CONFIG_HOME/gtk-4.0/gtk.css}. *

* You should not use priorities higher than this, to * give the user the last word. */ public static final int STYLE_PROVIDER_PRIORITY_USER = 800; /** * The priority at which the text view validates onscreen lines * in an idle job in the background. */ public static final int TEXT_VIEW_PRIORITY_VALIDATE = 125; /** * Uses the default sort function in a {@link TreeSortable}. *

* See also: {@link TreeSortable#setSortColumnId} */ public static final int TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID = -1; /** * Disables sorting in a {@link TreeSortable}. *

* See also: {@link TreeSortable#setSortColumnId} */ public static final int TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID = -2; static { switch (Platform.getRuntimePlatform()) { case "linux" -> Interop.loadLibrary("libgtk-4.so.1"); case "windows" -> Interop.loadLibrary("libgtk-4-1.dll"); case "macos" -> Interop.loadLibrary("libgtk-4.1.dylib"); } registerTypes(); } public static void javagi$ensureInitialized() { } private static void registerTypes() { TypeCache.register(ATContext.getType(), ATContext.ATContextImpl::new); TypeCache.register(AboutDialog.getType(), AboutDialog::new); TypeCache.register(ActionBar.getType(), ActionBar::new); TypeCache.register(ActivateAction.getType(), ActivateAction::new); TypeCache.register(Adjustment.getType(), Adjustment::new); TypeCache.register(AlertDialog.getType(), AlertDialog::new); TypeCache.register(AlternativeTrigger.getType(), AlternativeTrigger::new); TypeCache.register(AnyFilter.getType(), AnyFilter::new); TypeCache.register(AppChooserButton.getType(), AppChooserButton::new); TypeCache.register(AppChooserDialog.getType(), AppChooserDialog::new); TypeCache.register(AppChooserWidget.getType(), AppChooserWidget::new); TypeCache.register(Application.getType(), Application::new); TypeCache.register(ApplicationWindow.getType(), ApplicationWindow::new); TypeCache.register(AspectFrame.getType(), AspectFrame::new); TypeCache.register(Assistant.getType(), Assistant::new); TypeCache.register(AssistantPage.getType(), AssistantPage::new); TypeCache.register(BinLayout.getType(), BinLayout::new); TypeCache.register(BookmarkList.getType(), BookmarkList::new); TypeCache.register(BoolFilter.getType(), BoolFilter::new); TypeCache.register(Box.getType(), Box::new); TypeCache.register(BoxLayout.getType(), BoxLayout::new); TypeCache.register(GtkBuilder.getType(), GtkBuilder::new); TypeCache.register(BuilderCScope.getType(), BuilderCScope::new); TypeCache.register(BuilderListItemFactory.getType(), BuilderListItemFactory::new); TypeCache.register(Button.getType(), Button::new); TypeCache.register(CClosureExpression.getType(), CClosureExpression::new); TypeCache.register(Calendar.getType(), Calendar::new); TypeCache.register(CallbackAction.getType(), CallbackAction::new); TypeCache.register(CellArea.getType(), CellArea.CellAreaImpl::new); TypeCache.register(CellAreaBox.getType(), CellAreaBox::new); TypeCache.register(CellAreaContext.getType(), CellAreaContext::new); TypeCache.register(CellRenderer.getType(), CellRenderer.CellRendererImpl::new); TypeCache.register(CellRendererAccel.getType(), CellRendererAccel::new); TypeCache.register(CellRendererCombo.getType(), CellRendererCombo::new); TypeCache.register(CellRendererPixbuf.getType(), CellRendererPixbuf::new); TypeCache.register(CellRendererProgress.getType(), CellRendererProgress::new); TypeCache.register(CellRendererSpin.getType(), CellRendererSpin::new); TypeCache.register(CellRendererSpinner.getType(), CellRendererSpinner::new); TypeCache.register(CellRendererText.getType(), CellRendererText::new); TypeCache.register(CellRendererToggle.getType(), CellRendererToggle::new); TypeCache.register(CellView.getType(), CellView::new); TypeCache.register(CenterBox.getType(), CenterBox::new); TypeCache.register(CenterLayout.getType(), CenterLayout::new); TypeCache.register(CheckButton.getType(), CheckButton::new); TypeCache.register(ClosureExpression.getType(), ClosureExpression::new); TypeCache.register(ColorButton.getType(), ColorButton::new); TypeCache.register(ColorChooserDialog.getType(), ColorChooserDialog::new); TypeCache.register(ColorChooserWidget.getType(), ColorChooserWidget::new); TypeCache.register(ColorDialog.getType(), ColorDialog::new); TypeCache.register(ColorDialogButton.getType(), ColorDialogButton::new); TypeCache.register(ColumnView.getType(), ColumnView::new); TypeCache.register(ColumnViewCell.getType(), ColumnViewCell::new); TypeCache.register(ColumnViewColumn.getType(), ColumnViewColumn::new); TypeCache.register(ColumnViewRow.getType(), ColumnViewRow::new); TypeCache.register(ColumnViewSorter.getType(), ColumnViewSorter::new); TypeCache.register(ComboBox.getType(), ComboBox::new); TypeCache.register(ComboBoxText.getType(), ComboBoxText::new); TypeCache.register(ConstantExpression.getType(), ConstantExpression::new); TypeCache.register(Constraint.getType(), Constraint::new); TypeCache.register(ConstraintGuide.getType(), ConstraintGuide::new); TypeCache.register(ConstraintLayout.getType(), ConstraintLayout::new); TypeCache.register(ConstraintLayoutChild.getType(), ConstraintLayoutChild::new); TypeCache.register(CssProvider.getType(), CssProvider::new); TypeCache.register(CustomFilter.getType(), CustomFilter::new); TypeCache.register(CustomSorter.getType(), CustomSorter::new); TypeCache.register(Dialog.getType(), Dialog::new); TypeCache.register(DirectoryList.getType(), DirectoryList::new); TypeCache.register(DragIcon.getType(), DragIcon::new); TypeCache.register(DragSource.getType(), DragSource::new); TypeCache.register(DrawingArea.getType(), DrawingArea::new); TypeCache.register(DropControllerMotion.getType(), DropControllerMotion::new); TypeCache.register(DropDown.getType(), DropDown::new); TypeCache.register(DropTarget.getType(), DropTarget::new); TypeCache.register(DropTargetAsync.getType(), DropTargetAsync::new); TypeCache.register(EditableLabel.getType(), EditableLabel::new); TypeCache.register(EmojiChooser.getType(), EmojiChooser::new); TypeCache.register(Entry.getType(), Entry::new); TypeCache.register(EntryBuffer.getType(), EntryBuffer::new); TypeCache.register(EntryCompletion.getType(), EntryCompletion::new); TypeCache.register(EventController.getType(), EventController.EventControllerImpl::new); TypeCache.register(EventControllerFocus.getType(), EventControllerFocus::new); TypeCache.register(EventControllerKey.getType(), EventControllerKey::new); TypeCache.register(EventControllerLegacy.getType(), EventControllerLegacy::new); TypeCache.register(EventControllerMotion.getType(), EventControllerMotion::new); TypeCache.register(EventControllerScroll.getType(), EventControllerScroll::new); TypeCache.register(EveryFilter.getType(), EveryFilter::new); TypeCache.register(Expander.getType(), Expander::new); TypeCache.register(Expression.getType(), Expression.ExpressionImpl::new); TypeCache.register(FileChooserDialog.getType(), FileChooserDialog::new); TypeCache.register(FileChooserNative.getType(), FileChooserNative::new); TypeCache.register(FileChooserWidget.getType(), FileChooserWidget::new); TypeCache.register(FileDialog.getType(), FileDialog::new); TypeCache.register(FileFilter.getType(), FileFilter::new); TypeCache.register(FileLauncher.getType(), FileLauncher::new); TypeCache.register(Filter.getType(), Filter::new); TypeCache.register(FilterListModel.getType(), FilterListModel::new); TypeCache.register(Fixed.getType(), Fixed::new); TypeCache.register(FixedLayout.getType(), FixedLayout::new); TypeCache.register(FixedLayoutChild.getType(), FixedLayoutChild::new); TypeCache.register(FlattenListModel.getType(), FlattenListModel::new); TypeCache.register(FlowBox.getType(), FlowBox::new); TypeCache.register(FlowBoxChild.getType(), FlowBoxChild::new); TypeCache.register(FontButton.getType(), FontButton::new); TypeCache.register(FontChooserDialog.getType(), FontChooserDialog::new); TypeCache.register(FontChooserWidget.getType(), FontChooserWidget::new); TypeCache.register(FontDialog.getType(), FontDialog::new); TypeCache.register(FontDialogButton.getType(), FontDialogButton::new); TypeCache.register(Frame.getType(), Frame::new); TypeCache.register(GLArea.getType(), GLArea::new); TypeCache.register(Gesture.getType(), Gesture.GestureImpl::new); TypeCache.register(GestureClick.getType(), GestureClick::new); TypeCache.register(GestureDrag.getType(), GestureDrag::new); TypeCache.register(GestureLongPress.getType(), GestureLongPress::new); TypeCache.register(GesturePan.getType(), GesturePan::new); TypeCache.register(GestureRotate.getType(), GestureRotate::new); TypeCache.register(GestureSingle.getType(), GestureSingle::new); TypeCache.register(GestureStylus.getType(), GestureStylus::new); TypeCache.register(GestureSwipe.getType(), GestureSwipe::new); TypeCache.register(GestureZoom.getType(), GestureZoom::new); TypeCache.register(GraphicsOffload.getType(), GraphicsOffload::new); TypeCache.register(Grid.getType(), Grid::new); TypeCache.register(GridLayout.getType(), GridLayout::new); TypeCache.register(GridLayoutChild.getType(), GridLayoutChild::new); TypeCache.register(GridView.getType(), GridView::new); TypeCache.register(HeaderBar.getType(), HeaderBar::new); TypeCache.register(IMContext.getType(), IMContext.IMContextImpl::new); TypeCache.register(IMContextSimple.getType(), IMContextSimple::new); TypeCache.register(IMMulticontext.getType(), IMMulticontext::new); TypeCache.register(IconPaintable.getType(), IconPaintable::new); TypeCache.register(IconTheme.getType(), IconTheme::new); TypeCache.register(IconView.getType(), IconView::new); TypeCache.register(Image.getType(), Image::new); TypeCache.register(InfoBar.getType(), InfoBar::new); TypeCache.register(Inscription.getType(), Inscription::new); TypeCache.register(KeyvalTrigger.getType(), KeyvalTrigger::new); TypeCache.register(Label.getType(), Label::new); TypeCache.register(LayoutChild.getType(), LayoutChild.LayoutChildImpl::new); TypeCache.register(LayoutManager.getType(), LayoutManager.LayoutManagerImpl::new); TypeCache.register(LevelBar.getType(), LevelBar::new); TypeCache.register(LinkButton.getType(), LinkButton::new); TypeCache.register(ListBase.getType(), ListBase.ListBaseImpl::new); TypeCache.register(ListBox.getType(), ListBox::new); TypeCache.register(ListBoxRow.getType(), ListBoxRow::new); TypeCache.register(ListHeader.getType(), ListHeader::new); TypeCache.register(ListItem.getType(), ListItem::new); TypeCache.register(ListItemFactory.getType(), ListItemFactory::new); TypeCache.register(ListStore.getType(), ListStore::new); TypeCache.register(ListView.getType(), ListView::new); TypeCache.register(LockButton.getType(), LockButton::new); TypeCache.register(MapListModel.getType(), MapListModel::new); TypeCache.register(MediaControls.getType(), MediaControls::new); TypeCache.register(MediaFile.getType(), MediaFile.MediaFileImpl::new); TypeCache.register(MediaStream.getType(), MediaStream.MediaStreamImpl::new); TypeCache.register(MenuButton.getType(), MenuButton::new); TypeCache.register(MessageDialog.getType(), MessageDialog::new); TypeCache.register(MnemonicAction.getType(), MnemonicAction::new); TypeCache.register(MnemonicTrigger.getType(), MnemonicTrigger::new); TypeCache.register(MountOperation.getType(), MountOperation::new); TypeCache.register(MultiFilter.getType(), MultiFilter.MultiFilterImpl::new); TypeCache.register(MultiSelection.getType(), MultiSelection::new); TypeCache.register(MultiSorter.getType(), MultiSorter::new); TypeCache.register(NamedAction.getType(), NamedAction::new); TypeCache.register(NativeDialog.getType(), NativeDialog.NativeDialogImpl::new); TypeCache.register(NeverTrigger.getType(), NeverTrigger::new); TypeCache.register(NoSelection.getType(), NoSelection::new); TypeCache.register(Notebook.getType(), Notebook::new); TypeCache.register(NotebookPage.getType(), NotebookPage::new); TypeCache.register(NothingAction.getType(), NothingAction::new); TypeCache.register(NumericSorter.getType(), NumericSorter::new); TypeCache.register(ObjectExpression.getType(), ObjectExpression::new); TypeCache.register(Overlay.getType(), Overlay::new); TypeCache.register(OverlayLayout.getType(), OverlayLayout::new); TypeCache.register(OverlayLayoutChild.getType(), OverlayLayoutChild::new); TypeCache.register(PadController.getType(), PadController::new); TypeCache.register(PageSetup.getType(), PageSetup::new); TypeCache.register(PageSetupUnixDialog.getType(), PageSetupUnixDialog::new); TypeCache.register(Paned.getType(), Paned::new); TypeCache.register(ParamSpecExpression.getType(), ParamSpecExpression::new); TypeCache.register(PasswordEntry.getType(), PasswordEntry::new); TypeCache.register(PasswordEntryBuffer.getType(), PasswordEntryBuffer::new); TypeCache.register(Picture.getType(), Picture::new); TypeCache.register(Popover.getType(), Popover::new); TypeCache.register(PopoverMenu.getType(), PopoverMenu::new); TypeCache.register(PopoverMenuBar.getType(), PopoverMenuBar::new); TypeCache.register(PrintContext.getType(), PrintContext::new); TypeCache.register(PrintDialog.getType(), PrintDialog::new); TypeCache.register(PrintJob.getType(), PrintJob::new); TypeCache.register(PrintOperation.getType(), PrintOperation::new); TypeCache.register(PrintSettings.getType(), PrintSettings::new); TypeCache.register(PrintUnixDialog.getType(), PrintUnixDialog::new); TypeCache.register(Printer.getType(), Printer::new); TypeCache.register(ProgressBar.getType(), ProgressBar::new); TypeCache.register(PropertyExpression.getType(), PropertyExpression::new); TypeCache.register(Range.getType(), Range::new); TypeCache.register(RecentManager.getType(), RecentManager::new); TypeCache.register(Revealer.getType(), Revealer::new); TypeCache.register(Scale.getType(), Scale::new); TypeCache.register(ScaleButton.getType(), ScaleButton::new); TypeCache.register(Scrollbar.getType(), Scrollbar::new); TypeCache.register(ScrolledWindow.getType(), ScrolledWindow::new); TypeCache.register(SearchBar.getType(), SearchBar::new); TypeCache.register(SearchEntry.getType(), SearchEntry::new); TypeCache.register(SelectionFilterModel.getType(), SelectionFilterModel::new); TypeCache.register(Separator.getType(), Separator::new); TypeCache.register(Settings.getType(), Settings::new); TypeCache.register(Shortcut.getType(), Shortcut::new); TypeCache.register(ShortcutAction.getType(), ShortcutAction.ShortcutActionImpl::new); TypeCache.register(ShortcutController.getType(), ShortcutController::new); TypeCache.register(ShortcutLabel.getType(), ShortcutLabel::new); TypeCache.register(ShortcutTrigger.getType(), ShortcutTrigger.ShortcutTriggerImpl::new); TypeCache.register(ShortcutsGroup.getType(), ShortcutsGroup::new); TypeCache.register(ShortcutsSection.getType(), ShortcutsSection::new); TypeCache.register(ShortcutsShortcut.getType(), ShortcutsShortcut::new); TypeCache.register(ShortcutsWindow.getType(), ShortcutsWindow::new); TypeCache.register(SignalAction.getType(), SignalAction::new); TypeCache.register(SignalListItemFactory.getType(), SignalListItemFactory::new); TypeCache.register(SingleSelection.getType(), SingleSelection::new); TypeCache.register(SizeGroup.getType(), SizeGroup::new); TypeCache.register(SliceListModel.getType(), SliceListModel::new); TypeCache.register(Snapshot.getType(), Snapshot::new); TypeCache.register(SortListModel.getType(), SortListModel::new); TypeCache.register(Sorter.getType(), Sorter::new); TypeCache.register(SpinButton.getType(), SpinButton::new); TypeCache.register(Spinner.getType(), Spinner::new); TypeCache.register(Stack.getType(), Stack::new); TypeCache.register(StackPage.getType(), StackPage::new); TypeCache.register(StackSidebar.getType(), StackSidebar::new); TypeCache.register(StackSwitcher.getType(), StackSwitcher::new); TypeCache.register(Statusbar.getType(), Statusbar::new); TypeCache.register(StringFilter.getType(), StringFilter::new); TypeCache.register(StringList.getType(), StringList::new); TypeCache.register(StringObject.getType(), StringObject::new); TypeCache.register(StringSorter.getType(), StringSorter::new); TypeCache.register(StyleContext.getType(), StyleContext::new); TypeCache.register(Switch.getType(), Switch::new); TypeCache.register(Text.getType(), Text::new); TypeCache.register(TextBuffer.getType(), TextBuffer::new); TypeCache.register(TextChildAnchor.getType(), TextChildAnchor::new); TypeCache.register(TextMark.getType(), TextMark::new); TypeCache.register(TextTag.getType(), TextTag::new); TypeCache.register(TextTagTable.getType(), TextTagTable::new); TypeCache.register(TextView.getType(), TextView::new); TypeCache.register(ToggleButton.getType(), ToggleButton::new); TypeCache.register(Tooltip.getType(), Tooltip::new); TypeCache.register(TreeExpander.getType(), TreeExpander::new); TypeCache.register(TreeListModel.getType(), TreeListModel::new); TypeCache.register(TreeListRow.getType(), TreeListRow::new); TypeCache.register(TreeListRowSorter.getType(), TreeListRowSorter::new); TypeCache.register(TreeModelFilter.getType(), TreeModelFilter::new); TypeCache.register(TreeModelSort.getType(), TreeModelSort::new); TypeCache.register(TreeSelection.getType(), TreeSelection::new); TypeCache.register(TreeStore.getType(), TreeStore::new); TypeCache.register(TreeView.getType(), TreeView::new); TypeCache.register(TreeViewColumn.getType(), TreeViewColumn::new); TypeCache.register(UriLauncher.getType(), UriLauncher::new); TypeCache.register(Video.getType(), Video::new); TypeCache.register(Viewport.getType(), Viewport::new); TypeCache.register(VolumeButton.getType(), VolumeButton::new); TypeCache.register(Widget.getType(), Widget.WidgetImpl::new); TypeCache.register(WidgetPaintable.getType(), WidgetPaintable::new); TypeCache.register(Window.getType(), Window::new); TypeCache.register(WindowControls.getType(), WindowControls::new); TypeCache.register(WindowGroup.getType(), WindowGroup::new); TypeCache.register(WindowHandle.getType(), WindowHandle::new); TypeCache.register(Accessible.getType(), Accessible.AccessibleImpl::new); TypeCache.register(AccessibleRange.getType(), AccessibleRange.AccessibleRangeImpl::new); TypeCache.register(AccessibleText.getType(), AccessibleText.AccessibleTextImpl::new); TypeCache.register(Actionable.getType(), Actionable.ActionableImpl::new); TypeCache.register(AppChooser.getType(), AppChooser.AppChooserImpl::new); TypeCache.register(Buildable.getType(), Buildable.BuildableImpl::new); TypeCache.register(BuilderScope.getType(), BuilderScope.BuilderScopeImpl::new); TypeCache.register(CellEditable.getType(), CellEditable.CellEditableImpl::new); TypeCache.register(CellLayout.getType(), CellLayout.CellLayoutImpl::new); TypeCache.register(ColorChooser.getType(), ColorChooser.ColorChooserImpl::new); TypeCache.register(ConstraintTarget.getType(), ConstraintTarget.ConstraintTargetImpl::new); TypeCache.register(Editable.getType(), Editable.EditableImpl::new); TypeCache.register(FileChooser.getType(), FileChooser.FileChooserImpl::new); TypeCache.register(FontChooser.getType(), FontChooser.FontChooserImpl::new); TypeCache.register(Native.getType(), Native.NativeImpl::new); TypeCache.register(Orientable.getType(), Orientable.OrientableImpl::new); TypeCache.register(PrintOperationPreview.getType(), PrintOperationPreview.PrintOperationPreviewImpl::new); TypeCache.register(Root.getType(), Root.RootImpl::new); TypeCache.register(Scrollable.getType(), Scrollable.ScrollableImpl::new); TypeCache.register(SectionModel.getType(), SectionModel.SectionModelImpl::new); TypeCache.register(SelectionModel.getType(), SelectionModel.SelectionModelImpl::new); TypeCache.register(ShortcutManager.getType(), ShortcutManager.ShortcutManagerImpl::new); TypeCache.register(StyleProvider.getType(), StyleProvider.StyleProviderImpl::new); TypeCache.register(SymbolicPaintable.getType(), SymbolicPaintable.SymbolicPaintableImpl::new); TypeCache.register(TreeDragDest.getType(), TreeDragDest.TreeDragDestImpl::new); TypeCache.register(TreeDragSource.getType(), TreeDragSource.TreeDragSourceImpl::new); TypeCache.register(TreeModel.getType(), TreeModel.TreeModelImpl::new); TypeCache.register(TreeSortable.getType(), TreeSortable.TreeSortableImpl::new); TypeCache.register(TreeRowData.getType(), TreeRowData::new); } /** * Gets the modifier mask. *

* The modifier mask determines which modifiers are considered significant * for keyboard accelerators. This includes all keyboard modifiers except * for {@link org.gnome.gdk.ModifierType#LOCK_MASK}. * * @return the modifier mask for accelerators */ public static Set acceleratorGetDefaultModMask() { int _result; try { _result = (int) MethodHandles.gtk_accelerator_get_default_mod_mask.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.intToEnumSet(ModifierType.class, ModifierType::of, _result); } /** * Converts an accelerator keyval and modifier mask into a string * which can be used to represent the accelerator to the user. * * @param acceleratorKey accelerator keyval * @param acceleratorMods accelerator modifier mask * @return a newly-allocated string representing the accelerator */ public static String acceleratorGetLabel(int acceleratorKey, Set acceleratorMods) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_accelerator_get_label.invokeExact( acceleratorKey, Interop.enumSetToInt(acceleratorMods)); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.getStringFrom(_result, true); } /** * Converts an accelerator keyval and modifier mask into a string * which can be used to represent the accelerator to the user. * * @param acceleratorKey accelerator keyval * @param acceleratorMods accelerator modifier mask * @return a newly-allocated string representing the accelerator */ public static String acceleratorGetLabel(int acceleratorKey, ModifierType... acceleratorMods) { return acceleratorGetLabel(acceleratorKey, (acceleratorMods == null ? null : (acceleratorMods.length == 0) ? EnumSet.noneOf(ModifierType.class) : EnumSet.of(acceleratorMods[0], 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 {@link Gtk#acceleratorGetLabel}, * but handling keycodes. This is only useful for system-level * components, applications should use {@link Gtk#acceleratorGetLabel} * instead. * * @param display a {@code GdkDisplay} or {@code null} to use the default display * @param acceleratorKey accelerator keyval * @param keycode accelerator keycode * @param acceleratorMods accelerator modifier mask * @return a newly-allocated string representing the accelerator */ public static String acceleratorGetLabelWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, Set acceleratorMods) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_accelerator_get_label_with_keycode.invokeExact( (MemorySegment) (display == null ? MemorySegment.NULL : display.handle()), acceleratorKey, keycode, Interop.enumSetToInt(acceleratorMods)); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.getStringFrom(_result, true); } /** * 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 {@link Gtk#acceleratorGetLabel}, * but handling keycodes. This is only useful for system-level * components, applications should use {@link Gtk#acceleratorGetLabel} * instead. * * @param display a {@code GdkDisplay} or {@code null} to use the default display * @param acceleratorKey accelerator keyval * @param keycode accelerator keycode * @param acceleratorMods accelerator modifier mask * @return a newly-allocated string representing the accelerator */ public static String acceleratorGetLabelWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, ModifierType... acceleratorMods) { return acceleratorGetLabelWithKeycode(display, acceleratorKey, keycode, (acceleratorMods == null ? null : (acceleratorMods.length == 0) ? EnumSet.noneOf(ModifierType.class) : EnumSet.of(acceleratorMods[0], acceleratorMods))); } /** * Converts an accelerator keyval and modifier mask into a string * parseable by gtk_accelerator_parse(). *

* For example, if you pass in {@code GDK_KEY_q} and {@link org.gnome.gdk.ModifierType#CONTROL_MASK}, * this function returns {@code q}. *

* If you need to display accelerators in the user interface, * see {@link Gtk#acceleratorGetLabel}. * * @param acceleratorKey accelerator keyval * @param acceleratorMods accelerator modifier mask * @return a newly-allocated accelerator name */ public static String acceleratorName(int acceleratorKey, Set acceleratorMods) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_accelerator_name.invokeExact( acceleratorKey, Interop.enumSetToInt(acceleratorMods)); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.getStringFrom(_result, true); } /** * Converts an accelerator keyval and modifier mask into a string * parseable by gtk_accelerator_parse(). *

* For example, if you pass in {@code GDK_KEY_q} and {@link org.gnome.gdk.ModifierType#CONTROL_MASK}, * this function returns {@code q}. *

* If you need to display accelerators in the user interface, * see {@link Gtk#acceleratorGetLabel}. * * @param acceleratorKey accelerator keyval * @param acceleratorMods accelerator modifier mask * @return a newly-allocated accelerator name */ public static String acceleratorName(int acceleratorKey, ModifierType... acceleratorMods) { return acceleratorName(acceleratorKey, (acceleratorMods == null ? null : (acceleratorMods.length == 0) ? EnumSet.noneOf(ModifierType.class) : EnumSet.of(acceleratorMods[0], acceleratorMods))); } /** * Converts an accelerator keyval and modifier mask * into a string parseable by gtk_accelerator_parse_with_keycode(). *

* This is similar to {@link Gtk#acceleratorName} but handling keycodes. * This is only useful for system-level components, applications * should use {@link Gtk#acceleratorName} instead. * * @param display a {@code GdkDisplay} or {@code null} to use the default display * @param acceleratorKey accelerator keyval * @param keycode accelerator keycode * @param acceleratorMods accelerator modifier mask * @return a newly allocated accelerator name. */ public static String acceleratorNameWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, Set acceleratorMods) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_accelerator_name_with_keycode.invokeExact( (MemorySegment) (display == null ? MemorySegment.NULL : display.handle()), acceleratorKey, keycode, Interop.enumSetToInt(acceleratorMods)); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.getStringFrom(_result, true); } /** * Converts an accelerator keyval and modifier mask * into a string parseable by gtk_accelerator_parse_with_keycode(). *

* This is similar to {@link Gtk#acceleratorName} but handling keycodes. * This is only useful for system-level components, applications * should use {@link Gtk#acceleratorName} instead. * * @param display a {@code GdkDisplay} or {@code null} to use the default display * @param acceleratorKey accelerator keyval * @param keycode accelerator keycode * @param acceleratorMods accelerator modifier mask * @return a newly allocated accelerator name. */ public static String acceleratorNameWithKeycode(@Nullable Display display, int acceleratorKey, int keycode, ModifierType... acceleratorMods) { return acceleratorNameWithKeycode(display, acceleratorKey, keycode, (acceleratorMods == null ? null : (acceleratorMods.length == 0) ? EnumSet.noneOf(ModifierType.class) : EnumSet.of(acceleratorMods[0], acceleratorMods))); } /** * Parses a string representing an accelerator. *

* The format looks like “{@code a}” or “{@code F1}”. *

* The parser is fairly liberal and allows lower or upper case, and also * abbreviations such as “{@code }” and “{@code }”. *

* Key names are parsed using {@link org.gnome.gdk.Gdk#keyvalFromName}. For character keys * the name is not the symbol, but the lowercase name, e.g. one would use * “{@code minus}” instead of “{@code -}”. *

* Modifiers are enclosed in angular brackets {@code <>}, and match the * {@code Gdk.ModifierType} mask: *

    *
  • {@code } for {@code GDK_SHIFT_MASK} *
  • {@code } for {@code GDK_CONTROL_MASK} *
  • {@code } for {@code GDK_ALT_MASK} *
  • {@code } for {@code GDK_META_MASK} *
  • {@code } for {@code GDK_SUPER_MASK} *
  • {@code } for {@code GDK_HYPER_MASK} *
*

* If the parse operation fails, {@code acceleratorKey} and {@code acceleratorMods} will * be set to 0 (zero). * * @param accelerator string representing an accelerator * @param acceleratorKey return location for accelerator keyval * @param acceleratorMods return location for accelerator * modifier mask * @return whether parsing succeeded */ public static boolean acceleratorParse(String accelerator, @Nullable Out acceleratorKey, @Nullable Out> acceleratorMods) { try (var _arena = Arena.ofConfined()) { MemorySegment _acceleratorKeyPointer = _arena.allocate(ValueLayout.JAVA_INT); MemorySegment _acceleratorModsPointer = _arena.allocate(ValueLayout.JAVA_INT); int _result; try { _result = (int) MethodHandles.gtk_accelerator_parse.invokeExact( (MemorySegment) (accelerator == null ? MemorySegment.NULL : Interop.allocateNativeString(accelerator, _arena)), (MemorySegment) (acceleratorKey == null ? MemorySegment.NULL : _acceleratorKeyPointer), (MemorySegment) (acceleratorMods == null ? MemorySegment.NULL : _acceleratorModsPointer)); } catch (Throwable _err) { throw new AssertionError(_err); } if (acceleratorKey != null) { acceleratorKey.set(_acceleratorKeyPointer.get(ValueLayout.JAVA_INT, 0)); } if (acceleratorMods != null) { acceleratorMods.set(Interop.intToEnumSet(ModifierType.class, ModifierType::of, _acceleratorModsPointer.get(ValueLayout.JAVA_INT, 0))); } return _result != 0; } } /** * Parses a string representing an accelerator. *

* This is similar to {@link Gtk#acceleratorParse} but handles keycodes as * well. This is only useful for system-level components, applications should * use {@link Gtk#acceleratorParse} instead. *

* If {@code acceleratorCodes} is given and the result stored in it is non-{@code null}, * the result must be freed with g_free(). *

* If a keycode is present in the accelerator and no {@code acceleratorCodes} * is given, the parse will fail. *

* If the parse fails, {@code acceleratorKey}, {@code acceleratorMods} and * {@code acceleratorCodes} will be set to 0 (zero). * * @param accelerator string representing an accelerator * @param display the {@code GdkDisplay} to look up {@code acceleratorCodes} in * @param acceleratorKey return location for accelerator keyval * @param acceleratorCodes return location for accelerator keycodes * @param acceleratorMods return location for accelerator * modifier mask * @return {@code true} if parsing succeeded */ public static boolean acceleratorParseWithKeycode(String accelerator, @Nullable Display display, @Nullable Out acceleratorKey, @Nullable int[] acceleratorCodes, @Nullable Out> acceleratorMods) { try (var _arena = Arena.ofConfined()) { MemorySegment _acceleratorKeyPointer = _arena.allocate(ValueLayout.JAVA_INT); MemorySegment _acceleratorModsPointer = _arena.allocate(ValueLayout.JAVA_INT); int _result; try { _result = (int) MethodHandles.gtk_accelerator_parse_with_keycode.invokeExact( (MemorySegment) (accelerator == null ? MemorySegment.NULL : Interop.allocateNativeString(accelerator, _arena)), (MemorySegment) (display == null ? MemorySegment.NULL : display.handle()), (MemorySegment) (acceleratorKey == null ? MemorySegment.NULL : _acceleratorKeyPointer), (MemorySegment) (acceleratorCodes == null ? MemorySegment.NULL : Interop.allocateNativeArray(acceleratorCodes, true, Arena.global())), (MemorySegment) (acceleratorMods == null ? MemorySegment.NULL : _acceleratorModsPointer)); } catch (Throwable _err) { throw new AssertionError(_err); } if (acceleratorKey != null) { acceleratorKey.set(_acceleratorKeyPointer.get(ValueLayout.JAVA_INT, 0)); } if (acceleratorMods != null) { acceleratorMods.set(Interop.intToEnumSet(ModifierType.class, ModifierType::of, _acceleratorModsPointer.get(ValueLayout.JAVA_INT, 0))); } return _result != 0; } } /** * Determines whether a given keyval and modifier mask constitute * a valid keyboard accelerator. *

* For example, the {@code GDK_KEY_a} keyval plus {@link org.gnome.gdk.ModifierType#CONTROL_MASK} mark is valid, * and matches the “Ctrl+a” accelerator. But, you can't, for instance, use * the {@code GDK_KEY_Control_L} keyval as an accelerator. * * @param keyval a GDK keyval * @param modifiers modifier mask * @return {@code true} if the accelerator is valid */ public static boolean acceleratorValid(int keyval, Set modifiers) { int _result; try { _result = (int) MethodHandles.gtk_accelerator_valid.invokeExact(keyval, Interop.enumSetToInt(modifiers)); } catch (Throwable _err) { throw new AssertionError(_err); } return _result != 0; } /** * Determines whether a given keyval and modifier mask constitute * a valid keyboard accelerator. *

* For example, the {@code GDK_KEY_a} keyval plus {@link org.gnome.gdk.ModifierType#CONTROL_MASK} mark is valid, * and matches the “Ctrl+a” accelerator. But, you can't, for instance, use * the {@code GDK_KEY_Control_L} keyval as an accelerator. * * @param keyval a GDK keyval * @param modifiers modifier mask * @return {@code true} if the accelerator is valid */ public static boolean acceleratorValid(int keyval, ModifierType... modifiers) { return acceleratorValid(keyval, (modifiers == null ? null : (modifiers.length == 0) ? EnumSet.noneOf(ModifierType.class) : EnumSet.of(modifiers[0], modifiers))); } /** * Checks that the GTK library in use is compatible with the * given version. *

* Generally you would pass in the constants {@code GTK_MAJOR_VERSION}, * {@code GTK_MINOR_VERSION}, {@code 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 * {@code requiredMajor}.required_minor.{@code requiredMicro}. Second * the running library must be binary compatible with the * version {@code requiredMajor}.required_minor.{@code 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. * * @param requiredMajor the required major version * @param requiredMinor the required minor version * @param requiredMicro the required micro version * @return {@code 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. */ public static String checkVersion(int requiredMajor, int requiredMinor, int requiredMicro) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_check_version.invokeExact(requiredMajor, requiredMinor, requiredMicro); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.getStringFrom(_result, false); } /** * Registers an error quark for CSS parsing errors. * * @return the error quark */ public static Quark cssParserErrorQuark() { int _result; try { _result = (int) MethodHandles.gtk_css_parser_error_quark.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return new Quark(_result); } /** * Registers an error quark for CSS parsing warnings. * * @return the warning quark */ public static Quark cssParserWarningQuark() { int _result; try { _result = (int) MethodHandles.gtk_css_parser_warning_quark.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return new Quark(_result); } /** * Prevents {@link Gtk#init} and {@link Gtk#initCheck} from automatically calling * {@code setlocale (LC_ALL, "")}. *

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

* Most programs should not need to call this function. */ public static void disableSetlocale() { try { MethodHandles.gtk_disable_setlocale.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Distributes {@code extraSpace} to child {@code sizes} by bringing smaller * children up to natural size first. *

* The remaining space will be added to the {@code minimumSize} member of the * {@code GtkRequestedSize} struct. If all sizes reach their natural size then * the remaining space is returned. * * @param extraSpace Extra space to redistribute among children after subtracting * minimum sizes and any child padding from the overall allocation * @param sizes An array of structs with a client pointer and a minimum/natural size * in the orientation of the allocation. * @return The remainder of {@code extraSpace} after redistributing space * to {@code sizes}. */ public static int distributeNaturalAllocation(int extraSpace, RequestedSize[] sizes) { try (var _arena = Arena.ofConfined()) { int nRequestedSizes = sizes == null ? 0 : sizes.length; int _result; try { _result = (int) MethodHandles.gtk_distribute_natural_allocation.invokeExact( extraSpace, nRequestedSizes, (MemorySegment) (sizes == null ? MemorySegment.NULL : Interop.allocateNativeArray(sizes, RequestedSize.getMemoryLayout(), false, _arena))); } catch (Throwable _err) { throw new AssertionError(_err); } return _result; } } /** * Calls a function for all {@code GtkPrinter}s. *

* If {@code func} returns {@code true}, the enumeration is stopped. * * @param func a function to call for each printer * @param wait_ if {@code true}, wait in a recursive mainloop until * all printers are enumerated; otherwise return early */ public static void enumeratePrinters(PrinterFunc func, boolean wait_) { try (var _arena = Arena.ofConfined()) { final Arena _funcScope = Arena.ofConfined(); try { MethodHandles.gtk_enumerate_printers.invokeExact( (MemorySegment) (func == null ? MemorySegment.NULL : func.toCallback(_funcScope)), Arenas.cacheArena(_funcScope), Arenas.CLOSE_CB_SYM, wait_ ? 1 : 0); } catch (Throwable _err) { throw new AssertionError(_err); } } } /** * Returns the binary age as passed to {@code libtool}. *

* If {@code libtool} means nothing to you, don't worry about it. * * @return the binary age of the GTK library */ public static int getBinaryAge() { int _result; try { _result = (int) MethodHandles.gtk_get_binary_age.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return _result; } /** * 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. * * @return the GTK debug flags. */ public static Set getDebugFlags() { int _result; try { _result = (int) MethodHandles.gtk_get_debug_flags.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.intToEnumSet(DebugFlags.class, DebugFlags::of, _result); } /** * Returns the {@code PangoLanguage} for the default language * currently in effect. *

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

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

* This function is equivalent to {@link org.gnome.pango.Language#getDefault}. * See that function for details. * * @return the default language */ public static Language getDefaultLanguage() { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_get_default_language.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } _result = GObjects.boxedCopy(Language.getType(), _result); var _instance = MemorySegment.NULL.equals(_result) ? null : new Language(_result); MemoryCleaner.takeOwnership(_instance); MemoryCleaner.setBoxedType(_instance, Language.getType()); return _instance; } /** * Returns the interface age as passed to {@code libtool}. *

* If {@code libtool} means nothing to you, don't worry about it. * * @return the interface age of the GTK library */ public static int getInterfaceAge() { int _result; try { _result = (int) MethodHandles.gtk_get_interface_age.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return _result; } /** * 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 {@link org.gnome.gtk.TextDirection#LTR} * direction otherwise. {@link org.gnome.gtk.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: *

{@code #include 
     *
     * static void
     * update_locale (const char *new_locale)
     * {
     *   setlocale (LC_ALL, new_locale);
     *   gtk_widget_set_default_direction (gtk_get_locale_direction ());
     * }
     * }
* * @return the direction of the current locale */ public static TextDirection getLocaleDirection() { int _result; try { _result = (int) MethodHandles.gtk_get_locale_direction.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return TextDirection.of(_result); } /** * 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 {@code GTK_MAJOR_VERSION} * macro, which represents the major version of the GTK headers you * have included when compiling your code. * * @return the major version number of the GTK library */ public static int getMajorVersion() { int _result; try { _result = (int) MethodHandles.gtk_get_major_version.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return _result; } /** * 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 * {@code GTK_MICRO_VERSION} macro, which represents the micro version of the * GTK headers you have included when compiling your code. * * @return the micro version number of the GTK library */ public static int getMicroVersion() { int _result; try { _result = (int) MethodHandles.gtk_get_micro_version.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return _result; } /** * 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 * {@code GTK_MINOR_VERSION} macro, which represents the minor version of the * GTK headers you have included when compiling your code. * * @return the minor version number of the GTK library */ public static int getMinorVersion() { int _result; try { _result = (int) MethodHandles.gtk_get_minor_version.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return _result; } /** * 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. * * @param h Hue * @param s Saturation * @param v Value * @param r Return value for the red component * @param g Return value for the green component * @param b Return value for the blue component */ public static void hsvToRgb(float h, float s, float v, Out r, Out g, Out b) { try (var _arena = Arena.ofConfined()) { MemorySegment _rPointer = _arena.allocate(ValueLayout.JAVA_FLOAT); MemorySegment _gPointer = _arena.allocate(ValueLayout.JAVA_FLOAT); MemorySegment _bPointer = _arena.allocate(ValueLayout.JAVA_FLOAT); try { MethodHandles.gtk_hsv_to_rgb.invokeExact(h, s, v, (MemorySegment) (r == null ? MemorySegment.NULL : _rPointer), (MemorySegment) (g == null ? MemorySegment.NULL : _gPointer), (MemorySegment) (b == null ? MemorySegment.NULL : _bPointer)); } catch (Throwable _err) { throw new AssertionError(_err); } if (r != null) { r.set(_rPointer.get(ValueLayout.JAVA_FLOAT, 0)); } if (g != null) { g.set(_gPointer.get(ValueLayout.JAVA_FLOAT, 0)); } if (b != null) { b.set(_bPointer.get(ValueLayout.JAVA_FLOAT, 0)); } } } /** * 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 {@code GtkApplication}, you usually don't have to call this * function; the {@code GApplication::startup} handler does it for you. Though, * if you are using GApplication methods that will be invoked before {@code startup}, * such as {@code local_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 * {@link Gtk#initCheck} instead. *

* GTK calls {@code 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. */ public static void init() { try { MethodHandles.gtk_init.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * This function does the same work as gtk_init() with only a single * change: It does not terminate the program if the windowing system * can’t be initialized. Instead it returns {@code 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. * * @return {@code true} if the windowing system has been successfully * initialized, {@code false} otherwise */ public static boolean initCheck() { int _result; try { _result = (int) MethodHandles.gtk_init_check.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return _result != 0; } /** * Use this function to check if GTK has been initialized. *

* See {@link Gtk#init}. * * @return the initialization status */ public static boolean isInitialized() { int _result; try { _result = (int) MethodHandles.gtk_is_initialized.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } return _result != 0; } /** * Creates a new {@code GParamSpec} instance for a property holding a {@code GtkExpression}. *

* See {@code g_param_spec_internal()} for details on the property strings. * * @param name canonical name of the property * @param nick a user-readable name for the property * @param blurb a user-readable description of the property * @param flags flags for the property * @return a newly created property specification */ public static ParamSpec paramSpecExpression(String name, String nick, String blurb, Set flags) { try (var _arena = Arena.ofConfined()) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_param_spec_expression.invokeExact( (MemorySegment) (name == null ? MemorySegment.NULL : Interop.allocateNativeString(name, _arena)), (MemorySegment) (nick == null ? MemorySegment.NULL : Interop.allocateNativeString(nick, _arena)), (MemorySegment) (blurb == null ? MemorySegment.NULL : Interop.allocateNativeString(blurb, _arena)), Interop.enumSetToInt(flags)); } catch (Throwable _err) { throw new AssertionError(_err); } return (ParamSpec) InstanceCache.getForType(_result, ParamSpec.ParamSpecImpl::new, true); } } /** * Creates a new {@code GParamSpec} instance for a property holding a {@code GtkExpression}. *

* See {@code g_param_spec_internal()} for details on the property strings. * * @param name canonical name of the property * @param nick a user-readable name for the property * @param blurb a user-readable description of the property * @param flags flags for the property * @return a newly created property specification */ public static ParamSpec paramSpecExpression(String name, String nick, String blurb, ParamFlags... flags) { return paramSpecExpression(name, nick, blurb, (flags == null ? null : (flags.length == 0) ? EnumSet.noneOf(ParamFlags.class) : EnumSet.of(flags[0], flags))); } /** * Runs a page setup dialog, letting the user modify the values from * {@code pageSetup}. If the user cancels the dialog, the returned {@code GtkPageSetup} * is identical to the passed in {@code pageSetup}, otherwise it contains the * modifications done in the dialog. *

* Note that this function may use a recursive mainloop to show the page * setup dialog. See gtk_print_run_page_setup_dialog_async() if this is * a problem. * * @param parent transient parent * @param pageSetup an existing {@code GtkPageSetup} * @param settings a {@code GtkPrintSettings} * @return a new {@code GtkPageSetup} */ public static PageSetup printRunPageSetupDialog(@Nullable Window parent, @Nullable PageSetup pageSetup, PrintSettings settings) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_print_run_page_setup_dialog.invokeExact( (MemorySegment) (parent == null ? MemorySegment.NULL : parent.handle()), (MemorySegment) (pageSetup == null ? MemorySegment.NULL : pageSetup.handle()), (MemorySegment) (settings == null ? MemorySegment.NULL : settings.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } return (PageSetup) InstanceCache.getForType(_result, PageSetup::new, true); } /** * Runs a page setup dialog, letting the user modify the values from {@code pageSetup}. *

* 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 {@code doneCb} * from a signal handler for the ::response signal of the dialog. * * @param parent transient parent * @param pageSetup an existing {@code GtkPageSetup} * @param settings a {@code GtkPrintSettings} * @param doneCb a function to call when the user saves * the modified page setup */ public static void printRunPageSetupDialogAsync(@Nullable Window parent, @Nullable PageSetup pageSetup, PrintSettings settings, PageSetupDoneFunc doneCb) { try (var _arena = Arena.ofConfined()) { final Arena _doneCbScope = Arena.ofConfined(); if (doneCb != null) ArenaCloseAction.CLEANER.register(doneCb, new ArenaCloseAction(_doneCbScope)); try { MethodHandles.gtk_print_run_page_setup_dialog_async.invokeExact( (MemorySegment) (parent == null ? MemorySegment.NULL : parent.handle()), (MemorySegment) (pageSetup == null ? MemorySegment.NULL : pageSetup.handle()), (MemorySegment) (settings == null ? MemorySegment.NULL : settings.handle()), (MemorySegment) (doneCb == null ? MemorySegment.NULL : doneCb.toCallback(_doneCbScope)), MemorySegment.NULL); } catch (Throwable _err) { throw new AssertionError(_err); } } } /** * Renders an activity indicator (such as in {@code GtkSpinner}). * The state {@link org.gnome.gtk.StateFlags#CHECKED} determines whether there is * activity going on. * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height */ @Deprecated public static void renderActivity(StyleContext context, Context cr, double x, double y, double width, double height) { try { MethodHandles.gtk_render_activity.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, width, height); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders an arrow pointing to {@code angle}. *

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

* * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param angle arrow angle from 0 to 2 * {@code G_PI}, being 0 the arrow pointing to the north * @param x X origin of the render area * @param y Y origin of the render area * @param size square side for render area */ @Deprecated public static void renderArrow(StyleContext context, Context cr, double angle, double x, double y, double size) { try { MethodHandles.gtk_render_arrow.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), angle, x, y, size); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders the background of an element. *

* Typical background rendering, showing the effect of * {@code background-image}, {@code border-width} and {@code border-radius}: *

* * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height */ @Deprecated public static void renderBackground(StyleContext context, Context cr, double x, double y, double width, double height) { try { MethodHandles.gtk_render_background.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, width, height); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders a checkmark (as in a {@code GtkCheckButton}). *

* The {@link org.gnome.gtk.StateFlags#CHECKED} state determines whether the check is * on or off, and {@link org.gnome.gtk.StateFlags#INCONSISTENT} determines whether it * should be marked as undefined. *

* Typical checkmark rendering: *

* * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height */ @Deprecated public static void renderCheck(StyleContext context, Context cr, double x, double y, double width, double height) { try { MethodHandles.gtk_render_check.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, width, height); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders an expander (as used in {@code GtkTreeView} and {@code GtkExpander}) in the area * defined by {@code x}, {@code y}, {@code width}, {@code height}. The state {@link org.gnome.gtk.StateFlags#CHECKED} * determines whether the expander is collapsed or expanded. *

* Typical expander rendering: *

* * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height */ @Deprecated public static void renderExpander(StyleContext context, Context cr, double x, double y, double width, double height) { try { MethodHandles.gtk_render_expander.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, width, height); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders a focus indicator on the rectangle determined by {@code x}, {@code y}, {@code width}, {@code height}. *

* Typical focus rendering: *

* * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height */ @Deprecated public static void renderFocus(StyleContext context, Context cr, double x, double y, double width, double height) { try { MethodHandles.gtk_render_focus.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, width, height); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders a frame around the rectangle defined by {@code x}, {@code y}, {@code width}, {@code height}. *

* Examples of frame rendering, showing the effect of {@code border-image}, * {@code border-color}, {@code border-width}, {@code border-radius} and junctions: *

* * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height */ @Deprecated public static void renderFrame(StyleContext context, Context cr, double x, double y, double width, double height) { try { MethodHandles.gtk_render_frame.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, width, height); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders a handle (as in {@code GtkPaned} and {@code GtkWindow}’s resize grip), * in the rectangle determined by {@code x}, {@code y}, {@code width}, {@code height}. *

* Handles rendered for the paned and grip classes: *

* * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height */ @Deprecated public static void renderHandle(StyleContext context, Context cr, double x, double y, double width, double height) { try { MethodHandles.gtk_render_handle.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, width, height); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders the icon in {@code texture} at the specified {@code x} and {@code y} coordinates. *

* This function will render the icon in {@code texture} at exactly its size, * regardless of scaling factors, which may not be appropriate when * drawing on displays with high pixel densities. * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param texture a {@code GdkTexture} containing the icon to draw * @param x X position for the {@code texture} * @param y Y position for the {@code texture} */ @Deprecated public static void renderIcon(StyleContext context, Context cr, Texture texture, double x, double y) { try { MethodHandles.gtk_render_icon.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), (MemorySegment) (texture == null ? MemorySegment.NULL : texture.handle()), x, y); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders {@code layout} on the coordinates {@code x}, {@code y} * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin * @param y Y origin * @param layout the {@code PangoLayout} to render */ @Deprecated public static void renderLayout(StyleContext context, Context cr, double x, double y, Layout layout) { try { MethodHandles.gtk_render_layout.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, (MemorySegment) (layout == null ? MemorySegment.NULL : layout.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders a line from (x0, y0) to (x1, y1). * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x0 X coordinate for the origin of the line * @param y0 Y coordinate for the origin of the line * @param x1 X coordinate for the end of the line * @param y1 Y coordinate for the end of the line */ @Deprecated public static void renderLine(StyleContext context, Context cr, double x0, double y0, double x1, double y1) { try { MethodHandles.gtk_render_line.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x0, y0, x1, y1); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Renders an option mark (as in a radio button), the {@link org.gnome.gtk.StateFlags#CHECKED} * state will determine whether the option is on or off, and * {@link org.gnome.gtk.StateFlags#INCONSISTENT} whether it should be marked as undefined. *

* Typical option mark rendering: *

* * * @param context a {@code GtkStyleContext} * @param cr a {@code cairo_t} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height */ @Deprecated public static void renderOption(StyleContext context, Context cr, double x, double y, double width, double height) { try { MethodHandles.gtk_render_option.invokeExact( (MemorySegment) (context == null ? MemorySegment.NULL : context.handle()), (MemorySegment) (cr == null ? MemorySegment.NULL : cr.handle()), x, y, width, height); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * 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. * * @param r Red * @param g Green * @param b Blue * @param h Return value for the hue component * @param s Return value for the saturation component * @param v Return value for the value component */ public static void rgbToHsv(float r, float g, float b, Out h, Out s, Out v) { try (var _arena = Arena.ofConfined()) { MemorySegment _hPointer = _arena.allocate(ValueLayout.JAVA_FLOAT); MemorySegment _sPointer = _arena.allocate(ValueLayout.JAVA_FLOAT); MemorySegment _vPointer = _arena.allocate(ValueLayout.JAVA_FLOAT); try { MethodHandles.gtk_rgb_to_hsv.invokeExact(r, g, b, (MemorySegment) (h == null ? MemorySegment.NULL : _hPointer), (MemorySegment) (s == null ? MemorySegment.NULL : _sPointer), (MemorySegment) (v == null ? MemorySegment.NULL : _vPointer)); } catch (Throwable _err) { throw new AssertionError(_err); } if (h != null) { h.set(_hPointer.get(ValueLayout.JAVA_FLOAT, 0)); } if (s != null) { s.set(_sPointer.get(ValueLayout.JAVA_FLOAT, 0)); } if (v != null) { v.set(_vPointer.get(ValueLayout.JAVA_FLOAT, 0)); } } } /** * Sets the GTK debug flags. * * @param flags the debug flags to set */ public static void setDebugFlags(Set flags) { try { MethodHandles.gtk_set_debug_flags.invokeExact(Interop.enumSetToInt(flags)); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Sets the GTK debug flags. * * @param flags the debug flags to set */ public static void setDebugFlags(DebugFlags... flags) { setDebugFlags((flags == null ? null : (flags.length == 0) ? EnumSet.noneOf(DebugFlags.class) : EnumSet.of(flags[0], flags))); } /** * 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. * * @param parent the parent top-level window * @param firstPropertyName the name of the first property * @param varargs value of first property, followed by more pairs of property * name and value, {@code NULL}-terminated */ public static void showAboutDialog(@Nullable Window parent, String firstPropertyName, Object... varargs) { try (var _arena = Arena.ofConfined()) { try { MethodHandles.gtk_show_about_dialog.invokeExact( (MemorySegment) (parent == null ? MemorySegment.NULL : parent.handle()), (MemorySegment) (firstPropertyName == null ? MemorySegment.NULL : Interop.allocateNativeString(firstPropertyName, _arena)), varargs); } catch (Throwable _err) { throw new AssertionError(_err); } } } /** * This function launches the default application for showing * a given uri, or shows an error dialog if that fails. * * @param parent parent window * @param uri the uri to show * @param timestamp timestamp from the event that triggered this call, or {@code GDK_CURRENT_TIME} * @deprecated Use {@link FileLauncher#launch} or * {@link UriLauncher#launch} instead */ @Deprecated public static void showUri(@Nullable Window parent, String uri, int timestamp) { try (var _arena = Arena.ofConfined()) { try { MethodHandles.gtk_show_uri.invokeExact( (MemorySegment) (parent == null ? MemorySegment.NULL : parent.handle()), (MemorySegment) (uri == null ? MemorySegment.NULL : Interop.allocateNativeString(uri, _arena)), timestamp); } catch (Throwable _err) { throw new AssertionError(_err); } } } /** * This function launches the default application for showing * a given uri. *

* The {@code 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. * * @param parent parent window * @param uri the uri to show * @param timestamp timestamp from the event that triggered this call, or {@code GDK_CURRENT_TIME} * @param cancellable a {@code GCancellable} to cancel the launch * @param callback a callback to call when the action is complete * @deprecated Use {@link FileLauncher#launch} or * {@link UriLauncher#launch} instead */ @Deprecated public static void showUriFull(@Nullable Window parent, String uri, int timestamp, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) { try (var _arena = Arena.ofConfined()) { final Arena _callbackScope = Arena.ofConfined(); if (callback != null) ArenaCloseAction.CLEANER.register(callback, new ArenaCloseAction(_callbackScope)); try { MethodHandles.gtk_show_uri_full.invokeExact( (MemorySegment) (parent == null ? MemorySegment.NULL : parent.handle()), (MemorySegment) (uri == null ? MemorySegment.NULL : Interop.allocateNativeString(uri, _arena)), timestamp, (MemorySegment) (cancellable == null ? MemorySegment.NULL : cancellable.handle()), (MemorySegment) (callback == null ? MemorySegment.NULL : callback.toCallback(_callbackScope)), MemorySegment.NULL); } catch (Throwable _err) { throw new AssertionError(_err); } } } /** * Finishes the gtk_show_uri() call and returns the result * of the operation. * * @param parent the {@code GtkWindow} passed to gtk_show_uri() * @param result {@code GAsyncResult} that was passed to {@code callback} * @return {@code true} if the URI was shown successfully. * Otherwise, {@code false} is returned and {@code error} is set * @throws GErrorException see {@link org.gnome.glib.GError} * @deprecated Use {@link FileLauncher#launch} or * {@link UriLauncher#launch} instead */ @Deprecated public static boolean showUriFullFinish(Window parent, AsyncResult result) throws GErrorException { try (var _arena = Arena.ofConfined()) { MemorySegment _gerror = _arena.allocate(ValueLayout.ADDRESS); int _result; try { _result = (int) MethodHandles.gtk_show_uri_full_finish.invokeExact( (MemorySegment) (parent == null ? MemorySegment.NULL : parent.handle()), (MemorySegment) (result == null ? MemorySegment.NULL : result.handle()), _gerror); } catch (Throwable _err) { throw new AssertionError(_err); } if (GErrorException.isErrorSet(_gerror)) { throw new GErrorException(_gerror); } return _result != 0; } } /** * Prints an assertion message for gtk_test_accessible_assert_role(). * * @param domain a domain * @param file a file name * @param line the line in {@code file} * @param func a function name in {@code file} * @param expr the expression being tested * @param accessible a {@code GtkAccessible} * @param expectedRole the expected {@code GtkAccessibleRole} * @param actualRole the actual {@code GtkAccessibleRole} */ public static void testAccessibleAssertionMessageRole(String domain, String file, int line, String func, String expr, Accessible accessible, AccessibleRole expectedRole, AccessibleRole actualRole) { try (var _arena = Arena.ofConfined()) { try { MethodHandles.gtk_test_accessible_assertion_message_role.invokeExact( (MemorySegment) (domain == null ? MemorySegment.NULL : Interop.allocateNativeString(domain, _arena)), (MemorySegment) (file == null ? MemorySegment.NULL : Interop.allocateNativeString(file, _arena)), line, (MemorySegment) (func == null ? MemorySegment.NULL : Interop.allocateNativeString(func, _arena)), (MemorySegment) (expr == null ? MemorySegment.NULL : Interop.allocateNativeString(expr, _arena)), (MemorySegment) (accessible == null ? MemorySegment.NULL : accessible.handle()), expectedRole.getValue(), actualRole.getValue()); } catch (Throwable _err) { throw new AssertionError(_err); } } } /** * Checks whether the accessible {@code property} of {@code accessible} is set to * a specific value. * * @param accessible a {@code GtkAccessible} * @param property a {@code GtkAccessibleProperty} * @param varargs the expected value of {@code property} * @return the value of the accessible property */ public static String testAccessibleCheckProperty(Accessible accessible, AccessibleProperty property, Object... varargs) { try (var _arena = Arena.ofConfined()) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_test_accessible_check_property.invokeExact( (MemorySegment) (accessible == null ? MemorySegment.NULL : accessible.handle()), property.getValue(), varargs); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.getStringFrom(_result, true); } } /** * Checks whether the accessible {@code relation} of {@code accessible} is set to * a specific value. * * @param accessible a {@code GtkAccessible} * @param relation a {@code GtkAccessibleRelation} * @param varargs the expected value of {@code relation} * @return the value of the accessible relation */ public static String testAccessibleCheckRelation(Accessible accessible, AccessibleRelation relation, Object... varargs) { try (var _arena = Arena.ofConfined()) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_test_accessible_check_relation.invokeExact( (MemorySegment) (accessible == null ? MemorySegment.NULL : accessible.handle()), relation.getValue(), varargs); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.getStringFrom(_result, true); } } /** * Checks whether the accessible {@code state} of {@code accessible} is set to * a specific value. * * @param accessible a {@code GtkAccessible} * @param state a {@code GtkAccessibleState} * @param varargs the expected value of {@code state} * @return the value of the accessible state */ public static String testAccessibleCheckState(Accessible accessible, AccessibleState state, Object... varargs) { try (var _arena = Arena.ofConfined()) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_test_accessible_check_state.invokeExact( (MemorySegment) (accessible == null ? MemorySegment.NULL : accessible.handle()), state.getValue(), varargs); } catch (Throwable _err) { throw new AssertionError(_err); } return Interop.getStringFrom(_result, true); } } /** * Checks whether the {@code GtkAccessible} has {@code property} set. * * @param accessible a {@code GtkAccessible} * @param property a {@code GtkAccessibleProperty} * @return {@code true} if the {@code property} is set in the {@code accessible} */ public static boolean testAccessibleHasProperty(Accessible accessible, AccessibleProperty property) { int _result; try { _result = (int) MethodHandles.gtk_test_accessible_has_property.invokeExact( (MemorySegment) (accessible == null ? MemorySegment.NULL : accessible.handle()), property.getValue()); } catch (Throwable _err) { throw new AssertionError(_err); } return _result != 0; } /** * Checks whether the {@code GtkAccessible} has {@code relation} set. * * @param accessible a {@code GtkAccessible} * @param relation a {@code GtkAccessibleRelation} * @return {@code true} if the {@code relation} is set in the {@code accessible} */ public static boolean testAccessibleHasRelation(Accessible accessible, AccessibleRelation relation) { int _result; try { _result = (int) MethodHandles.gtk_test_accessible_has_relation.invokeExact( (MemorySegment) (accessible == null ? MemorySegment.NULL : accessible.handle()), relation.getValue()); } catch (Throwable _err) { throw new AssertionError(_err); } return _result != 0; } /** * Checks whether the {@code GtkAccessible:accessible-role} of the accessible * is {@code role}. * * @param accessible a {@code GtkAccessible} * @param role a {@code GtkAccessibleRole} * @return {@code true} if the role matches */ public static boolean testAccessibleHasRole(Accessible accessible, AccessibleRole role) { int _result; try { _result = (int) MethodHandles.gtk_test_accessible_has_role.invokeExact( (MemorySegment) (accessible == null ? MemorySegment.NULL : accessible.handle()), role.getValue()); } catch (Throwable _err) { throw new AssertionError(_err); } return _result != 0; } /** * Checks whether the {@code GtkAccessible} has {@code state} set. * * @param accessible a {@code GtkAccessible} * @param state a {@code GtkAccessibleState} * @return {@code true} if the {@code state} is set in the {@code accessible} */ public static boolean testAccessibleHasState(Accessible accessible, AccessibleState state) { int _result; try { _result = (int) MethodHandles.gtk_test_accessible_has_state.invokeExact( (MemorySegment) (accessible == null ? MemorySegment.NULL : accessible.handle()), state.getValue()); } catch (Throwable _err) { throw new AssertionError(_err); } return _result != 0; } /** * 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 {@code argc} and {@code argv}. * * @param argvp Address of the {@code argv} * parameter of main(). Any parameters understood by g_test_init() * or gtk_init() are stripped before return. * @param varargs currently unused */ public static void testInit(Out argvp, Object... varargs) { try (var _arena = Arena.ofConfined()) { MemorySegment _argcpPointer = _arena.allocate(ValueLayout.JAVA_INT); _argcpPointer.set(ValueLayout.JAVA_INT, 0L, argvp == null ? 0 : argvp.get() == null ? 0 : argvp.get().length); Out argcp = new Out<>(); MemorySegment _argvpPointer = (argvp == null || argvp.get() == null) ? _arena.allocate(ValueLayout.ADDRESS) : (MemorySegment) Interop.allocateNativeArray(argvp.get(), false, Arena.global()); try { MethodHandles.gtk_test_init.invokeExact(_argcpPointer, (MemorySegment) (argvp == null ? MemorySegment.NULL : _argvpPointer), varargs); } catch (Throwable _err) { throw new AssertionError(_err); } argcp.set(_argcpPointer.get(ValueLayout.JAVA_INT, 0)); if (argvp != null) { argvp.set(io.github.jwharm.javagi.interop.Interop.getStringArrayFrom(_argvpPointer, argcp.get().intValue(), true)); } } } /** * Return the type ids that have been registered after * calling gtk_test_register_all_types(). * * @return 0-terminated array of type ids */ public static Type[] testListAllTypes() { try (var _arena = Arena.ofConfined()) { MemorySegment _nTypesPointer = _arena.allocate(ValueLayout.JAVA_INT); _nTypesPointer.set(ValueLayout.JAVA_INT, 0L, 0); Out nTypes = new Out<>(); MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_test_list_all_types.invokeExact( _nTypesPointer); } catch (Throwable _err) { throw new AssertionError(_err); } nTypes.set(_nTypesPointer.get(ValueLayout.JAVA_INT, 0)); return Type.fromNativeArray(_result, nTypes.get().intValue(), false); } } /** * 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. */ public static void testRegisterAllTypes() { try { MethodHandles.gtk_test_register_all_types.invokeExact(); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Enters the main loop and waits for {@code widget} to be “drawn”. *

* In this context that means it waits for the frame clock of * {@code 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 {@code widget} relayouting or on interaction with the display * server. * * @param widget the widget to wait for */ public static void testWidgetWaitForDraw(Widget widget) { try { MethodHandles.gtk_test_widget_wait_for_draw.invokeExact( (MemorySegment) (widget == null ? MemorySegment.NULL : widget.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Creates a content provider for dragging {@code path} from {@code treeModel}. * * @param treeModel a {@code GtkTreeModel} * @param path a row in {@code treeModel} * @return a new {@code GdkContentProvider} * @deprecated Use list models instead */ @Deprecated public static ContentProvider treeCreateRowDragContent(TreeModel treeModel, TreePath path) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_tree_create_row_drag_content.invokeExact( (MemorySegment) (treeModel == null ? MemorySegment.NULL : treeModel.handle()), (MemorySegment) (path == null ? MemorySegment.NULL : path.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } return (ContentProvider) InstanceCache.getForType(_result, ContentProvider::new, true); } /** * Obtains a {@code treeModel} and {@code path} from value of target type * {@code GTK_TYPE_TREE_ROW_DATA}. *

* The returned path must be freed with gtk_tree_path_free(). * * @param value a {@code GValue} * @param treeModel a {@code GtkTreeModel} * @param path row in {@code treeModel} * @return {@code true} if {@code selectionData} had target type {@code GTK_TYPE_TREE_ROW_DATA} * is otherwise valid * @deprecated Use list models instead */ @Deprecated public static boolean treeGetRowDragData(Value value, @Nullable Out treeModel, @Nullable Out path) { try (var _arena = Arena.ofConfined()) { MemorySegment _treeModelPointer = _arena.allocate(ValueLayout.ADDRESS); MemorySegment _pathPointer = _arena.allocate(ValueLayout.ADDRESS); int _result; try { _result = (int) MethodHandles.gtk_tree_get_row_drag_data.invokeExact( (MemorySegment) (value == null ? MemorySegment.NULL : value.handle()), (MemorySegment) (treeModel == null ? MemorySegment.NULL : _treeModelPointer), (MemorySegment) (path == null ? MemorySegment.NULL : _pathPointer)); } catch (Throwable _err) { throw new AssertionError(_err); } if (treeModel != null) { treeModel.set((TreeModel) InstanceCache.getForType(_treeModelPointer.get(ValueLayout.ADDRESS, 0), TreeModel.TreeModelImpl::new, true)); } if (path != null) { path.set(MemorySegment.NULL.equals(_pathPointer.get(ValueLayout.ADDRESS, 0)) ? null : new TreePath(_pathPointer.get(ValueLayout.ADDRESS, 0))); } return _result != 0; } } /** * Retrieves the {@code GtkExpression} stored inside the given {@code value}, and acquires * a reference to it. * * @param value a {@code GValue} initialized with type {@code GTK_TYPE_EXPRESSION} * @return a {@code GtkExpression} */ public static Expression valueDupExpression(Value value) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_value_dup_expression.invokeExact( (MemorySegment) (value == null ? MemorySegment.NULL : value.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } return (Expression) InstanceCache.getForType(_result, Expression.ExpressionImpl::new, true); } /** * Retrieves the {@code GtkExpression} stored inside the given {@code value}. * * @param value a {@code GValue} initialized with type {@code GTK_TYPE_EXPRESSION} * @return a {@code GtkExpression} */ public static Expression valueGetExpression(Value value) { MemorySegment _result; try { _result = (MemorySegment) MethodHandles.gtk_value_get_expression.invokeExact( (MemorySegment) (value == null ? MemorySegment.NULL : value.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } return (Expression) InstanceCache.getForType(_result, Expression.ExpressionImpl::new, true); } /** * Stores the given {@code GtkExpression} inside {@code value}. *

* The {@code GValue} will acquire a reference to the {@code expression}. * * @param value a {@code GValue} initialized with type {@code GTK_TYPE_EXPRESSION} * @param expression a {@code GtkExpression} */ public static void valueSetExpression(Value value, Expression expression) { try { MethodHandles.gtk_value_set_expression.invokeExact( (MemorySegment) (value == null ? MemorySegment.NULL : value.handle()), (MemorySegment) (expression == null ? MemorySegment.NULL : expression.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Stores the given {@code GtkExpression} inside {@code value}. *

* This function transfers the ownership of the {@code expression} to the {@code GValue}. * * @param value a {@code GValue} initialized with type {@code GTK_TYPE_EXPRESSION} * @param expression a {@code GtkExpression} */ public static void valueTakeExpression(Value value, @Nullable Expression expression) { if (expression != null) MemoryCleaner.yieldOwnership(expression); try { MethodHandles.gtk_value_take_expression.invokeExact( (MemorySegment) (value == null ? MemorySegment.NULL : value.handle()), (MemorySegment) (expression == null ? MemorySegment.NULL : expression.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Adds a global style provider to {@code display}, which will be used * in style construction for all {@code GtkStyleContexts} under {@code display}. *

* GTK uses this to make styling information from {@code GtkSettings} * available. *

* Note: If both priorities are the same, A {@code GtkStyleProvider} * added through {@link StyleContext#addProvider} takes * precedence over another added through this function. * * @param display a {@code GdkDisplay} * @param provider a {@code GtkStyleProvider} * @param 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 between * {@code GTK_STYLE_PROVIDER_PRIORITY_FALLBACK} and * {@code GTK_STYLE_PROVIDER_PRIORITY_USER} */ public static void styleContextAddProviderForDisplay(Display display, StyleProvider provider, int priority) { try { MethodHandles.gtk_style_context_add_provider_for_display.invokeExact( (MemorySegment) (display == null ? MemorySegment.NULL : display.handle()), (MemorySegment) (provider == null ? MemorySegment.NULL : provider.handle()), priority); } catch (Throwable _err) { throw new AssertionError(_err); } } /** * Removes {@code provider} from the global style providers list in {@code display}. * * @param display a {@code GdkDisplay} * @param provider a {@code GtkStyleProvider} */ public static void styleContextRemoveProviderForDisplay(Display display, StyleProvider provider) { try { MethodHandles.gtk_style_context_remove_provider_for_display.invokeExact( (MemorySegment) (display == null ? MemorySegment.NULL : display.handle()), (MemorySegment) (provider == null ? MemorySegment.NULL : provider.handle())); } catch (Throwable _err) { throw new AssertionError(_err); } } public static void initAbiCheck(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) { try { MethodHandles.gtk_init_abi_check.invokeExact(numChecks, sizeofGtkWindow, sizeofGtkBox); } catch (Throwable _err) { throw new AssertionError(_err); } } public static boolean initCheckAbiCheck(int numChecks, long sizeofGtkWindow, long sizeofGtkBox) { int _result; try { _result = (int) MethodHandles.gtk_init_check_abi_check.invokeExact(numChecks, sizeofGtkWindow, sizeofGtkBox); } catch (Throwable _err) { throw new AssertionError(_err); } return _result != 0; } private static final class MethodHandles { static final MethodHandle gtk_accelerator_get_default_mod_mask = Interop.downcallHandle( "gtk_accelerator_get_default_mod_mask", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_accelerator_get_label = Interop.downcallHandle( "gtk_accelerator_get_label", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_accelerator_get_label_with_keycode = Interop.downcallHandle( "gtk_accelerator_get_label_with_keycode", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_accelerator_name = Interop.downcallHandle( "gtk_accelerator_name", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_accelerator_name_with_keycode = Interop.downcallHandle( "gtk_accelerator_name_with_keycode", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_accelerator_parse = Interop.downcallHandle( "gtk_accelerator_parse", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_accelerator_parse_with_keycode = Interop.downcallHandle( "gtk_accelerator_parse_with_keycode", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_accelerator_valid = Interop.downcallHandle( "gtk_accelerator_valid", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_check_version = Interop.downcallHandle("gtk_check_version", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_css_parser_error_quark = Interop.downcallHandle( "gtk_css_parser_error_quark", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_css_parser_warning_quark = Interop.downcallHandle( "gtk_css_parser_warning_quark", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_disable_setlocale = Interop.downcallHandle( "gtk_disable_setlocale", FunctionDescriptor.ofVoid(), false); static final MethodHandle gtk_distribute_natural_allocation = Interop.downcallHandle( "gtk_distribute_natural_allocation", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.ADDRESS), false); static final MethodHandle gtk_enumerate_printers = Interop.downcallHandle( "gtk_enumerate_printers", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_get_binary_age = Interop.downcallHandle("gtk_get_binary_age", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_get_debug_flags = Interop.downcallHandle( "gtk_get_debug_flags", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_get_default_language = Interop.downcallHandle( "gtk_get_default_language", FunctionDescriptor.of(ValueLayout.ADDRESS), false); static final MethodHandle gtk_get_interface_age = Interop.downcallHandle( "gtk_get_interface_age", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_get_locale_direction = Interop.downcallHandle( "gtk_get_locale_direction", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_get_major_version = Interop.downcallHandle( "gtk_get_major_version", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_get_micro_version = Interop.downcallHandle( "gtk_get_micro_version", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_get_minor_version = Interop.downcallHandle( "gtk_get_minor_version", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_hsv_to_rgb = Interop.downcallHandle("gtk_hsv_to_rgb", FunctionDescriptor.ofVoid(ValueLayout.JAVA_FLOAT, ValueLayout.JAVA_FLOAT, ValueLayout.JAVA_FLOAT, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_init = Interop.downcallHandle("gtk_init", FunctionDescriptor.ofVoid(), false); static final MethodHandle gtk_init_check = Interop.downcallHandle("gtk_init_check", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_is_initialized = Interop.downcallHandle("gtk_is_initialized", FunctionDescriptor.of(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_param_spec_expression = Interop.downcallHandle( "gtk_param_spec_expression", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_print_run_page_setup_dialog = Interop.downcallHandle( "gtk_print_run_page_setup_dialog", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_print_run_page_setup_dialog_async = Interop.downcallHandle( "gtk_print_run_page_setup_dialog_async", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_render_activity = Interop.downcallHandle( "gtk_render_activity", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_arrow = Interop.downcallHandle("gtk_render_arrow", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_background = Interop.downcallHandle( "gtk_render_background", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_check = Interop.downcallHandle("gtk_render_check", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_expander = Interop.downcallHandle( "gtk_render_expander", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_focus = Interop.downcallHandle("gtk_render_focus", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_frame = Interop.downcallHandle("gtk_render_frame", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_handle = Interop.downcallHandle("gtk_render_handle", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_icon = Interop.downcallHandle("gtk_render_icon", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_layout = Interop.downcallHandle("gtk_render_layout", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.ADDRESS), false); static final MethodHandle gtk_render_line = Interop.downcallHandle("gtk_render_line", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_render_option = Interop.downcallHandle("gtk_render_option", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE), false); static final MethodHandle gtk_rgb_to_hsv = Interop.downcallHandle("gtk_rgb_to_hsv", FunctionDescriptor.ofVoid(ValueLayout.JAVA_FLOAT, ValueLayout.JAVA_FLOAT, ValueLayout.JAVA_FLOAT, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_set_debug_flags = Interop.downcallHandle( "gtk_set_debug_flags", FunctionDescriptor.ofVoid(ValueLayout.JAVA_INT), false); static final MethodHandle gtk_show_about_dialog = Interop.downcallHandle( "gtk_show_about_dialog", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS), true); static final MethodHandle gtk_show_uri = Interop.downcallHandle("gtk_show_uri", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_show_uri_full = Interop.downcallHandle("gtk_show_uri_full", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_show_uri_full_finish = Interop.downcallHandle( "gtk_show_uri_full_finish", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_test_accessible_assertion_message_role = Interop.downcallHandle( "gtk_test_accessible_assertion_message_role", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_test_accessible_check_property = Interop.downcallHandle( "gtk_test_accessible_check_property", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), true); static final MethodHandle gtk_test_accessible_check_relation = Interop.downcallHandle( "gtk_test_accessible_check_relation", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), true); static final MethodHandle gtk_test_accessible_check_state = Interop.downcallHandle( "gtk_test_accessible_check_state", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), true); static final MethodHandle gtk_test_accessible_has_property = Interop.downcallHandle( "gtk_test_accessible_has_property", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_test_accessible_has_relation = Interop.downcallHandle( "gtk_test_accessible_has_relation", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_test_accessible_has_role = Interop.downcallHandle( "gtk_test_accessible_has_role", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_test_accessible_has_state = Interop.downcallHandle( "gtk_test_accessible_has_state", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_test_init = Interop.downcallHandle("gtk_test_init", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS), true); static final MethodHandle gtk_test_list_all_types = Interop.downcallHandle( "gtk_test_list_all_types", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_test_register_all_types = Interop.downcallHandle( "gtk_test_register_all_types", FunctionDescriptor.ofVoid(), false); static final MethodHandle gtk_test_widget_wait_for_draw = Interop.downcallHandle( "gtk_test_widget_wait_for_draw", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS), false); static final MethodHandle gtk_tree_create_row_drag_content = Interop.downcallHandle( "gtk_tree_create_row_drag_content", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_tree_get_row_drag_data = Interop.downcallHandle( "gtk_tree_get_row_drag_data", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_value_dup_expression = Interop.downcallHandle( "gtk_value_dup_expression", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_value_get_expression = Interop.downcallHandle( "gtk_value_get_expression", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_value_set_expression = Interop.downcallHandle( "gtk_value_set_expression", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_value_take_expression = Interop.downcallHandle( "gtk_value_take_expression", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_style_context_add_provider_for_display = Interop.downcallHandle( "gtk_style_context_add_provider_for_display", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.JAVA_INT), false); static final MethodHandle gtk_style_context_remove_provider_for_display = Interop.downcallHandle( "gtk_style_context_remove_provider_for_display", FunctionDescriptor.ofVoid(ValueLayout.ADDRESS, ValueLayout.ADDRESS), false); static final MethodHandle gtk_init_abi_check = Interop.downcallHandle("gtk_init_abi_check", FunctionDescriptor.ofVoid(ValueLayout.JAVA_INT, ValueLayout.JAVA_LONG, ValueLayout.JAVA_LONG), false); static final MethodHandle gtk_init_check_abi_check = Interop.downcallHandle( "gtk_init_check_abi_check", FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.JAVA_LONG, ValueLayout.JAVA_LONG), false); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy