/** * Type Definitions for Gjs (https://gjs.guide/) * * These type definitions are automatically generated, do not edit them by hand. * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir * * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ... */ import '@girs/gjs'; // Module dependencies import type xlib from '@girs/xlib-2.0'; import type Gdk from '@girs/gdk-3.0'; import type cairo from 'cairo'; import type GObject from '@girs/gobject-2.0'; import type GLib from '@girs/glib-2.0'; import type Pango from '@girs/pango-1.0'; import type HarfBuzz from '@girs/harfbuzz-0.0'; import type freetype2 from '@girs/freetype2-2.0'; import type Gio from '@girs/gio-2.0'; import type GModule from '@girs/gmodule-2.0'; import type GdkPixbuf from '@girs/gdkpixbuf-2.0'; import type Atk from '@girs/atk-1.0'; export namespace Gtk { /** * Gtk-3.0 */ /** * @gir-type Enum */ export namespace Align { export const $gtype: GObject.GType; } /** * Controls how a widget deals with extra space in a single (x or y) * dimension. * * Alignment only matters if the widget receives a “too large” allocation, * for example if you packed the widget with the {@link Gtk.Widget.expand} * flag inside a {@link Gtk.Box}, then the widget might get extra space. If * you have for example a 16x16 icon inside a 32x32 space, the icon * could be scaled and stretched, it could be centered, or it could be * positioned to one side of the space. * * Note that in horizontal context `GTK_ALIGN_START` and `GTK_ALIGN_END` * are interpreted relative to text direction. * * GTK_ALIGN_BASELINE support for it is optional for containers and widgets, and * it is only supported for vertical alignment. When its not supported by * a child or a container it is treated as `GTK_ALIGN_FILL`. * @gir-type Enum */ enum Align { /** * stretch to fill all space if possible, center if * no meaningful way to stretch */ FILL, /** * snap to left or top side, leaving space on right * or bottom */ START, /** * snap to right or bottom side, leaving space on left * or top */ END, /** * center natural width of widget inside the * allocation */ CENTER, /** * align the widget according to the baseline. Since 3.10. */ BASELINE, } /** * @gir-type Enum */ export namespace ArrowPlacement { export const $gtype: GObject.GType; } /** * Used to specify the placement of scroll arrows in scrolling menus. * @gir-type Enum */ enum ArrowPlacement { /** * Place one arrow on each end of the menu. */ BOTH, /** * Place both arrows at the top of the menu. */ START, /** * Place both arrows at the bottom of the menu. */ END, } /** * @gir-type Enum */ export namespace ArrowType { export const $gtype: GObject.GType; } /** * Used to indicate the direction in which an arrow should point. * @gir-type Enum */ enum ArrowType { /** * Represents an upward pointing arrow. */ UP, /** * Represents a downward pointing arrow. */ DOWN, /** * Represents a left pointing arrow. */ LEFT, /** * Represents a right pointing arrow. */ RIGHT, /** * No arrow. Since 2.10. */ NONE, } /** * @gir-type Enum */ export namespace AssistantPageType { export const $gtype: GObject.GType; } /** * An enum for determining the page role inside the {@link Gtk.Assistant}. It's * used to handle buttons sensitivity and visibility. * * Note that an assistant needs to end its page flow with a page of type * {@link Gtk.AssistantPageType.CONFIRM}, {@link Gtk.AssistantPageType.SUMMARY} or * {@link Gtk.AssistantPageType.PROGRESS} to be correct. * * The Cancel button will only be shown if the page isn’t “committed”. * See `gtk_assistant_commit()` for details. * @gir-type Enum */ enum AssistantPageType { /** * The page has regular contents. Both the * Back and forward buttons will be shown. */ CONTENT, /** * The page contains an introduction to the * assistant task. Only the Forward button will be shown if there is a * next page. */ INTRO, /** * The page lets the user confirm or deny the * changes. The Back and Apply buttons will be shown. */ CONFIRM, /** * The page informs the user of the changes * done. Only the Close button will be shown. */ SUMMARY, /** * Used for tasks that take a long time to * complete, blocks the assistant until the page is marked as complete. * Only the back button will be shown. */ PROGRESS, /** * Used for when other page types are not * appropriate. No buttons will be shown, and the application must * add its own buttons through `gtk_assistant_add_action_widget()`. */ CUSTOM, } /** * @gir-type Enum */ export namespace BaselinePosition { export const $gtype: GObject.GType; } /** * Whenever a container has some form of natural row it may align * children in that row along a common typographical baseline. If * the amount of verical space in the row is taller than the total * requested height of the baseline-aligned children then it can use a * {@link Gtk.BaselinePosition} to select where to put the baseline inside the * extra availible space. * @gir-type Enum * @since 3.10 */ enum BaselinePosition { /** * Align the baseline at the top */ TOP, /** * Center the baseline */ CENTER, /** * Align the baseline at the bottom */ BOTTOM, } /** * @gir-type Enum */ export namespace BorderStyle { export const $gtype: GObject.GType; } /** * Describes how the border of a UI element should be rendered. * @gir-type Enum */ enum BorderStyle { /** * No visible border */ NONE, /** * A single line segment */ SOLID, /** * Looks as if the content is sunken into the canvas */ INSET, /** * Looks as if the content is coming out of the canvas */ OUTSET, /** * Same as `GTK_BORDER_STYLE_NONE` */ HIDDEN, /** * A series of round dots */ DOTTED, /** * A series of square-ended dashes */ DASHED, /** * Two parallel lines with some space between them */ DOUBLE, /** * Looks as if it were carved in the canvas */ GROOVE, /** * Looks as if it were coming out of the canvas */ RIDGE, } /** * Error codes that identify various errors that can occur while using * {@link Gtk.Builder}. * @gir-type Struct */ class BuilderError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * A type-func attribute didn’t name * a function that returns a {@link GObject.GType}. */ static INVALID_TYPE_FUNCTION: number; /** * The input contained a tag that {@link Gtk.Builder} * can’t handle. */ static UNHANDLED_TAG: number; /** * An attribute that is required by * {@link Gtk.Builder} was missing. */ static MISSING_ATTRIBUTE: number; /** * {@link Gtk.Builder} found an attribute that * it doesn’t understand. */ static INVALID_ATTRIBUTE: number; /** * {@link Gtk.Builder} found a tag that * it doesn’t understand. */ static INVALID_TAG: number; /** * A required property value was * missing. */ static MISSING_PROPERTY_VALUE: number; /** * {@link Gtk.Builder} couldn’t parse * some attribute value. */ static INVALID_VALUE: number; /** * The input file requires a newer version * of GTK+. */ static VERSION_MISMATCH: number; /** * An object id occurred twice. */ static DUPLICATE_ID: number; /** * A specified object type is of the same type or * derived from the type of the composite class being extended with builder XML. */ static OBJECT_TYPE_REFUSED: number; /** * The wrong type was specified in a composite class’s template XML */ static TEMPLATE_MISMATCH: number; /** * The specified property is unknown for the object class. */ static INVALID_PROPERTY: number; /** * The specified signal is unknown for the object class. */ static INVALID_SIGNAL: number; /** * An object id is unknown */ static INVALID_ID: number; // Constructors constructor(options: { message: string; code: number }); // Static methods static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace ButtonBoxStyle { export const $gtype: GObject.GType; } /** * Used to dictate the style that a {@link Gtk.ButtonBox} uses to layout the buttons it * contains. * @gir-type Enum */ enum ButtonBoxStyle { /** * Buttons are evenly spread across the box. */ SPREAD, /** * Buttons are placed at the edges of the box. */ EDGE, /** * Buttons are grouped towards the start of the box, * (on the left for a HBox, or the top for a VBox). */ START, /** * Buttons are grouped towards the end of the box, * (on the right for a HBox, or the bottom for a VBox). */ END, /** * Buttons are centered in the box. Since 2.12. */ CENTER, /** * Buttons expand to fill the box. This entails giving * buttons a "linked" appearance, making button sizes homogeneous, and * setting spacing to 0 (same as calling `gtk_box_set_homogeneous()` and * `gtk_box_set_spacing()` manually). Since 3.12. */ EXPAND, } /** * @gir-type Enum */ export namespace ButtonRole { export const $gtype: GObject.GType; } /** * The role specifies the desired appearance of a {@link Gtk.ModelButton}. * @gir-type Enum */ enum ButtonRole { /** * A plain button */ NORMAL, /** * A check button */ CHECK, /** * A radio button */ RADIO, } /** * @gir-type Enum */ export namespace ButtonsType { export const $gtype: GObject.GType; } /** * Prebuilt sets of buttons for the dialog. If * none of these choices are appropriate, simply use {@link Gtk.ButtonsType.NONE} * then call `gtk_dialog_add_buttons()`. * * > Please note that {@link Gtk.ButtonsType.OK}, {@link Gtk.ButtonsType.YES_NO} * > and {@link Gtk.ButtonsType.OK_CANCEL} are discouraged by the * > [GNOME Human Interface Guidelines](http://library.gnome.org/devel/hig-book/stable/). * @gir-type Enum */ enum ButtonsType { /** * no buttons at all */ NONE, /** * an OK button */ OK, /** * a Close button */ CLOSE, /** * a Cancel button */ CANCEL, /** * Yes and No buttons */ YES_NO, /** * OK and Cancel buttons */ OK_CANCEL, } /** * @gir-type Enum */ export namespace CellRendererAccelMode { export const $gtype: GObject.GType; } /** * Determines if the edited accelerators are GTK+ accelerators. If * they are, consumed modifiers are suppressed, only accelerators * accepted by GTK+ are allowed, and the accelerators are rendered * in the same way as they are in menus. * @gir-type Enum */ enum CellRendererAccelMode { /** * GTK+ accelerators mode */ GTK, /** * Other accelerator mode */ OTHER, } /** * @gir-type Enum */ export namespace CellRendererMode { export const $gtype: GObject.GType; } /** * Identifies how the user can interact with a particular cell. * @gir-type Enum */ enum CellRendererMode { /** * The cell is just for display * and cannot be interacted with. Note that this doesn’t mean that eg. the * row being drawn can’t be selected -- just that a particular element of * it cannot be individually modified. */ INERT, /** * The cell can be clicked. */ ACTIVATABLE, /** * The cell can be edited or otherwise modified. */ EDITABLE, } /** * @gir-type Enum */ export namespace CornerType { export const $gtype: GObject.GType; } /** * Specifies which corner a child widget should be placed in when packed into * a {@link Gtk.ScrolledWindow}. This is effectively the opposite of where the scroll * bars are placed. * @gir-type Enum */ enum CornerType { /** * Place the scrollbars on the right and bottom of the * widget (default behaviour). */ TOP_LEFT, /** * Place the scrollbars on the top and right of the * widget. */ BOTTOM_LEFT, /** * Place the scrollbars on the left and bottom of the * widget. */ TOP_RIGHT, /** * Place the scrollbars on the top and left of the * widget. */ BOTTOM_RIGHT, } /** * Error codes for `GTK_CSS_PROVIDER_ERROR`. * @gir-type Struct */ class CssProviderError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * Failed. */ static FAILED: number; /** * Syntax error. */ static SYNTAX: number; /** * Import error. */ static IMPORT: number; /** * Name error. */ static NAME: number; /** * Deprecation error. */ static DEPRECATED: number; /** * Unknown value. */ static UNKNOWN_VALUE: number; // Constructors constructor(options: { message: string; code: number }); // Static methods static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace CssSectionType { export const $gtype: GObject.GType; } /** * The different types of sections indicate parts of a CSS document as * parsed by GTK’s CSS parser. They are oriented towards the * [CSS Grammar](http://www.w3.org/TR/CSS21/grammar.html), * but may contain extensions. * * More types might be added in the future as the parser incorporates * more features. * @gir-type Enum * @since 3.2 */ enum CssSectionType { /** * The section describes a complete document. * This section time is the only one where `gtk_css_section_get_parent()` * might return `null`. */ DOCUMENT, /** * The section defines an import rule. */ IMPORT, /** * The section defines a color. This * is a GTK extension to CSS. */ COLOR_DEFINITION, /** * The section defines a binding set. This * is a GTK extension to CSS. */ BINDING_SET, /** * The section defines a CSS ruleset. */ RULESET, /** * The section defines a CSS selector. */ SELECTOR, /** * The section defines the declaration of * a CSS variable. */ DECLARATION, /** * The section defines the value of a CSS declaration. */ VALUE, /** * The section defines keyframes. See [CSS * Animations](http://dev.w3.org/csswg/css3-animations/#keyframes) for details. Since 3.6 */ KEYFRAMES, } /** * @gir-type Enum */ export namespace DeleteType { export const $gtype: GObject.GType; } /** * See also: {@link Gtk.Entry.SignalSignatures.delete_from_cursor | Gtk.Entry::delete-from-cursor}. * @gir-type Enum */ enum DeleteType { /** * Delete characters. */ CHARS, /** * Delete only the portion of the word to the * left/right of cursor if we’re in the middle of a word. */ WORD_ENDS, /** * Delete words. */ WORDS, /** * Delete display-lines. Display-lines * refers to the visible lines, with respect to to the current line * breaks. As opposed to paragraphs, which are defined by line * breaks in the input. */ DISPLAY_LINES, /** * Delete only the portion of the * display-line to the left/right of cursor. */ DISPLAY_LINE_ENDS, /** * Delete to the end of the * paragraph. Like C-k in Emacs (or its reverse). */ PARAGRAPH_ENDS, /** * Delete entire line. Like C-k in pico. */ PARAGRAPHS, /** * Delete only whitespace. Like M-\ in Emacs. */ WHITESPACE, } /** * @gir-type Enum */ export namespace DirectionType { export const $gtype: GObject.GType; } /** * Focus movement types. * @gir-type Enum */ enum DirectionType { /** * Move forward. */ TAB_FORWARD, /** * Move backward. */ TAB_BACKWARD, /** * Move up. */ UP, /** * Move down. */ DOWN, /** * Move left. */ LEFT, /** * Move right. */ RIGHT, } /** * @gir-type Enum */ export namespace DragResult { export const $gtype: GObject.GType; } /** * Gives an indication why a drag operation failed. * The value can by obtained by connecting to the * {@link Gtk.Widget.SignalSignatures.drag_failed | Gtk.Widget::drag-failed} signal. * @gir-type Enum */ enum DragResult { /** * The drag operation was successful. */ SUCCESS, /** * No suitable drag target. */ NO_TARGET, /** * The user cancelled the drag operation. */ USER_CANCELLED, /** * The drag operation timed out. */ TIMEOUT_EXPIRED, /** * The pointer or keyboard grab used * for the drag operation was broken. */ GRAB_BROKEN, /** * The drag operation failed due to some * unspecified error. */ ERROR, } /** * @gir-type Enum */ export namespace EntryIconPosition { export const $gtype: GObject.GType; } /** * Specifies the side of the entry at which an icon is placed. * @gir-type Enum * @since 2.16 */ enum EntryIconPosition { /** * At the beginning of the entry (depending on the text direction). */ PRIMARY, /** * At the end of the entry (depending on the text direction). */ SECONDARY, } /** * @gir-type Enum */ export namespace EventSequenceState { export const $gtype: GObject.GType; } /** * Describes the state of a {@link Gdk.EventSequence} in a {@link Gtk.Gesture}. * @gir-type Enum * @since 3.14 */ enum EventSequenceState { /** * The sequence is handled, but not grabbed. */ NONE, /** * The sequence is handled and grabbed. */ CLAIMED, /** * The sequence is denied. */ DENIED, } /** * @gir-type Enum */ export namespace ExpanderStyle { export const $gtype: GObject.GType; } /** * Used to specify the style of the expanders drawn by a {@link Gtk.TreeView}. * @gir-type Enum */ enum ExpanderStyle { /** * The style used for a collapsed subtree. */ COLLAPSED, /** * Intermediate style used during animation. */ SEMI_COLLAPSED, /** * Intermediate style used during animation. */ SEMI_EXPANDED, /** * The style used for an expanded subtree. */ EXPANDED, } /** * @gir-type Enum */ export namespace FileChooserAction { export const $gtype: GObject.GType; } /** * Describes whether a {@link Gtk.FileChooser} is being used to open existing files * or to save to a possibly new file. * @gir-type Enum */ enum FileChooserAction { /** * Indicates open mode. The file chooser * will only let the user pick an existing file. */ OPEN, /** * Indicates save mode. The file chooser * will let the user pick an existing file, or type in a new * filename. */ SAVE, /** * Indicates an Open mode for * selecting folders. The file chooser will let the user pick an * existing folder. */ SELECT_FOLDER, /** * Indicates a mode for creating a * new folder. The file chooser will let the user name an existing or * new folder. */ CREATE_FOLDER, } /** * @gir-type Enum */ export namespace FileChooserConfirmation { export const $gtype: GObject.GType; } /** * Used as a return value of handlers for the * {@link Gtk.FileChooser.SignalSignatures.confirm_overwrite | Gtk.FileChooser::confirm-overwrite} signal of a {@link Gtk.FileChooser}. This * value determines whether the file chooser will present the stock * confirmation dialog, accept the user’s choice of a filename, or * let the user choose another filename. * @gir-type Enum * @since 2.8 */ enum FileChooserConfirmation { /** * The file chooser will present * its stock dialog to confirm about overwriting an existing file. */ CONFIRM, /** * The file chooser will * terminate and accept the user’s choice of a file name. */ ACCEPT_FILENAME, /** * The file chooser will * continue running, so as to let the user select another file name. */ SELECT_AGAIN, } /** * These identify the various errors that can occur while calling * {@link Gtk.FileChooser} functions. * @gir-type Struct */ class FileChooserError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * Indicates that a file does not exist. */ static NONEXISTENT: number; /** * Indicates a malformed filename. */ static BAD_FILENAME: number; /** * Indicates a duplicate path (e.g. when * adding a bookmark). */ static ALREADY_EXISTS: number; /** * Indicates an incomplete hostname (e.g. "http://foo" without a slash after that). */ static INCOMPLETE_HOSTNAME: number; // Constructors constructor(options: { message: string; code: number }); // Static methods /** * Registers an error quark for {@link Gtk.FileChooser} if necessary. */ static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace IMPreeditStyle { export const $gtype: GObject.GType; } /** * Style for input method preedit. See also * {@link Gtk.Settings.gtk_im_preedit_style} * @gir-type Enum * @deprecated since 3.10 */ enum IMPreeditStyle { /** * Deprecated */ NOTHING, /** * Deprecated */ CALLBACK, /** * Deprecated */ NONE, } /** * @gir-type Enum */ export namespace IMStatusStyle { export const $gtype: GObject.GType; } /** * Style for input method status. See also * {@link Gtk.Settings.gtk_im_status_style} * @gir-type Enum * @deprecated since 3.10 */ enum IMStatusStyle { /** * Deprecated */ NOTHING, /** * Deprecated */ CALLBACK, /** * Deprecated */ NONE, } /** * @gir-type Enum */ export namespace IconSize { export const $gtype: GObject.GType; } /** * Built-in stock icon sizes. * @gir-type Enum */ enum IconSize { /** * Invalid size. */ INVALID, /** * Size appropriate for menus (16px). */ MENU, /** * Size appropriate for small toolbars (16px). */ SMALL_TOOLBAR, /** * Size appropriate for large toolbars (24px) */ LARGE_TOOLBAR, /** * Size appropriate for buttons (16px) */ BUTTON, /** * Size appropriate for drag and drop (32px) */ DND, /** * Size appropriate for dialogs (48px) */ DIALOG, } /** * Error codes for GtkIconTheme operations. * @gir-type Struct */ class IconThemeError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * The icon specified does not exist in the theme */ static NOT_FOUND: number; /** * An unspecified error occurred. */ static FAILED: number; // Constructors constructor(options: { message: string; code: number }); // Static methods static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace IconViewDropPosition { export const $gtype: GObject.GType; } /** * An enum for determining where a dropped item goes. * @gir-type Enum */ enum IconViewDropPosition { /** * no drop possible */ NO_DROP, /** * dropped item replaces the item */ DROP_INTO, /** * droppped item is inserted to the left */ DROP_LEFT, /** * dropped item is inserted to the right */ DROP_RIGHT, /** * dropped item is inserted above */ DROP_ABOVE, /** * dropped item is inserted below */ DROP_BELOW, } /** * @gir-type Enum */ export namespace ImageType { export const $gtype: GObject.GType; } /** * Describes the image data representation used by a {@link Gtk.Image}. If you * want to get the image from the widget, you can only get the * currently-stored representation. e.g. if the * `gtk_image_get_storage_type()` returns #GTK_IMAGE_PIXBUF, then you can * call `gtk_image_get_pixbuf()` but not `gtk_image_get_stock()`. For empty * images, you can request any storage type (call any of the "get" * functions), but they will all return `null` values. * @gir-type Enum */ enum ImageType { /** * there is no image displayed by the widget */ EMPTY, /** * the widget contains a {@link GdkPixbuf.Pixbuf} */ PIXBUF, /** * the widget contains a [stock item name][gtkstock] */ STOCK, /** * the widget contains a {@link Gtk.IconSet} */ ICON_SET, /** * the widget contains a {@link GdkPixbuf.PixbufAnimation} */ ANIMATION, /** * the widget contains a named icon. * This image type was added in GTK+ 2.6 */ ICON_NAME, /** * the widget contains a {@link Gio.Icon}. * This image type was added in GTK+ 2.14 */ GICON, /** * the widget contains a {@link cairo.Surface}. * This image type was added in GTK+ 3.10 */ SURFACE, } /** * @gir-type Enum */ export namespace InputPurpose { export const $gtype: GObject.GType; } /** * Describes primary purpose of the input widget. This information is * useful for on-screen keyboards and similar input methods to decide * which keys should be presented to the user. * * Note that the purpose is not meant to impose a totally strict rule * about allowed characters, and does not replace input validation. * It is fine for an on-screen keyboard to let the user override the * character set restriction that is expressed by the purpose. The * application is expected to validate the entry contents, even if * it specified a purpose. * * The difference between `GTK_INPUT_PURPOSE_DIGITS` and * `GTK_INPUT_PURPOSE_NUMBER` is that the former accepts only digits * while the latter also some punctuation (like commas or points, plus, * minus) and “e” or “E” as in 3.14E+000. * * This enumeration may be extended in the future; input methods should * interpret unknown values as “free form”. * @gir-type Enum * @since 3.6 */ enum InputPurpose { /** * Allow any character */ FREE_FORM, /** * Allow only alphabetic characters */ ALPHA, /** * Allow only digits */ DIGITS, /** * Edited field expects numbers */ NUMBER, /** * Edited field expects phone number */ PHONE, /** * Edited field expects URL */ URL, /** * Edited field expects email address */ EMAIL, /** * Edited field expects the name of a person */ NAME, /** * Like `GTK_INPUT_PURPOSE_FREE_FORM`, but characters are hidden */ PASSWORD, /** * Like `GTK_INPUT_PURPOSE_DIGITS`, but characters are hidden */ PIN, /** * Allow any character, in addition to control codes */ TERMINAL, } /** * @gir-type Enum */ export namespace Justification { export const $gtype: GObject.GType; } /** * Used for justifying the text inside a {@link Gtk.Label} widget. (See also * {@link Gtk.Alignment}). * @gir-type Enum */ enum Justification { /** * The text is placed at the left edge of the label. */ LEFT, /** * The text is placed at the right edge of the label. */ RIGHT, /** * The text is placed in the center of the label. */ CENTER, /** * The text is placed is distributed across the label. */ FILL, } /** * @gir-type Enum */ export namespace LevelBarMode { export const $gtype: GObject.GType; } /** * Describes how {@link Gtk.LevelBar} contents should be rendered. * Note that this enumeration could be extended with additional modes * in the future. * @gir-type Enum * @since 3.6 */ enum LevelBarMode { /** * the bar has a continuous mode */ CONTINUOUS, /** * the bar has a discrete mode */ DISCRETE, } /** * @gir-type Enum */ export namespace License { export const $gtype: GObject.GType; } /** * The type of license for an application. * * This enumeration can be expanded at later date. * @gir-type Enum * @since 3.0 */ enum License { /** * No license specified */ UNKNOWN, /** * A license text is going to be specified by the * developer */ CUSTOM, /** * The GNU General Public License, version 2.0 or later */ GPL_2_0, /** * The GNU General Public License, version 3.0 or later */ GPL_3_0, /** * The GNU Lesser General Public License, version 2.1 or later */ LGPL_2_1, /** * The GNU Lesser General Public License, version 3.0 or later */ LGPL_3_0, /** * The BSD standard license */ BSD, /** * The MIT/X11 standard license */ MIT_X11, /** * The Artistic License, version 2.0 */ ARTISTIC, /** * The GNU General Public License, version 2.0 only. Since 3.12. */ GPL_2_0_ONLY, /** * The GNU General Public License, version 3.0 only. Since 3.12. */ GPL_3_0_ONLY, /** * The GNU Lesser General Public License, version 2.1 only. Since 3.12. */ LGPL_2_1_ONLY, /** * The GNU Lesser General Public License, version 3.0 only. Since 3.12. */ LGPL_3_0_ONLY, /** * The GNU Affero General Public License, version 3.0 or later. Since: 3.22. */ AGPL_3_0, /** * The GNU Affero General Public License, version 3.0 only. Since: 3.22.27. */ AGPL_3_0_ONLY, /** * The 3-clause BSD licence. Since: 3.24.20. */ BSD_3, /** * The Apache License, version 2.0. Since: 3.24.20. */ APACHE_2_0, /** * The Mozilla Public License, version 2.0. Since: 3.24.20. */ MPL_2_0, } /** * @gir-type Enum */ export namespace MenuDirectionType { export const $gtype: GObject.GType; } /** * An enumeration representing directional movements within a menu. * @gir-type Enum */ enum MenuDirectionType { /** * To the parent menu shell */ PARENT, /** * To the submenu, if any, associated with the item */ CHILD, /** * To the next menu item */ NEXT, /** * To the previous menu item */ PREV, } /** * @gir-type Enum */ export namespace MessageType { export const $gtype: GObject.GType; } /** * The type of message being displayed in the dialog. * @gir-type Enum */ enum MessageType { /** * Informational message */ INFO, /** * Non-fatal warning message */ WARNING, /** * Question requiring a choice */ QUESTION, /** * Fatal error message */ ERROR, /** * None of the above */ OTHER, } /** * @gir-type Enum */ export namespace MovementStep { export const $gtype: GObject.GType; } /** * @gir-type Enum */ enum MovementStep { /** * Move forward or back by graphemes */ LOGICAL_POSITIONS, /** * Move left or right by graphemes */ VISUAL_POSITIONS, /** * Move forward or back by words */ WORDS, /** * Move up or down lines (wrapped lines) */ DISPLAY_LINES, /** * Move to either end of a line */ DISPLAY_LINE_ENDS, /** * Move up or down paragraphs (newline-ended lines) */ PARAGRAPHS, /** * Move to either end of a paragraph */ PARAGRAPH_ENDS, /** * Move by pages */ PAGES, /** * Move to ends of the buffer */ BUFFER_ENDS, /** * Move horizontally by pages */ HORIZONTAL_PAGES, } /** * @gir-type Enum */ export namespace NotebookTab { export const $gtype: GObject.GType; } /** * @gir-type Enum */ enum NotebookTab { FIRST, LAST, } /** * @gir-type Enum */ export namespace NumberUpLayout { export const $gtype: GObject.GType; } /** * Used to determine the layout of pages on a sheet when printing * multiple pages per sheet. * @gir-type Enum */ enum NumberUpLayout { /** * ![](layout-lrtb.png) */ LRTB, /** * ![](layout-lrbt.png) */ LRBT, /** * ![](layout-rltb.png) */ RLTB, /** * ![](layout-rlbt.png) */ RLBT, /** * ![](layout-tblr.png) */ TBLR, /** * ![](layout-tbrl.png) */ TBRL, /** * ![](layout-btlr.png) */ BTLR, /** * ![](layout-btrl.png) */ BTRL, } /** * @gir-type Enum */ export namespace Orientation { export const $gtype: GObject.GType; } /** * Represents the orientation of widgets and other objects which can be switched * between horizontal and vertical orientation on the fly, like {@link Gtk.Toolbar} or * {@link Gtk.GesturePan}. * @gir-type Enum */ enum Orientation { /** * The element is in horizontal orientation. */ HORIZONTAL, /** * The element is in vertical orientation. */ VERTICAL, } /** * @gir-type Enum */ export namespace PackDirection { export const $gtype: GObject.GType; } /** * Determines how widgets should be packed inside menubars * and menuitems contained in menubars. * @gir-type Enum */ enum PackDirection { /** * Widgets are packed left-to-right */ LTR, /** * Widgets are packed right-to-left */ RTL, /** * Widgets are packed top-to-bottom */ TTB, /** * Widgets are packed bottom-to-top */ BTT, } /** * @gir-type Enum */ export namespace PackType { export const $gtype: GObject.GType; } /** * Represents the packing location {@link Gtk.Box} children. (See: {@link Gtk.VBox}, * {@link Gtk.HBox}, and {@link Gtk.ButtonBox}). * @gir-type Enum */ enum PackType { /** * The child is packed into the start of the box */ START, /** * The child is packed into the end of the box */ END, } /** * @gir-type Enum */ export namespace PadActionType { export const $gtype: GObject.GType; } /** * The type of a pad action. * @gir-type Enum */ enum PadActionType { /** * Action is triggered by a pad button */ BUTTON, /** * Action is triggered by a pad ring */ RING, /** * Action is triggered by a pad strip */ STRIP, } /** * @gir-type Enum */ export namespace PageOrientation { export const $gtype: GObject.GType; } /** * See also `gtk_print_settings_set_orientation()`. * @gir-type Enum */ enum PageOrientation { /** * Portrait mode. */ PORTRAIT, /** * Landscape mode. */ LANDSCAPE, /** * Reverse portrait mode. */ REVERSE_PORTRAIT, /** * Reverse landscape mode. */ REVERSE_LANDSCAPE, } /** * @gir-type Enum */ export namespace PageSet { export const $gtype: GObject.GType; } /** * See also `gtk_print_job_set_page_set()`. * @gir-type Enum */ enum PageSet { /** * All pages. */ ALL, /** * Even pages. */ EVEN, /** * Odd pages. */ ODD, } /** * @gir-type Enum */ export namespace PanDirection { export const $gtype: GObject.GType; } /** * Describes the panning direction of a {@link Gtk.GesturePan} * @gir-type Enum * @since 3.14 */ enum PanDirection { /** * panned towards the left */ LEFT, /** * panned towards the right */ RIGHT, /** * panned upwards */ UP, /** * panned downwards */ DOWN, } /** * @gir-type Enum */ export namespace PathPriorityType { export const $gtype: GObject.GType; } /** * Priorities for path lookups. * See also `gtk_binding_set_add_path()`. * @gir-type Enum * @deprecated since 3.0 */ enum PathPriorityType { /** * Deprecated */ LOWEST, /** * Deprecated */ GTK, /** * Deprecated */ APPLICATION, /** * Deprecated */ THEME, /** * Deprecated */ RC, /** * Deprecated */ HIGHEST, } /** * @gir-type Enum */ export namespace PathType { export const $gtype: GObject.GType; } /** * Widget path types. * See also `gtk_binding_set_add_path()`. * @gir-type Enum * @deprecated since 3.0 */ enum PathType { /** * Deprecated */ WIDGET, /** * Deprecated */ WIDGET_CLASS, /** * Deprecated */ CLASS, } /** * @gir-type Enum */ export namespace PolicyType { export const $gtype: GObject.GType; } /** * Determines how the size should be computed to achieve the one of the * visibility mode for the scrollbars. * @gir-type Enum */ enum PolicyType { /** * The scrollbar is always visible. The view size is * independent of the content. */ ALWAYS, /** * The scrollbar will appear and disappear as necessary. * For example, when all of a {@link Gtk.TreeView} can not be seen. */ AUTOMATIC, /** * The scrollbar should never appear. In this mode the * content determines the size. */ NEVER, /** * Don't show a scrollbar, but don't force the * size to follow the content. This can be used e.g. to make multiple * scrolled windows share a scrollbar. Since: 3.16 */ EXTERNAL, } /** * @gir-type Enum */ export namespace PopoverConstraint { export const $gtype: GObject.GType; } /** * Describes constraints to positioning of popovers. More values * may be added to this enumeration in the future. * @gir-type Enum * @since 3.20 */ enum PopoverConstraint { /** * Don't constrain the popover position * beyond what is imposed by the implementation */ NONE, /** * Constrain the popover to the boundaries * of the window that it is attached to */ WINDOW, } /** * @gir-type Enum */ export namespace PositionType { export const $gtype: GObject.GType; } /** * Describes which edge of a widget a certain feature is positioned at, e.g. the * tabs of a {@link Gtk.Notebook}, the handle of a {@link Gtk.HandleBox} or the label of a * {@link Gtk.Scale}. * @gir-type Enum */ enum PositionType { /** * The feature is at the left edge. */ LEFT, /** * The feature is at the right edge. */ RIGHT, /** * The feature is at the top edge. */ TOP, /** * The feature is at the bottom edge. */ BOTTOM, } /** * @gir-type Enum */ export namespace PrintDuplex { export const $gtype: GObject.GType; } /** * See also `gtk_print_settings_set_duplex()`. * @gir-type Enum */ enum PrintDuplex { /** * No duplex. */ SIMPLEX, /** * Horizontal duplex. */ HORIZONTAL, /** * Vertical duplex. */ VERTICAL, } /** * Error codes that identify various errors that can occur while * using the GTK+ printing support. * @gir-type Struct */ class PrintError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * An unspecified error occurred. */ static GENERAL: number; /** * An internal error occurred. */ static INTERNAL_ERROR: number; /** * A memory allocation failed. */ static NOMEM: number; /** * An error occurred while loading a page setup * or paper size from a key file. */ static INVALID_FILE: number; // Constructors constructor(options: { message: string; code: number }); // Static methods /** * Registers an error quark for {@link Gtk.PrintOperation} if necessary. */ static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace PrintOperationAction { export const $gtype: GObject.GType; } /** * The `action` parameter to `gtk_print_operation_run()` * determines what action the print operation should perform. * @gir-type Enum */ enum PrintOperationAction { /** * Show the print dialog. */ PRINT_DIALOG, /** * Start to print without showing * the print dialog, based on the current print settings. */ PRINT, /** * Show the print preview. */ PREVIEW, /** * Export to a file. This requires * the export-filename property to be set. */ EXPORT, } /** * @gir-type Enum */ export namespace PrintOperationResult { export const $gtype: GObject.GType; } /** * A value of this type is returned by `gtk_print_operation_run()`. * @gir-type Enum */ enum PrintOperationResult { /** * An error has occurred. */ ERROR, /** * The print settings should be stored. */ APPLY, /** * The print operation has been canceled, * the print settings should not be stored. */ CANCEL, /** * The print operation is not complete * yet. This value will only be returned when running asynchronously. */ IN_PROGRESS, } /** * @gir-type Enum */ export namespace PrintPages { export const $gtype: GObject.GType; } /** * See also `gtk_print_job_set_pages()` * @gir-type Enum */ enum PrintPages { /** * All pages. */ ALL, /** * Current page. */ CURRENT, /** * Range of pages. */ RANGES, /** * Selected pages. */ SELECTION, } /** * @gir-type Enum */ export namespace PrintQuality { export const $gtype: GObject.GType; } /** * See also `gtk_print_settings_set_quality()`. * @gir-type Enum */ enum PrintQuality { /** * Low quality. */ LOW, /** * Normal quality. */ NORMAL, /** * High quality. */ HIGH, /** * Draft quality. */ DRAFT, } /** * @gir-type Enum */ export namespace PrintStatus { export const $gtype: GObject.GType; } /** * The status gives a rough indication of the completion of a running * print operation. * @gir-type Enum */ enum PrintStatus { /** * The printing has not started yet; this * status is set initially, and while the print dialog is shown. */ INITIAL, /** * This status is set while the begin-print * signal is emitted and during pagination. */ PREPARING, /** * This status is set while the * pages are being rendered. */ GENERATING_DATA, /** * The print job is being sent off to the * printer. */ SENDING_DATA, /** * The print job has been sent to the printer, * but is not printed for some reason, e.g. the printer may be stopped. */ PENDING, /** * Some problem has occurred during * printing, e.g. a paper jam. */ PENDING_ISSUE, /** * The printer is processing the print job. */ PRINTING, /** * The printing has been completed successfully. */ FINISHED, /** * The printing has been aborted. */ FINISHED_ABORTED, } /** * @gir-type Enum */ export namespace PropagationPhase { export const $gtype: GObject.GType; } /** * Describes the stage at which events are fed into a {@link Gtk.EventController}. * @gir-type Enum * @since 3.14 */ enum PropagationPhase { /** * Events are not delivered automatically. Those can be * manually fed through `gtk_event_controller_handle_event()`. This should * only be used when full control about when, or whether the controller * handles the event is needed. */ NONE, /** * Events are delivered in the capture phase. The * capture phase happens before the bubble phase, runs from the toplevel down * to the event widget. This option should only be used on containers that * might possibly handle events before their children do. */ CAPTURE, /** * Events are delivered in the bubble phase. The bubble * phase happens after the capture phase, and before the default handlers * are run. This phase runs from the event widget, up to the toplevel. */ BUBBLE, /** * Events are delivered in the default widget event handlers, * note that widget implementations must chain up on button, motion, touch and * grab broken handlers for controllers in this phase to be run. */ TARGET, } /** * @gir-type Enum */ export namespace RcTokenType { export const $gtype: GObject.GType; } /** * The {@link Gtk.RcTokenType} enumeration represents the tokens * in the RC file. It is exposed so that theme engines * can reuse these tokens when parsing the theme-engine * specific portions of a RC file. * @gir-type Enum * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ enum RcTokenType { /** * Deprecated */ INVALID, /** * Deprecated */ INCLUDE, /** * Deprecated */ NORMAL, /** * Deprecated */ ACTIVE, /** * Deprecated */ PRELIGHT, /** * Deprecated */ SELECTED, /** * Deprecated */ INSENSITIVE, /** * Deprecated */ FG, /** * Deprecated */ BG, /** * Deprecated */ TEXT, /** * Deprecated */ BASE, /** * Deprecated */ XTHICKNESS, /** * Deprecated */ YTHICKNESS, /** * Deprecated */ FONT, /** * Deprecated */ FONTSET, /** * Deprecated */ FONT_NAME, /** * Deprecated */ BG_PIXMAP, /** * Deprecated */ PIXMAP_PATH, /** * Deprecated */ STYLE, /** * Deprecated */ BINDING, /** * Deprecated */ BIND, /** * Deprecated */ WIDGET, /** * Deprecated */ WIDGET_CLASS, /** * Deprecated */ CLASS, /** * Deprecated */ LOWEST, /** * Deprecated */ GTK, /** * Deprecated */ APPLICATION, /** * Deprecated */ THEME, /** * Deprecated */ RC, /** * Deprecated */ HIGHEST, /** * Deprecated */ ENGINE, /** * Deprecated */ MODULE_PATH, /** * Deprecated */ IM_MODULE_PATH, /** * Deprecated */ IM_MODULE_FILE, /** * Deprecated */ STOCK, /** * Deprecated */ LTR, /** * Deprecated */ RTL, /** * Deprecated */ COLOR, /** * Deprecated */ UNBIND, /** * Deprecated */ LAST, } /** * These identify the various errors that can occur while calling * {@link Gtk.RecentChooser} functions. * @gir-type Struct */ class RecentChooserError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * Indicates that a file does not exist */ static NOT_FOUND: number; /** * Indicates a malformed URI */ static INVALID_URI: number; // Constructors constructor(options: { message: string; code: number }); // Static methods static quark(): GLib.Quark; } /** * Error codes for {@link Gtk.RecentManager} operations * @gir-type Struct */ class RecentManagerError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * the URI specified does not exists in * the recently used resources list. */ static NOT_FOUND: number; /** * the URI specified is not valid. */ static INVALID_URI: number; /** * the supplied string is not * UTF-8 encoded. */ static INVALID_ENCODING: number; /** * no application has registered * the specified item. */ static NOT_REGISTERED: number; /** * failure while reading the recently used * resources file. */ static READ: number; /** * failure while writing the recently used * resources file. */ static WRITE: number; /** * unspecified error. */ static UNKNOWN: number; // Constructors constructor(options: { message: string; code: number }); // Static methods static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace RecentSortType { export const $gtype: GObject.GType; } /** * Used to specify the sorting method to be applyed to the recently * used resource list. * @gir-type Enum * @since 2.10 */ enum RecentSortType { /** * Do not sort the returned list of recently used * resources. */ NONE, /** * Sort the returned list with the most recently used * items first. */ MRU, /** * Sort the returned list with the least recently used * items first. */ LRU, /** * Sort the returned list using a custom sorting * function passed using `gtk_recent_chooser_set_sort_func()`. */ CUSTOM, } /** * @gir-type Enum */ export namespace ReliefStyle { export const $gtype: GObject.GType; } /** * Indicated the relief to be drawn around a {@link Gtk.Button}. * @gir-type Enum */ enum ReliefStyle { /** * Draw a normal relief. */ NORMAL, /** * A half relief. Deprecated in 3.14, does the same as `GTK_RELIEF_NORMAL` */ HALF, /** * No relief. */ NONE, } /** * @gir-type Enum */ export namespace ResizeMode { export const $gtype: GObject.GType; } /** * @gir-type Enum */ enum ResizeMode { /** * Pass resize request to the parent */ PARENT, /** * Queue resizes on this widget */ QUEUE, /** * Resize immediately. Deprecated. */ IMMEDIATE, } /** * @gir-type Enum */ export namespace ResponseType { export const $gtype: GObject.GType; } /** * Predefined values for use as response ids in `gtk_dialog_add_button()`. * All predefined values are negative; GTK+ leaves values of 0 or greater for * application-defined response ids. * @gir-type Enum */ enum ResponseType { /** * Returned if an action widget has no response id, * or if the dialog gets programmatically hidden or destroyed */ NONE, /** * Generic response id, not used by GTK+ dialogs */ REJECT, /** * Generic response id, not used by GTK+ dialogs */ ACCEPT, /** * Returned if the dialog is deleted */ DELETE_EVENT, /** * Returned by OK buttons in GTK+ dialogs */ OK, /** * Returned by Cancel buttons in GTK+ dialogs */ CANCEL, /** * Returned by Close buttons in GTK+ dialogs */ CLOSE, /** * Returned by Yes buttons in GTK+ dialogs */ YES, /** * Returned by No buttons in GTK+ dialogs */ NO, /** * Returned by Apply buttons in GTK+ dialogs */ APPLY, /** * Returned by Help buttons in GTK+ dialogs */ HELP, } /** * @gir-type Enum */ export namespace RevealerTransitionType { export const $gtype: GObject.GType; } /** * These enumeration values describe the possible transitions * when the child of a {@link Gtk.Revealer} widget is shown or hidden. * @gir-type Enum */ enum RevealerTransitionType { /** * No transition */ NONE, /** * Fade in */ CROSSFADE, /** * Slide in from the left */ SLIDE_RIGHT, /** * Slide in from the right */ SLIDE_LEFT, /** * Slide in from the bottom */ SLIDE_UP, /** * Slide in from the top */ SLIDE_DOWN, } /** * @gir-type Enum */ export namespace ScrollStep { export const $gtype: GObject.GType; } /** * @gir-type Enum */ enum ScrollStep { /** * Scroll in steps. */ STEPS, /** * Scroll by pages. */ PAGES, /** * Scroll to ends. */ ENDS, /** * Scroll in horizontal steps. */ HORIZONTAL_STEPS, /** * Scroll by horizontal pages. */ HORIZONTAL_PAGES, /** * Scroll to the horizontal ends. */ HORIZONTAL_ENDS, } /** * @gir-type Enum */ export namespace ScrollType { export const $gtype: GObject.GType; } /** * Scrolling types. * @gir-type Enum */ enum ScrollType { /** * No scrolling. */ NONE, /** * Jump to new location. */ JUMP, /** * Step backward. */ STEP_BACKWARD, /** * Step forward. */ STEP_FORWARD, /** * Page backward. */ PAGE_BACKWARD, /** * Page forward. */ PAGE_FORWARD, /** * Step up. */ STEP_UP, /** * Step down. */ STEP_DOWN, /** * Page up. */ PAGE_UP, /** * Page down. */ PAGE_DOWN, /** * Step to the left. */ STEP_LEFT, /** * Step to the right. */ STEP_RIGHT, /** * Page to the left. */ PAGE_LEFT, /** * Page to the right. */ PAGE_RIGHT, /** * Scroll to start. */ START, /** * Scroll to end. */ END, } /** * @gir-type Enum */ export namespace ScrollablePolicy { export const $gtype: GObject.GType; } /** * Defines the policy to be used in a scrollable widget when updating * the scrolled window adjustments in a given orientation. * @gir-type Enum */ enum ScrollablePolicy { /** * Scrollable adjustments are based on the minimum size */ MINIMUM, /** * Scrollable adjustments are based on the natural size */ NATURAL, } /** * @gir-type Enum */ export namespace SelectionMode { export const $gtype: GObject.GType; } /** * Used to control what selections users are allowed to make. * @gir-type Enum */ enum SelectionMode { /** * No selection is possible. */ NONE, /** * Zero or one element may be selected. */ SINGLE, /** * Exactly one element is selected. * In some circumstances, such as initially or during a search * operation, it’s possible for no element to be selected with * {@link Gtk.SelectionMode.BROWSE}. What is really enforced is that the user * can’t deselect a currently selected element except by selecting * another element. */ BROWSE, /** * Any number of elements may be selected. * The Ctrl key may be used to enlarge the selection, and Shift * key to select between the focus and the child pointed to. * Some widgets may also allow Click-drag to select a range of elements. */ MULTIPLE, } /** * @gir-type Enum */ export namespace SensitivityType { export const $gtype: GObject.GType; } /** * Determines how GTK+ handles the sensitivity of stepper arrows * at the end of range widgets. * @gir-type Enum */ enum SensitivityType { /** * The arrow is made insensitive if the * thumb is at the end */ AUTO, /** * The arrow is always sensitive */ ON, /** * The arrow is always insensitive */ OFF, } /** * @gir-type Enum */ export namespace ShadowType { export const $gtype: GObject.GType; } /** * Used to change the appearance of an outline typically provided by a {@link Gtk.Frame}. * * Note that many themes do not differentiate the appearance of the * various shadow types: Either their is no visible shadow (`GTK_SHADOW_NONE`), * or there is (any other value). * @gir-type Enum */ enum ShadowType { /** * No outline. */ NONE, /** * The outline is bevelled inwards. */ IN, /** * The outline is bevelled outwards like a button. */ OUT, /** * The outline has a sunken 3d appearance. */ ETCHED_IN, /** * The outline has a raised 3d appearance. */ ETCHED_OUT, } /** * @gir-type Enum */ export namespace ShortcutType { export const $gtype: GObject.GType; } /** * GtkShortcutType specifies the kind of shortcut that is being described. * More values may be added to this enumeration over time. * @gir-type Enum * @since 3.20 */ enum ShortcutType { /** * The shortcut is a keyboard accelerator. The {@link Gtk.ShortcutsShortcut.accelerator} * property will be used. */ ACCELERATOR, /** * The shortcut is a pinch gesture. GTK+ provides an icon and subtitle. */ GESTURE_PINCH, /** * The shortcut is a stretch gesture. GTK+ provides an icon and subtitle. */ GESTURE_STRETCH, /** * The shortcut is a clockwise rotation gesture. GTK+ provides an icon and subtitle. */ GESTURE_ROTATE_CLOCKWISE, /** * The shortcut is a counterclockwise rotation gesture. GTK+ provides an icon and subtitle. */ GESTURE_ROTATE_COUNTERCLOCKWISE, /** * The shortcut is a two-finger swipe gesture. GTK+ provides an icon and subtitle. */ GESTURE_TWO_FINGER_SWIPE_LEFT, /** * The shortcut is a two-finger swipe gesture. GTK+ provides an icon and subtitle. */ GESTURE_TWO_FINGER_SWIPE_RIGHT, /** * The shortcut is a gesture. The {@link Gtk.ShortcutsShortcut.icon} property will be * used. */ GESTURE, } /** * @gir-type Enum */ export namespace SizeGroupMode { export const $gtype: GObject.GType; } /** * The mode of the size group determines the directions in which the size * group affects the requested sizes of its component widgets. * @gir-type Enum */ enum SizeGroupMode { /** * group has no effect */ NONE, /** * group affects horizontal requisition */ HORIZONTAL, /** * group affects vertical requisition */ VERTICAL, /** * group affects both horizontal and vertical requisition */ BOTH, } /** * @gir-type Enum */ export namespace SizeRequestMode { export const $gtype: GObject.GType; } /** * Specifies a preference for height-for-width or * width-for-height geometry management. * @gir-type Enum */ enum SizeRequestMode { /** * Prefer height-for-width geometry management */ HEIGHT_FOR_WIDTH, /** * Prefer width-for-height geometry management */ WIDTH_FOR_HEIGHT, /** * Don’t trade height-for-width or width-for-height */ CONSTANT_SIZE, } /** * @gir-type Enum */ export namespace SortType { export const $gtype: GObject.GType; } /** * Determines the direction of a sort. * @gir-type Enum */ enum SortType { /** * Sorting is in ascending order. */ ASCENDING, /** * Sorting is in descending order. */ DESCENDING, } /** * @gir-type Enum */ export namespace SpinButtonUpdatePolicy { export const $gtype: GObject.GType; } /** * The spin button update policy determines whether the spin button displays * values even if they are outside the bounds of its adjustment. * See `gtk_spin_button_set_update_policy()`. * @gir-type Enum */ enum SpinButtonUpdatePolicy { /** * When refreshing your {@link Gtk.SpinButton}, the value is * always displayed */ ALWAYS, /** * When refreshing your {@link Gtk.SpinButton}, the value is * only displayed if it is valid within the bounds of the spin button's * adjustment */ IF_VALID, } /** * @gir-type Enum */ export namespace SpinType { export const $gtype: GObject.GType; } /** * The values of the GtkSpinType enumeration are used to specify the * change to make in `gtk_spin_button_spin()`. * @gir-type Enum */ enum SpinType { /** * Increment by the adjustments step increment. */ STEP_FORWARD, /** * Decrement by the adjustments step increment. */ STEP_BACKWARD, /** * Increment by the adjustments page increment. */ PAGE_FORWARD, /** * Decrement by the adjustments page increment. */ PAGE_BACKWARD, /** * Go to the adjustments lower bound. */ HOME, /** * Go to the adjustments upper bound. */ END, /** * Change by a specified amount. */ USER_DEFINED, } /** * @gir-type Enum */ export namespace StackTransitionType { export const $gtype: GObject.GType; } /** * These enumeration values describe the possible transitions * between pages in a {@link Gtk.Stack} widget. * * New values may be added to this enumeration over time. * @gir-type Enum */ enum StackTransitionType { /** * No transition */ NONE, /** * A cross-fade */ CROSSFADE, /** * Slide from left to right */ SLIDE_RIGHT, /** * Slide from right to left */ SLIDE_LEFT, /** * Slide from bottom up */ SLIDE_UP, /** * Slide from top down */ SLIDE_DOWN, /** * Slide from left or right according to the children order */ SLIDE_LEFT_RIGHT, /** * Slide from top down or bottom up according to the order */ SLIDE_UP_DOWN, /** * Cover the old page by sliding up. Since 3.12 */ OVER_UP, /** * Cover the old page by sliding down. Since: 3.12 */ OVER_DOWN, /** * Cover the old page by sliding to the left. Since: 3.12 */ OVER_LEFT, /** * Cover the old page by sliding to the right. Since: 3.12 */ OVER_RIGHT, /** * Uncover the new page by sliding up. Since 3.12 */ UNDER_UP, /** * Uncover the new page by sliding down. Since: 3.12 */ UNDER_DOWN, /** * Uncover the new page by sliding to the left. Since: 3.12 */ UNDER_LEFT, /** * Uncover the new page by sliding to the right. Since: 3.12 */ UNDER_RIGHT, /** * Cover the old page sliding up or uncover the new page sliding down, according to order. Since: 3.12 */ OVER_UP_DOWN, /** * Cover the old page sliding down or uncover the new page sliding up, according to order. Since: 3.14 */ OVER_DOWN_UP, /** * Cover the old page sliding left or uncover the new page sliding right, according to order. Since: 3.14 */ OVER_LEFT_RIGHT, /** * Cover the old page sliding right or uncover the new page sliding left, according to order. Since: 3.14 */ OVER_RIGHT_LEFT, } /** * @gir-type Enum */ export namespace StateType { export const $gtype: GObject.GType; } /** * This type indicates the current state of a widget; the state determines how * the widget is drawn. The {@link Gtk.StateType} enumeration is also used to * identify different colors in a {@link Gtk.Style} for drawing, so states can be * used for subparts of a widget as well as entire widgets. * @gir-type Enum * @deprecated since 3.14: All APIs that are using this enumeration have been deprecated in favor of alternatives using {@link Gtk.StateFlags}. */ enum StateType { /** * State during normal operation. */ NORMAL, /** * State of a currently active widget, such as a depressed button. */ ACTIVE, /** * State indicating that the mouse pointer is over * the widget and the widget will respond to mouse clicks. */ PRELIGHT, /** * State of a selected item, such the selected row in a list. */ SELECTED, /** * State indicating that the widget is * unresponsive to user actions. */ INSENSITIVE, /** * The widget is inconsistent, such as checkbuttons * or radiobuttons that aren’t either set to `true` nor `false`, * or buttons requiring the user attention. */ INCONSISTENT, /** * The widget has the keyboard focus. */ FOCUSED, } /** * @gir-type Enum */ export namespace TextBufferTargetInfo { export const $gtype: GObject.GType; } /** * These values are used as “info” for the targets contained in the * lists returned by `gtk_text_buffer_get_copy_target_list()` and * `gtk_text_buffer_get_paste_target_list()`. * * The values counts down from `-1` to avoid clashes * with application added drag destinations which usually start at 0. * @gir-type Enum */ enum TextBufferTargetInfo { /** * Buffer contents */ BUFFER_CONTENTS, /** * Rich text */ RICH_TEXT, /** * Text */ TEXT, } /** * @gir-type Enum */ export namespace TextDirection { export const $gtype: GObject.GType; } /** * Reading directions for text. * @gir-type Enum */ enum TextDirection { /** * No direction. */ NONE, /** * Left to right text direction. */ LTR, /** * Right to left text direction. */ RTL, } /** * @gir-type Enum */ export namespace TextExtendSelection { export const $gtype: GObject.GType; } /** * Granularity types that extend the text selection. Use the * {@link Gtk.TextView.SignalSignatures.extend_selection | Gtk.TextView::extend-selection} signal to customize the selection. * @gir-type Enum * @since 3.16 */ enum TextExtendSelection { /** * Selects the current word. It is triggered by * a double-click for example. */ WORD, /** * Selects the current line. It is triggered by * a triple-click for example. */ LINE, } /** * @gir-type Enum */ export namespace TextViewLayer { export const $gtype: GObject.GType; } /** * Used to reference the layers of {@link Gtk.TextView} for the purpose of customized * drawing with the ::draw_layer vfunc. * @gir-type Enum */ enum TextViewLayer { /** * Old deprecated layer, use {@link Gtk.TextViewLayer.BELOW_TEXT} instead */ BELOW, /** * Old deprecated layer, use {@link Gtk.TextViewLayer.ABOVE_TEXT} instead */ ABOVE, /** * The layer rendered below the text (but above the background). Since: 3.20 */ BELOW_TEXT, /** * The layer rendered above the text. Since: 3.20 */ ABOVE_TEXT, } /** * @gir-type Enum */ export namespace TextWindowType { export const $gtype: GObject.GType; } /** * Used to reference the parts of {@link Gtk.TextView}. * @gir-type Enum */ enum TextWindowType { /** * Invalid value, used as a marker */ PRIVATE, /** * Window that floats over scrolling areas. */ WIDGET, /** * Scrollable text window. */ TEXT, /** * Left side border window. */ LEFT, /** * Right side border window. */ RIGHT, /** * Top border window. */ TOP, /** * Bottom border window. */ BOTTOM, } /** * @gir-type Enum */ export namespace ToolbarSpaceStyle { export const $gtype: GObject.GType; } /** * Whether spacers are vertical lines or just blank. * @gir-type Enum * @deprecated since 3.20 */ enum ToolbarSpaceStyle { /** * Use blank spacers. */ EMPTY, /** * Use vertical lines for spacers. */ LINE, } /** * @gir-type Enum */ export namespace ToolbarStyle { export const $gtype: GObject.GType; } /** * Used to customize the appearance of a {@link Gtk.Toolbar}. Note that * setting the toolbar style overrides the user’s preferences * for the default toolbar style. Note that if the button has only * a label set and GTK_TOOLBAR_ICONS is used, the label will be * visible, and vice versa. * @gir-type Enum */ enum ToolbarStyle { /** * Buttons display only icons in the toolbar. */ ICONS, /** * Buttons display only text labels in the toolbar. */ TEXT, /** * Buttons display text and icons in the toolbar. */ BOTH, /** * Buttons display icons and text alongside each * other, rather than vertically stacked */ BOTH_HORIZ, } /** * @gir-type Enum */ export namespace TreeViewColumnSizing { export const $gtype: GObject.GType; } /** * The sizing method the column uses to determine its width. Please note * that `GTK_TREE_VIEW_COLUMN_AUTOSIZE` are inefficient for large views, and * can make columns appear choppy. * @gir-type Enum */ enum TreeViewColumnSizing { /** * Columns only get bigger in reaction to changes in the model */ GROW_ONLY, /** * Columns resize to be the optimal size everytime the model changes. */ AUTOSIZE, /** * Columns are a fixed numbers of pixels wide. */ FIXED, } /** * @gir-type Enum */ export namespace TreeViewDropPosition { export const $gtype: GObject.GType; } /** * An enum for determining where a dropped row goes. * @gir-type Enum */ enum TreeViewDropPosition { /** * dropped row is inserted before */ BEFORE, /** * dropped row is inserted after */ AFTER, /** * dropped row becomes a child or is inserted before */ INTO_OR_BEFORE, /** * dropped row becomes a child or is inserted after */ INTO_OR_AFTER, } /** * @gir-type Enum */ export namespace TreeViewGridLines { export const $gtype: GObject.GType; } /** * Used to indicate which grid lines to draw in a tree view. * @gir-type Enum */ enum TreeViewGridLines { /** * No grid lines. */ NONE, /** * Horizontal grid lines. */ HORIZONTAL, /** * Vertical grid lines. */ VERTICAL, /** * Horizontal and vertical grid lines. */ BOTH, } /** * @gir-type Enum */ export namespace Unit { export const $gtype: GObject.GType; } /** * See also `gtk_print_settings_set_paper_width()`. * @gir-type Enum */ enum Unit { /** * No units. */ NONE, /** * Dimensions in points. */ POINTS, /** * Dimensions in inches. */ INCH, /** * Dimensions in millimeters */ MM, } /** * @gir-type Enum */ export namespace WidgetHelpType { export const $gtype: GObject.GType; } /** * Kinds of widget-specific help. Used by the ::show-help signal. * @gir-type Enum */ enum WidgetHelpType { /** * Tooltip. */ TOOLTIP, /** * What’s this. */ WHATS_THIS, } /** * @gir-type Enum */ export namespace WindowPosition { export const $gtype: GObject.GType; } /** * Window placement can be influenced using this enumeration. Note that * using #GTK_WIN_POS_CENTER_ALWAYS is almost always a bad idea. * It won’t necessarily work well with all window managers or on all windowing systems. * @gir-type Enum */ enum WindowPosition { /** * No influence is made on placement. */ NONE, /** * Windows should be placed in the center of the screen. */ CENTER, /** * Windows should be placed at the current mouse position. */ MOUSE, /** * Keep window centered as it changes size, etc. */ CENTER_ALWAYS, /** * Center the window on its transient * parent (see `gtk_window_set_transient_for()`). */ CENTER_ON_PARENT, } /** * @gir-type Enum */ export namespace WindowType { export const $gtype: GObject.GType; } /** * A {@link Gtk.Window} can be one of these types. Most things you’d consider a * “window” should have type #GTK_WINDOW_TOPLEVEL; windows with this type * are managed by the window manager and have a frame by default (call * `gtk_window_set_decorated()` to toggle the frame). Windows with type * #GTK_WINDOW_POPUP are ignored by the window manager; window manager * keybindings won’t work on them, the window manager won’t decorate the * window with a frame, many GTK+ features that rely on the window * manager will not work (e.g. resize grips and * maximization/minimization). #GTK_WINDOW_POPUP is used to implement * widgets such as {@link Gtk.Menu} or tooltips that you normally don’t think of * as windows per se. Nearly all windows should be #GTK_WINDOW_TOPLEVEL. * In particular, do not use #GTK_WINDOW_POPUP just to turn off * the window borders; use `gtk_window_set_decorated()` for that. * @gir-type Enum */ enum WindowType { /** * A regular window, such as a dialog. */ TOPLEVEL, /** * A special window such as a tooltip. */ POPUP, } /** * @gir-type Enum */ export namespace WrapMode { export const $gtype: GObject.GType; } /** * Describes a type of line wrapping. * @gir-type Enum */ enum WrapMode { /** * do not wrap lines; just make the text area wider */ NONE, /** * wrap text, breaking lines anywhere the cursor can * appear (between characters, usually - if you want to be technical, * between graphemes, see `pango_get_log_attrs()`) */ CHAR, /** * wrap text, breaking lines in between words */ WORD, /** * wrap text, breaking lines in between words, or if * that is not enough, also between graphemes */ WORD_CHAR, } /** * Like `gtk_get_binary_age()`, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ const BINARY_AGE: number; /** * Constant to return from a signal handler for the {@link Gtk.SpinButton.SignalSignatures.input | Gtk.SpinButton::input} * signal in case of conversion failure. */ const INPUT_ERROR: number; /** * Like `gtk_get_interface_age()`, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ const INTERFACE_AGE: number; /** * The name used for the stock full offset included by {@link Gtk.LevelBar}. * @since 3.20 */ const LEVEL_BAR_OFFSET_FULL: string; /** * The name used for the stock high offset included by {@link Gtk.LevelBar}. * @since 3.6 */ const LEVEL_BAR_OFFSET_HIGH: string; /** * The name used for the stock low offset included by {@link Gtk.LevelBar}. * @since 3.6 */ const LEVEL_BAR_OFFSET_LOW: string; /** * Like `gtk_get_major_version()`, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ const MAJOR_VERSION: number; /** * The maximum length of sequences in compose tables. */ const MAX_COMPOSE_LEN: number; /** * Like `gtk_get_micro_version()`, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ const MICRO_VERSION: number; /** * Like `gtk_get_minor_version()`, but from the headers used at * application compile time, rather than from the library linked * against at application run time. */ const MINOR_VERSION: number; /** * Name for the A3 paper size. */ const PAPER_NAME_A3: string; /** * Name for the A4 paper size. */ const PAPER_NAME_A4: string; /** * Name for the A5 paper size. */ const PAPER_NAME_A5: string; /** * Name for the B5 paper size. */ const PAPER_NAME_B5: string; /** * Name for the Executive paper size. */ const PAPER_NAME_EXECUTIVE: string; /** * Name for the Legal paper size. */ const PAPER_NAME_LEGAL: string; /** * Name for the Letter paper size. */ const PAPER_NAME_LETTER: string; const PATH_PRIO_MASK: number; const PRINT_SETTINGS_COLLATE: string; const PRINT_SETTINGS_DEFAULT_SOURCE: string; const PRINT_SETTINGS_DITHER: string; const PRINT_SETTINGS_DUPLEX: string; const PRINT_SETTINGS_FINISHINGS: string; const PRINT_SETTINGS_MEDIA_TYPE: string; const PRINT_SETTINGS_NUMBER_UP: string; const PRINT_SETTINGS_NUMBER_UP_LAYOUT: string; const PRINT_SETTINGS_N_COPIES: string; const PRINT_SETTINGS_ORIENTATION: string; /** * The key used by the “Print to file” printer to store the file * name of the output without the path to the directory and the * file extension. * @since 3.6 */ const PRINT_SETTINGS_OUTPUT_BASENAME: string; const PRINT_SETTINGS_OUTPUT_BIN: string; /** * The key used by the “Print to file” printer to store the * directory to which the output should be written. * @since 3.6 */ const PRINT_SETTINGS_OUTPUT_DIR: string; /** * The key used by the “Print to file” printer to store the format * of the output. The supported values are “PS” and “PDF”. */ const PRINT_SETTINGS_OUTPUT_FILE_FORMAT: string; /** * 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. */ const PRINT_SETTINGS_OUTPUT_URI: string; const PRINT_SETTINGS_PAGE_RANGES: string; const PRINT_SETTINGS_PAGE_SET: string; const PRINT_SETTINGS_PAPER_FORMAT: string; const PRINT_SETTINGS_PAPER_HEIGHT: string; const PRINT_SETTINGS_PAPER_WIDTH: string; const PRINT_SETTINGS_PRINTER: string; const PRINT_SETTINGS_PRINTER_LPI: string; const PRINT_SETTINGS_PRINT_PAGES: string; const PRINT_SETTINGS_QUALITY: string; const PRINT_SETTINGS_RESOLUTION: string; const PRINT_SETTINGS_RESOLUTION_X: string; const PRINT_SETTINGS_RESOLUTION_Y: string; const PRINT_SETTINGS_REVERSE: string; const PRINT_SETTINGS_SCALE: string; const PRINT_SETTINGS_USE_COLOR: string; const PRINT_SETTINGS_WIN32_DRIVER_EXTRA: string; const PRINT_SETTINGS_WIN32_DRIVER_VERSION: string; /** * 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 `GDK_PRIORITY_REDRAW` to avoid * resizing a widget which was just redrawn. */ const PRIORITY_RESIZE: number; /** * The “About” item. * ![](help-about.png) * @since 2.6 * @deprecated since 3.10: Use named icon "help-about" or the label "_About". */ const STOCK_ABOUT: string; /** * The “Add” item and icon. * @deprecated since 3.10: Use named icon "list-add" or the label "_Add". */ const STOCK_ADD: string; /** * The “Apply” item and icon. * @deprecated since 3.10: Do not use an icon. Use label "_Apply". */ const STOCK_APPLY: string; /** * The “Bold” item and icon. * @deprecated since 3.10: Use named icon "format-text-bold". */ const STOCK_BOLD: string; /** * The “Cancel” item and icon. * @deprecated since 3.10: Do not use an icon. Use label "_Cancel". */ const STOCK_CANCEL: string; /** * The “Caps Lock Warning” icon. * @since 2.16 * @deprecated since 3.10: Use named icon "dialog-warning-symbolic". */ const STOCK_CAPS_LOCK_WARNING: string; /** * The “CD-Rom” item and icon. * @deprecated since 3.10: Use named icon "media-optical". */ const STOCK_CDROM: string; /** * The “Clear” item and icon. * @deprecated since 3.10: Use named icon "edit-clear". */ const STOCK_CLEAR: string; /** * The “Close” item and icon. * @deprecated since 3.10: Use named icon "window-close" or the label "_Close". */ const STOCK_CLOSE: string; /** * The “Color Picker” item and icon. * @since 2.2 * @deprecated since 3.10 */ const STOCK_COLOR_PICKER: string; /** * The “Connect” icon. * @since 2.6 * @deprecated since 3.10 */ const STOCK_CONNECT: string; /** * The “Convert” item and icon. * @deprecated since 3.10 */ const STOCK_CONVERT: string; /** * The “Copy” item and icon. * @deprecated since 3.10: Use the named icon "edit-copy" or the label "_Copy". */ const STOCK_COPY: string; /** * The “Cut” item and icon. * @deprecated since 3.10: Use the named icon "edit-cut" or the label "Cu_t". */ const STOCK_CUT: string; /** * The “Delete” item and icon. * @deprecated since 3.10: Use the named icon "edit-delete" or the label "_Delete". */ const STOCK_DELETE: string; /** * The “Authentication” item and icon. * @since 2.4 * @deprecated since 3.10: Use named icon "dialog-password". */ const STOCK_DIALOG_AUTHENTICATION: string; /** * The “Error” item and icon. * @deprecated since 3.10: Use named icon "dialog-error". */ const STOCK_DIALOG_ERROR: string; /** * The “Information” item and icon. * @deprecated since 3.10: Use named icon "dialog-information". */ const STOCK_DIALOG_INFO: string; /** * The “Question” item and icon. * @deprecated since 3.10: Use named icon "dialog-question". */ const STOCK_DIALOG_QUESTION: string; /** * The “Warning” item and icon. * @deprecated since 3.10: Use named icon "dialog-warning". */ const STOCK_DIALOG_WARNING: string; /** * The “Directory” icon. * @since 2.6 * @deprecated since 3.10: Use named icon "folder". */ const STOCK_DIRECTORY: string; /** * The “Discard” item. * @since 2.12 * @deprecated since 3.10 */ const STOCK_DISCARD: string; /** * The “Disconnect” icon. * @since 2.6 * @deprecated since 3.10 */ const STOCK_DISCONNECT: string; /** * The “Drag-And-Drop” icon. * @deprecated since 3.10 */ const STOCK_DND: string; /** * The “Drag-And-Drop multiple” icon. * @deprecated since 3.10 */ const STOCK_DND_MULTIPLE: string; /** * The “Edit” item and icon. * @since 2.6 * @deprecated since 3.10 */ const STOCK_EDIT: string; /** * The “Execute” item and icon. * @deprecated since 3.10: Use named icon "system-run". */ const STOCK_EXECUTE: string; /** * The “File” item and icon. * * Since 3.0, this item has a label, before it only had an icon. * @since 2.6 * @deprecated since 3.10: Use named icon "text-x-generic". */ const STOCK_FILE: string; /** * The “Find” item and icon. * @deprecated since 3.10: Use named icon "edit-find". */ const STOCK_FIND: string; /** * The “Find and Replace” item and icon. * @deprecated since 3.10: Use named icon "edit-find-replace". */ const STOCK_FIND_AND_REPLACE: string; /** * The “Floppy” item and icon. * @deprecated since 3.10 */ const STOCK_FLOPPY: string; /** * The “Fullscreen” item and icon. * @since 2.8 * @deprecated since 3.10: Use named icon "view-fullscreen". */ const STOCK_FULLSCREEN: string; /** * The “Bottom” item and icon. * @deprecated since 3.10: Use named icon "go-bottom". */ const STOCK_GOTO_BOTTOM: string; /** * The “First” item and icon. The icon has an RTL variant. * @deprecated since 3.10: Use named icon "go-first". */ const STOCK_GOTO_FIRST: string; /** * The “Last” item and icon. The icon has an RTL variant. * @deprecated since 3.10: Use named icon "go-last". */ const STOCK_GOTO_LAST: string; /** * The “Top” item and icon. * @deprecated since 3.10: Use named icon "go-top". */ const STOCK_GOTO_TOP: string; /** * The “Back” item and icon. The icon has an RTL variant. * @deprecated since 3.10: Use named icon "go-previous". */ const STOCK_GO_BACK: string; /** * The “Down” item and icon. * @deprecated since 3.10: Use named icon "go-down". */ const STOCK_GO_DOWN: string; /** * The “Forward” item and icon. The icon has an RTL variant. * @deprecated since 3.10: Use named icon "go-next". */ const STOCK_GO_FORWARD: string; /** * The “Up” item and icon. * @deprecated since 3.10: Use named icon "go-up". */ const STOCK_GO_UP: string; /** * The “Harddisk” item and icon. * @since 2.4 * @deprecated since 3.10: Use named icon "drive-harddisk". */ const STOCK_HARDDISK: string; /** * The “Help” item and icon. * @deprecated since 3.10: Use named icon "help-browser". */ const STOCK_HELP: string; /** * The “Home” item and icon. * @deprecated since 3.10: Use named icon "go-home". */ const STOCK_HOME: string; /** * The “Indent” item and icon. The icon has an RTL variant. * @since 2.4 * @deprecated since 3.10: Use named icon "format-indent-more". */ const STOCK_INDENT: string; /** * The “Index” item and icon. * @deprecated since 3.10 */ const STOCK_INDEX: string; /** * The “Info” item and icon. * @since 2.8 * @deprecated since 3.10: Use named icon "dialog-information". */ const STOCK_INFO: string; /** * The “Italic” item and icon. * @deprecated since 3.10: Use named icon "format-text-italic". */ const STOCK_ITALIC: string; /** * The “Jump to” item and icon. The icon has an RTL variant. * @deprecated since 3.10: Use named icon "go-jump". */ const STOCK_JUMP_TO: string; /** * The “Center” item and icon. * @deprecated since 3.10: Use named icon "format-justify-center". */ const STOCK_JUSTIFY_CENTER: string; /** * The “Fill” item and icon. * @deprecated since 3.10: Use named icon "format-justify-fill". */ const STOCK_JUSTIFY_FILL: string; /** * The “Left” item and icon. * @deprecated since 3.10: Use named icon "format-justify-left". */ const STOCK_JUSTIFY_LEFT: string; /** * The “Right” item and icon. * @deprecated since 3.10: Use named icon "format-justify-right". */ const STOCK_JUSTIFY_RIGHT: string; /** * The “Leave Fullscreen” item and icon. * @since 2.8 * @deprecated since 3.10: Use named icon "view-restore". */ const STOCK_LEAVE_FULLSCREEN: string; /** * The “Media Forward” item and icon. The icon has an RTL variant. * @since 2.6 * @deprecated since 3.10: Use named icon "media-seek-forward" or the label "_Forward". */ const STOCK_MEDIA_FORWARD: string; /** * The “Media Next” item and icon. The icon has an RTL variant. * @since 2.6 * @deprecated since 3.10: Use named icon "media-skip-forward" or the label "_Next". */ const STOCK_MEDIA_NEXT: string; /** * The “Media Pause” item and icon. * @since 2.6 * @deprecated since 3.10: Use named icon "media-playback-pause" or the label "P_ause". */ const STOCK_MEDIA_PAUSE: string; /** * The “Media Play” item and icon. The icon has an RTL variant. * @since 2.6 * @deprecated since 3.10: Use named icon "media-playback-start" or the label "_Play". */ const STOCK_MEDIA_PLAY: string; /** * The “Media Previous” item and icon. The icon has an RTL variant. * @since 2.6 * @deprecated since 3.10: Use named icon "media-skip-backward" or the label "Pre_vious". */ const STOCK_MEDIA_PREVIOUS: string; /** * The “Media Record” item and icon. * @since 2.6 * @deprecated since 3.10: Use named icon "media-record" or the label "_Record". */ const STOCK_MEDIA_RECORD: string; /** * The “Media Rewind” item and icon. The icon has an RTL variant. * @since 2.6 * @deprecated since 3.10: Use named icon "media-seek-backward" or the label "R_ewind". */ const STOCK_MEDIA_REWIND: string; /** * The “Media Stop” item and icon. * @since 2.6 * @deprecated since 3.10: Use named icon "media-playback-stop" or the label "_Stop". */ const STOCK_MEDIA_STOP: string; /** * The “Missing image” icon. * @deprecated since 3.10: Use named icon "image-missing". */ const STOCK_MISSING_IMAGE: string; /** * The “Network” item and icon. * @since 2.4 * @deprecated since 3.10: Use named icon "network-workgroup". */ const STOCK_NETWORK: string; /** * The “New” item and icon. * @deprecated since 3.10: Use named icon "document-new" or the label "_New". */ const STOCK_NEW: string; /** * The “No” item and icon. * @deprecated since 3.10 */ const STOCK_NO: string; /** * The “OK” item and icon. * @deprecated since 3.10: Do not use an icon. Use label "_OK". */ const STOCK_OK: string; /** * The “Open” item and icon. * @deprecated since 3.10: Use named icon "document-open" or the label "_Open". */ const STOCK_OPEN: string; /** * The “Landscape Orientation” item and icon. * @since 2.10 * @deprecated since 3.10 */ const STOCK_ORIENTATION_LANDSCAPE: string; /** * The “Portrait Orientation” item and icon. * @since 2.10 * @deprecated since 3.10 */ const STOCK_ORIENTATION_PORTRAIT: string; /** * The “Reverse Landscape Orientation” item and icon. * @since 2.10 * @deprecated since 3.10 */ const STOCK_ORIENTATION_REVERSE_LANDSCAPE: string; /** * The “Reverse Portrait Orientation” item and icon. * @since 2.10 * @deprecated since 3.10 */ const STOCK_ORIENTATION_REVERSE_PORTRAIT: string; /** * The “Page Setup” item and icon. * @since 2.14 * @deprecated since 3.10: Use named icon "document-page-setup" or the label "Page Set_up". */ const STOCK_PAGE_SETUP: string; /** * The “Paste” item and icon. * @deprecated since 3.10: Use named icon "edit-paste" or the label "_Paste". */ const STOCK_PASTE: string; /** * The “Preferences” item and icon. * @deprecated since 3.10: Use named icon "preferences-system" or the label "_Preferences". */ const STOCK_PREFERENCES: string; /** * The “Print” item and icon. * @deprecated since 3.10: Use named icon "document-print" or the label "_Print". */ const STOCK_PRINT: string; /** * The “Print Error” icon. * @since 2.14 * @deprecated since 3.10: Use named icon "printer-error". */ const STOCK_PRINT_ERROR: string; /** * The “Print Paused” icon. * @since 2.14 * @deprecated since 3.10 */ const STOCK_PRINT_PAUSED: string; /** * The “Print Preview” item and icon. * @deprecated since 3.10: Use label "Pre_view". */ const STOCK_PRINT_PREVIEW: string; /** * The “Print Report” icon. * @since 2.14 * @deprecated since 3.10 */ const STOCK_PRINT_REPORT: string; /** * The “Print Warning” icon. * @since 2.14 * @deprecated since 3.10 */ const STOCK_PRINT_WARNING: string; /** * The “Properties” item and icon. * @deprecated since 3.10: Use named icon "document-properties" or the label "_Properties". */ const STOCK_PROPERTIES: string; /** * The “Quit” item and icon. * @deprecated since 3.10: Use named icon "application-exit" or the label "_Quit". */ const STOCK_QUIT: string; /** * The “Redo” item and icon. The icon has an RTL variant. * @deprecated since 3.10: Use named icon "edit-redo" or the label "_Redo". */ const STOCK_REDO: string; /** * The “Refresh” item and icon. * @deprecated since 3.10: Use named icon "view-refresh" or the label "_Refresh". */ const STOCK_REFRESH: string; /** * The “Remove” item and icon. * @deprecated since 3.10: Use named icon "list-remove" or the label "_Remove". */ const STOCK_REMOVE: string; /** * The “Revert” item and icon. The icon has an RTL variant. * @deprecated since 3.10: Use named icon "document-revert" or the label "_Revert". */ const STOCK_REVERT_TO_SAVED: string; /** * The “Save” item and icon. * @deprecated since 3.10: Use named icon "document-save" or the label "_Save". */ const STOCK_SAVE: string; /** * The “Save As” item and icon. * @deprecated since 3.10: Use named icon "document-save-as" or the label "Save _As". */ const STOCK_SAVE_AS: string; /** * The “Select All” item and icon. * @since 2.10 * @deprecated since 3.10: Use named icon "edit-select-all" or the label "Select _All". */ const STOCK_SELECT_ALL: string; /** * The “Color” item and icon. * @deprecated since 3.10 */ const STOCK_SELECT_COLOR: string; /** * The “Font” item and icon. * @deprecated since 3.10 */ const STOCK_SELECT_FONT: string; /** * The “Ascending” item and icon. * @deprecated since 3.10: Use named icon "view-sort-ascending". */ const STOCK_SORT_ASCENDING: string; /** * The “Descending” item and icon. * @deprecated since 3.10: Use named icon "view-sort-descending". */ const STOCK_SORT_DESCENDING: string; /** * The “Spell Check” item and icon. * @deprecated since 3.10: Use named icon "tools-check-spelling". */ const STOCK_SPELL_CHECK: string; /** * The “Stop” item and icon. * @deprecated since 3.10: Use named icon "process-stop" or the label "_Stop". */ const STOCK_STOP: string; /** * The “Strikethrough” item and icon. * @deprecated since 3.10: Use named icon "format-text-strikethrough" or the label "_Strikethrough". */ const STOCK_STRIKETHROUGH: string; /** * The “Undelete” item and icon. The icon has an RTL variant. * @deprecated since 3.10 */ const STOCK_UNDELETE: string; /** * The “Underline” item and icon. * @deprecated since 3.10: Use named icon "format-text-underline" or the label "_Underline". */ const STOCK_UNDERLINE: string; /** * The “Undo” item and icon. The icon has an RTL variant. * @deprecated since 3.10: Use named icon "edit-undo" or the label "_Undo". */ const STOCK_UNDO: string; /** * The “Unindent” item and icon. The icon has an RTL variant. * @since 2.4 * @deprecated since 3.10: Use named icon "format-indent-less". */ const STOCK_UNINDENT: string; /** * The “Yes” item and icon. * @deprecated since 3.10 */ const STOCK_YES: string; /** * The “Zoom 100%” item and icon. * @deprecated since 3.10: Use named icon "zoom-original" or the label "_Normal Size". */ const STOCK_ZOOM_100: string; /** * The “Zoom to Fit” item and icon. * @deprecated since 3.10: Use named icon "zoom-fit-best" or the label "Best _Fit". */ const STOCK_ZOOM_FIT: string; /** * The “Zoom In” item and icon. * @deprecated since 3.10: Use named icon "zoom-in" or the label "Zoom _In". */ const STOCK_ZOOM_IN: string; /** * The “Zoom Out” item and icon. * @deprecated since 3.10: Use named icon "zoom-out" or the label "Zoom _Out". */ const STOCK_ZOOM_OUT: string; /** * A CSS class to match an accelerator. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_ACCELERATOR: string; /** * A CSS class used when rendering an arrow element. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_ARROW: string; /** * A CSS class to match the window background. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_BACKGROUND: string; /** * A CSS class to indicate an area at the bottom of a widget. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_BOTTOM: string; /** * A CSS class to match buttons. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_BUTTON: string; /** * A CSS class to match calendars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_CALENDAR: string; /** * A CSS class to match content rendered in cell views. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_CELL: string; /** * A CSS class to match check boxes. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_CHECK: string; /** * A CSS class to match combobox entries. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_COMBOBOX_ENTRY: string; /** * A CSS class to match context menus. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_CONTEXT_MENU: string; /** * A CSS class that gets added to windows which have client-side decorations. * * Refer to individual widget documentation for used style classes. * @since 3.14 */ const STYLE_CLASS_CSD: string; /** * A CSS class used when rendering a drag handle for * text selection. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_CURSOR_HANDLE: string; /** * A CSS class to match the default widget. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_DEFAULT: string; /** * A CSS class used when an action (usually a button) is * one that is expected to remove or destroy something visible * to the user. * * Refer to individual widget documentation for used style classes. * @since 3.12 */ const STYLE_CLASS_DESTRUCTIVE_ACTION: string; /** * A CSS class to match dimmed labels. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_DIM_LABEL: string; /** * A CSS class for a drag-and-drop indicator. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_DND: string; /** * A CSS class defining a dock area. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_DOCK: string; /** * A CSS class to match text entries. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_ENTRY: string; /** * A CSS class for an area displaying an error message, * such as those in infobars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_ERROR: string; /** * A CSS class defining an expander, such as those in treeviews. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_EXPANDER: string; /** * A CSS class that is added when widgets that usually have * a frame or border (like buttons or entries) should appear * without it. * * Refer to individual widget documentation for used style classes. * @since 3.14 */ const STYLE_CLASS_FLAT: string; /** * A CSS class defining a frame delimiting content, such as * {@link Gtk.Frame} or the scrolled window frame around the * scrollable area. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_FRAME: string; /** * A CSS class defining a resize grip. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_GRIP: string; /** * A CSS class to match a header element. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_HEADER: string; /** * A CSS class defining a highlighted area, such as headings in * assistants and calendars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_HIGHLIGHT: string; /** * A CSS class for horizontally layered widgets. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_HORIZONTAL: string; /** * A CSS class defining an image, such as the icon in an entry. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_IMAGE: string; /** * A CSS class for an area displaying an informational message, * such as those in infobars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_INFO: string; /** * A CSS class to match inline toolbars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_INLINE_TOOLBAR: string; /** * A CSS class used when rendering a drag handle for * the insertion cursor position. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_INSERTION_CURSOR: string; /** * A CSS class to match labels. * * Refer to individual widget documentation for used style classes. * @since 3.16 */ const STYLE_CLASS_LABEL: string; /** * A CSS class to indicate an area at the left of a widget. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_LEFT: string; /** * A CSS class used when rendering a level indicator, such * as a battery charge level, or a password strength. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_LEVEL_BAR: string; /** * A CSS class to match a linked area, such as a box containing buttons * belonging to the same control. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_LINKED: string; /** * A CSS class to match lists. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_LIST: string; /** * A CSS class to match list rows. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_LIST_ROW: string; /** * A CSS class defining marks in a widget, such as in scales. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_MARK: string; /** * A CSS class to match menus. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_MENU: string; /** * A CSS class to menubars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_MENUBAR: string; /** * A CSS class to match menu items. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_MENUITEM: string; /** * A CSS class that is added to message dialogs. * * Refer to individual widget documentation for used style classes. * @since 3.14 */ const STYLE_CLASS_MESSAGE_DIALOG: string; /** * A CSS class that is added to text view that should use * a monospace font. * * Refer to individual widget documentation for used style classes. * @since 3.16 */ const STYLE_CLASS_MONOSPACE: string; /** * A CSS class used when an element needs the user attention, * for instance a button in a stack switcher corresponding to * a hidden page that changed state. * * Refer to individual widget documentation for used style classes. * @since 3.12 */ const STYLE_CLASS_NEEDS_ATTENTION: string; /** * A CSS class defining a notebook. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_NOTEBOOK: string; /** * A CSS class used when rendering an OSD (On Screen Display) element, * on top of another container. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_OSD: string; /** * A CSS class that is added on the visual hints that happen * when scrolling is attempted past the limits of a scrollable * area. * * Refer to individual widget documentation for used style classes. * @since 3.14 */ const STYLE_CLASS_OVERSHOOT: string; /** * A CSS class for a pane separator, such as those in {@link Gtk.Paned}. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_PANE_SEPARATOR: string; /** * A CSS class that is added to areas that should look like paper. * * This is used in print previews and themes are encouraged to * style it as black text on white background. * * Refer to individual widget documentation for used style classes. * @since 3.16 */ const STYLE_CLASS_PAPER: string; /** * A CSS class that matches popovers. * * Refer to individual widget documentation for used style classes. * @since 3.14 */ const STYLE_CLASS_POPOVER: string; /** * A CSS class that is added to the toplevel windows used for menus. * * Refer to individual widget documentation for used style classes. * @since 3.14 */ const STYLE_CLASS_POPUP: string; /** * A CSS class to match primary toolbars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_PRIMARY_TOOLBAR: string; /** * A CSS class to use when rendering activity as a progressbar. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_PROGRESSBAR: string; /** * A CSS class to use when rendering a pulse in an indeterminate progress bar. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_PULSE: string; /** * A CSS class for an area displaying a question to the user, * such as those in infobars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_QUESTION: string; /** * A CSS class to match radio buttons. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_RADIO: string; /** * A CSS class to match a raised control, such as a raised * button on a toolbar. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_RAISED: string; /** * A CSS class used to indicate a read-only state. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_READ_ONLY: string; /** * A CSS class to indicate an area at the right of a widget. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_RIGHT: string; /** * A CSS class to match the rubberband selection rectangle. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_RUBBERBAND: string; /** * A CSS class to match scale widgets. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SCALE: string; /** * A CSS class to match scale widgets with marks attached, * all the marks are above for horizontal {@link Gtk.Scale}. * left for vertical {@link Gtk.Scale}. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SCALE_HAS_MARKS_ABOVE: string; /** * A CSS class to match scale widgets with marks attached, * all the marks are below for horizontal {@link Gtk.Scale}, * right for vertical {@link Gtk.Scale}. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SCALE_HAS_MARKS_BELOW: string; /** * A CSS class to match scrollbars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SCROLLBAR: string; /** * A CSS class to match the junction area between an horizontal * and vertical scrollbar, when they’re both shown. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SCROLLBARS_JUNCTION: string; /** * A CSS class for a separator. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SEPARATOR: string; /** * A CSS class defining a sidebar, such as the left side in * a file chooser. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SIDEBAR: string; /** * A CSS class to match sliders. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SLIDER: string; /** * A CSS class defining an spinbutton. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SPINBUTTON: string; /** * A CSS class to use when rendering activity as a “spinner”. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_SPINNER: string; /** * A CSS class to match statusbars. * * Refer to individual widget documentation for used style classes. * @since 3.16 */ const STYLE_CLASS_STATUSBAR: string; /** * A CSS class used for the subtitle label in a titlebar in * a toplevel window. * * Refer to individual widget documentation for used style classes. * @since 3.14 */ const STYLE_CLASS_SUBTITLE: string; /** * A CSS class used when an action (usually a button) is the * primary suggested action in a specific context. * * Refer to individual widget documentation for used style classes. * @since 3.12 */ const STYLE_CLASS_SUGGESTED_ACTION: string; /** * A CSS class used for the title label in a titlebar in * a toplevel window. * * Refer to individual widget documentation for used style classes. * @since 3.14 */ const STYLE_CLASS_TITLE: string; /** * A CSS class used when rendering a titlebar in a toplevel window. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_TITLEBAR: string; /** * A CSS class to match toolbars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_TOOLBAR: string; /** * A CSS class to match tooltip windows. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_TOOLTIP: string; /** * A CSS class to indicate an area at the top of a widget. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_TOP: string; /** * A CSS class for touch selection popups on entries * and text views. * * Refer to individual widget documentation for used style classes. * @since 3.16 */ const STYLE_CLASS_TOUCH_SELECTION: string; /** * A CSS class to match troughs, as in scrollbars and progressbars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_TROUGH: string; /** * A CSS class that is added on the visual hints that happen * where content is 'scrolled off' and can be made visible * by scrolling. * * Refer to individual widget documentation for used style classes. * @since 3.16 */ const STYLE_CLASS_UNDERSHOOT: string; /** * A CSS class for vertically layered widgets. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_VERTICAL: string; /** * A CSS class defining a view, such as iconviews or treeviews. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_VIEW: string; /** * A CSS class for an area displaying a warning message, * such as those in infobars. * * Refer to individual widget documentation for used style classes. */ const STYLE_CLASS_WARNING: string; /** * A CSS class to indicate that a UI element should be 'wide'. * Used by {@link Gtk.Paned}. * * Refer to individual widget documentation for used style classes. * @since 3.16 */ const STYLE_CLASS_WIDE: string; /** * A property holding the background color of rendered elements as a {@link Gdk.RGBA}. */ const STYLE_PROPERTY_BACKGROUND_COLOR: string; /** * A property holding the element’s background as a {@link cairo.Pattern}. */ const STYLE_PROPERTY_BACKGROUND_IMAGE: string; /** * A property holding the element’s border color as a {@link Gdk.RGBA}. */ const STYLE_PROPERTY_BORDER_COLOR: string; /** * A property holding the rendered element’s border radius in pixels as a `gint`. */ const STYLE_PROPERTY_BORDER_RADIUS: string; /** * A property holding the element’s border style as a {@link Gtk.BorderStyle}. */ const STYLE_PROPERTY_BORDER_STYLE: string; /** * A property holding the rendered element’s border width in pixels as * a {@link Gtk.Border}. The border is the intermediary spacing property of the * padding/border/margin series. * * `gtk_render_frame()` uses this property to find out the frame line width, * so `GtkWidgets` rendering frames may need to add up this padding when * requesting size */ const STYLE_PROPERTY_BORDER_WIDTH: string; /** * A property holding the foreground color of rendered elements as a {@link Gdk.RGBA}. */ const STYLE_PROPERTY_COLOR: string; /** * A property holding the font properties used when rendering text * as a {@link Pango.FontDescription}. */ const STYLE_PROPERTY_FONT: string; /** * A property holding the rendered element’s margin as a {@link Gtk.Border}. The * margin is defined as the spacing between the border of the element * and its surrounding elements. It is external to {@link Gtk.Widget}'s * size allocations, and the most external spacing property of the * padding/border/margin series. */ const STYLE_PROPERTY_MARGIN: string; /** * A property holding the rendered element’s padding as a {@link Gtk.Border}. The * padding is defined as the spacing between the inner part of the element border * and its child. It’s the innermost spacing property of the padding/border/margin * series. */ const STYLE_PROPERTY_PADDING: string; /** * A priority that can be used when adding a {@link Gtk.StyleProvider} * for application-specific style information. */ const STYLE_PROVIDER_PRIORITY_APPLICATION: number; /** * 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 `* {...}` rules. */ const STYLE_PROVIDER_PRIORITY_FALLBACK: number; /** * The priority used for style information provided * via {@link Gtk.Settings}. * * This priority is higher than #GTK_STYLE_PROVIDER_PRIORITY_THEME * to let settings override themes. */ const STYLE_PROVIDER_PRIORITY_SETTINGS: number; /** * The priority used for style information provided * by themes. */ const STYLE_PROVIDER_PRIORITY_THEME: number; /** * The priority used for the style information from * `XDG_CONFIG_HOME/gtk-3.0/gtk.css`. * * You should not use priorities higher than this, to * give the user the last word. */ const STYLE_PROVIDER_PRIORITY_USER: number; /** * A widget region name to define a treeview column. * @deprecated since 3.20: Don't use regions. */ const STYLE_REGION_COLUMN: string; /** * A widget region name to define a treeview column header. * @deprecated since 3.20: Don't use regions. */ const STYLE_REGION_COLUMN_HEADER: string; /** * A widget region name to define a treeview row. * @deprecated since 3.20: Don't use regions. */ const STYLE_REGION_ROW: string; /** * A widget region name to define a notebook tab. * @deprecated since 3.20: Don't use regions. */ const STYLE_REGION_TAB: string; /** * The priority at which the text view validates onscreen lines * in an idle job in the background. */ const TEXT_VIEW_PRIORITY_VALIDATE: number; /** * The GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID can be used to make a * {@link Gtk.TreeSortable} use the default sort function. * * See also `gtk_tree_sortable_set_sort_column_id()` */ const TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: number; /** * The GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID can be used to make a * {@link Gtk.TreeSortable} use no sorting. * * See also `gtk_tree_sortable_set_sort_column_id()` */ const TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: number; /** * Finds the first accelerator in any {@link Gtk.AccelGroup} attached * to `object` that matches `accel_key` and `accel_mods`, and * activates that accelerator. * @param object the {@link GObject.Object}, usually a {@link Gtk.Window}, on which to activate the accelerator * @param accel_key accelerator keyval from a key event * @param accel_mods keyboard state mask from a key event * @returns `true` if an accelerator was activated and handled this keypress */ function accel_groups_activate(object: GObject.Object, accel_key: number, accel_mods: Gdk.ModifierType): boolean; /** * Gets a list of all accel groups which are attached to `object`. * @param object a {@link GObject.Object}, usually a {@link Gtk.Window} * @returns a list of all accel groups which are attached to `object` */ function accel_groups_from_object(object: GObject.Object): AccelGroup[]; /** * Gets the modifier mask. * * The modifier mask determines which modifiers are considered significant * for keyboard accelerators. See `gtk_accelerator_set_default_mod_mask()`. * @returns the default accelerator modifier mask */ function accelerator_get_default_mod_mask(): Gdk.ModifierType; /** * Converts an accelerator keyval and modifier mask into a string * which can be used to represent the accelerator to the user. * @param accelerator_key accelerator keyval * @param accelerator_mods accelerator modifier mask * @returns a newly-allocated string representing the accelerator. * @since 2.6 */ function accelerator_get_label(accelerator_key: number, accelerator_mods: Gdk.ModifierType): string; /** * Converts an accelerator keyval and modifier mask * into a (possibly translated) string that can be displayed to * a user, similarly to `gtk_accelerator_get_label()`, but handling * keycodes. * * This is only useful for system-level components, applications * should use `gtk_accelerator_parse()` instead. * @param display a {@link Gdk.Display} or `null` to use the default display * @param accelerator_key accelerator keyval * @param keycode accelerator keycode * @param accelerator_mods accelerator modifier mask * @returns a newly-allocated string representing the accelerator. * @since 3.4 */ function accelerator_get_label_with_keycode(display: Gdk.Display | null, accelerator_key: number, keycode: number, accelerator_mods: Gdk.ModifierType): string; /** * Converts an accelerator keyval and modifier mask into a string * parseable by `gtk_accelerator_parse()`. For example, if you pass in * #GDK_KEY_q and #GDK_CONTROL_MASK, this function returns “q”. * * If you need to display accelerators in the user interface, * see `gtk_accelerator_get_label()`. * @param accelerator_key accelerator keyval * @param accelerator_mods accelerator modifier mask * @returns a newly-allocated accelerator name */ function accelerator_name(accelerator_key: number, accelerator_mods: Gdk.ModifierType): string; /** * Converts an accelerator keyval and modifier mask * into a string parseable by `gtk_accelerator_parse_with_keycode()`, * similarly to `gtk_accelerator_name()` but handling keycodes. * This is only useful for system-level components, applications * should use `gtk_accelerator_parse()` instead. * @param display a {@link Gdk.Display} or `null` to use the default display * @param accelerator_key accelerator keyval * @param keycode accelerator keycode * @param accelerator_mods accelerator modifier mask * @returns a newly allocated accelerator name. * @since 3.4 */ function accelerator_name_with_keycode(display: Gdk.Display | null, accelerator_key: number, keycode: number, accelerator_mods: Gdk.ModifierType): string; /** * Parses a string representing an accelerator. The format looks like * `a` or `F1` or `z` (the last one is * for key release). * * The parser is fairly liberal and allows lower or upper case, and also * abbreviations such as `` and ``. Key names are parsed using * `gdk_keyval_from_name()`. For character keys the name is not the symbol, * but the lowercase name, e.g. one would use `minus` instead of * `-`. * * If the parse fails, `accelerator_key` and `accelerator_mods` will * be set to 0 (zero). * @param accelerator string representing an accelerator */ function accelerator_parse(accelerator: string): [number, Gdk.ModifierType | null]; /** * Parses a string representing an accelerator, similarly to * `gtk_accelerator_parse()` but handles keycodes as well. This is only * useful for system-level components, applications should use * `gtk_accelerator_parse()` instead. * * If `accelerator_codes` is given and the result stored in it is non-`null`, * the result must be freed with `g_free()`. * * If a keycode is present in the accelerator and no `accelerator_codes` * is given, the parse will fail. * * If the parse fails, `accelerator_key`, `accelerator_mods` and * `accelerator_codes` will be set to 0 (zero). * @param accelerator string representing an accelerator * @since 3.4 */ function accelerator_parse_with_keycode(accelerator: string): [number, number[] | null, Gdk.ModifierType | null]; /** * Sets the modifiers that will be considered significant for keyboard * accelerators. The default mod mask depends on the GDK backend in use, * but will typically include #GDK_CONTROL_MASK | #GDK_SHIFT_MASK | * #GDK_MOD1_MASK | #GDK_SUPER_MASK | #GDK_HYPER_MASK | #GDK_META_MASK. * In other words, Control, Shift, Alt, Super, Hyper and Meta. Other * modifiers will by default be ignored by {@link Gtk.AccelGroup}. * * You must include at least the three modifiers Control, Shift * and Alt in any value you pass to this function. * * The default mod mask should be changed on application startup, * before using any accelerator groups. * @param default_mod_mask accelerator modifier mask */ function accelerator_set_default_mod_mask(default_mod_mask: Gdk.ModifierType): void; /** * Determines whether a given keyval and modifier mask constitute * a valid keyboard accelerator. For example, the #GDK_KEY_a keyval * plus #GDK_CONTROL_MASK is valid - this is a “Ctrl+a” accelerator. * But, you can't, for instance, use the #GDK_KEY_Control_L keyval * as an accelerator. * @param keyval a GDK keyval * @param modifiers modifier mask * @returns `true` if the accelerator is valid */ function accelerator_valid(keyval: number, modifiers: Gdk.ModifierType): boolean; /** * Returns `true` if dialogs are expected to use an alternative * button order on the screen `screen`. See * `gtk_dialog_set_alternative_button_order()` for more details * about alternative button order. * * If you need to use this function, you should probably connect * to the ::notify:gtk-alternative-button-order signal on the * {@link Gtk.Settings} object associated to `screen`, in order to be * notified if the button order setting changes. * @param screen a {@link Gdk.Screen}, or `null` to use the default screen * @returns Whether the alternative button order should be used * @since 2.6 * @deprecated since 3.10: Deprecated */ function alternative_dialog_button_order(screen: Gdk.Screen | null): boolean; /** * Parses a signal description from `signal_desc` and incorporates * it into `binding_set`. * * Signal descriptions may either bind a key combination to * one or more signals: * * ``` * bind "key" { * "signalname" (param, ...) * ... * } * ``` * * * Or they may also unbind a key combination: * * ``` * unbind "key" * ``` * * * Key combinations must be in a format that can be parsed by * `gtk_accelerator_parse()`. * @param binding_set a {@link Gtk.BindingSet} * @param signal_desc a signal description * @returns {@link GLib.TokenType.NONE} if the signal was successfully parsed and added, the expected token otherwise * @since 3.0 */ function binding_entry_add_signal_from_string(binding_set: BindingSet, signal_desc: string): GLib.TokenType; /** * Override or install a new key binding for `keyval` with `modifiers` on * `binding_set`. * @param binding_set a {@link Gtk.BindingSet} to add a signal to * @param keyval key value * @param modifiers key modifier * @param signal_name signal name to be bound * @param binding_args list of {@link Gtk.BindingArg} signal arguments */ function binding_entry_add_signall(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType, signal_name: string, binding_args: BindingArg[]): void; /** * Remove a binding previously installed via * `gtk_binding_entry_add_signal()` on `binding_set`. * @param binding_set a {@link Gtk.BindingSet} to remove an entry of * @param keyval key value of binding to remove * @param modifiers key modifier of binding to remove */ function binding_entry_remove(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType): void; /** * Install a binding on `binding_set` which causes key lookups * to be aborted, to prevent bindings from lower priority sets * to be activated. * @param binding_set a {@link Gtk.BindingSet} to skip an entry of * @param keyval key value of binding to skip * @param modifiers key modifier of binding to skip * @since 2.12 */ function binding_entry_skip(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType): void; /** * Find a binding set by its globally unique name. * * The `set_name` can either be a name used for `gtk_binding_set_new()` * or the type name of a class used in `gtk_binding_set_by_class()`. * @param set_name unique binding set name * @returns `null` or the specified binding set */ function binding_set_find(set_name: string): BindingSet | null; /** * Find a key binding matching `keyval` and `modifiers` and activate the * binding on `object`. * @param object object to activate when binding found * @param keyval key value of the binding * @param modifiers key modifier of the binding * @returns `true` if a binding was found and activated */ function bindings_activate(object: GObject.Object, keyval: number, modifiers: Gdk.ModifierType): boolean; /** * Looks up key bindings for `object` to find one matching * `event`, and if one was found, activate it. * @param object a {@link GObject.Object} (generally must be a widget) * @param event a {@link Gdk.EventKey} * @returns `true` if a matching key binding was found * @since 2.4 */ function bindings_activate_event(object: GObject.Object, event: Gdk.EventKey): boolean; function builder_error_quark(): GLib.Quark; /** * This function is supposed to be called in {@link Gtk.Widget.SignalSignatures.draw | Gtk.Widget::draw} * implementations for widgets that support multiple windows. * `cr` must be untransformed from invoking of the draw function. * This function will return `true` if the contents of the given * `window` are supposed to be drawn and `false` otherwise. Note * that when the drawing was not initiated by the windowing * system this function will return `true` for all windows, so * you need to draw the bottommost window first. Also, do not * use “else if” statements to check which window should be drawn. * @param cr a cairo context * @param window the window to check. `window` may not be an input-only window. * @returns `true` if `window` should be drawn * @since 3.0 */ function cairo_should_draw_window(cr: cairo.Context, window: Gdk.Window): boolean; /** * Transforms the given cairo context `cr` that from `widget`-relative * coordinates to `window`-relative coordinates. * If the `widget`’s window is not an ancestor of `window`, no * modification will be applied. * * This is the inverse to the transformation GTK applies when * preparing an expose event to be emitted with the {@link Gtk.Widget.SignalSignatures.draw | Gtk.Widget::draw} * signal. It is intended to help porting multiwindow widgets from * GTK+ 2 to the rendering architecture of GTK+ 3. * @param cr the cairo context to transform * @param widget the widget the context is currently centered for * @param window the window to transform the context to * @since 3.0 */ function cairo_transform_to_window(cr: cairo.Context, widget: Widget, window: Gdk.Window): void; /** * Checks that the GTK+ library in use is compatible with the * given version. Generally you would pass in the constants * #GTK_MAJOR_VERSION, #GTK_MINOR_VERSION, #GTK_MICRO_VERSION * as the three arguments to this function; that produces * a check that the library in use is compatible with * the version of GTK+ the application or module was compiled * against. * * Compatibility is defined by two things: first the version * of the running library is newer than the version * `required_major`.required_minor.`required_micro`. Second * the running library must be binary compatible with the * version `required_major`.required_minor.`required_micro` * (same major version.) * * This function is primarily for GTK+ modules; the module * can call this function to check that it wasn’t loaded * into an incompatible version of GTK+. However, such a * check isn’t completely reliable, since the module may be * linked against an old version of GTK+ and calling the * old version of `gtk_check_version()`, but still get loaded * into an application using a newer version of GTK+. * @param required_major the required major version * @param required_minor the required minor version * @param required_micro the required micro version * @returns `null` if the GTK+ library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by GTK+ and should not be modified or freed. */ function check_version(required_major: number, required_minor: number, required_micro: number): string | null; function css_provider_error_quark(): GLib.Quark; /** * Adds a GTK+ grab on `device`, so all the events on `device` and its * associated pointer or keyboard (if any) are delivered to `widget`. * If the `block_others` parameter is `true`, any other devices will be * unable to interact with `widget` during the grab. * @param widget a {@link Gtk.Widget} * @param device a {@link Gdk.Device} to grab on. * @param block_others `true` to prevent other devices to interact with `widget`. * @since 3.0 */ function device_grab_add(widget: Widget, device: Gdk.Device, block_others: boolean): void; /** * Removes a device grab from the given widget. * * You have to pair calls to `gtk_device_grab_add()` and * `gtk_device_grab_remove()`. * @param widget a {@link Gtk.Widget} * @param device a {@link Gdk.Device} * @since 3.0 */ function device_grab_remove(widget: Widget, device: Gdk.Device): void; /** * Prevents `gtk_init()`, `gtk_init_check()`, `gtk_init_with_args()` and * `gtk_parse_args()` from automatically * calling `setlocale (LC_ALL, "")`. You would * want to use this function if you wanted to set the locale for * your program to something other than the user’s locale, or if * you wanted to set different values for different locale categories. * * Most programs should not need to call this function. */ function disable_setlocale(): void; /** * Distributes `extra_space` to child `sizes` by bringing smaller * children up to natural size first. * * The remaining space will be added to the `minimum_size` member of the * GtkRequestedSize struct. If all sizes reach their natural size then * the remaining space is returned. * @param extra_space Extra space to redistribute among children after subtracting minimum sizes and any child padding from the overall allocation * @param n_requested_sizes Number of requests to fit into the allocation * @param sizes An array of structs with a client pointer and a minimum/natural size in the orientation of the allocation. * @returns The remainder of `extra_space` after redistributing space to `sizes`. */ function distribute_natural_allocation(extra_space: number, n_requested_sizes: number, sizes: RequestedSize): number; /** * Cancels an ongoing drag operation on the source side. * * If you want to be able to cancel a drag operation in this way, * you need to keep a pointer to the drag context, either from an * explicit call to `gtk_drag_begin_with_coordinates()`, or by * connecting to {@link Gtk.Widget.SignalSignatures.drag_begin | Gtk.Widget::drag-begin}. * * If `context` does not refer to an ongoing drag operation, this * function does nothing. * * If a drag is cancelled in this way, the `result` argument of * {@link Gtk.Widget.SignalSignatures.drag_failed | Gtk.Widget::drag-failed} is set to `GTK_DRAG_RESULT_ERROR`. * @param context a {@link Gdk.DragContext}, as e.g. returned by `gtk_drag_begin_with_coordinates()` * @since 3.16 */ function drag_cancel(context: Gdk.DragContext): void; /** * Informs the drag source that the drop is finished, and * that the data of the drag will no longer be required. * @param context the drag context * @param success a flag indicating whether the drop was successful * @param del a flag indicating whether the source should delete the original data. (This should be `true` for a move) * @param time_ the timestamp from the {@link Gtk.Widget.SignalSignatures.drag_drop | Gtk.Widget::drag-drop} signal */ function drag_finish(context: Gdk.DragContext, success: boolean, del: boolean, time_: number): void; /** * Determines the source widget for a drag. * @param context a (destination side) drag context * @returns if the drag is occurring within a single application, a pointer to the source widget. Otherwise, `null`. */ function drag_get_source_widget(context: Gdk.DragContext): Widget | null; /** * Sets the icon for a particular drag to the default * icon. * @param context the context for a drag (This must be called with a context for the source side of a drag) */ function drag_set_icon_default(context: Gdk.DragContext): void; /** * Sets the icon for a given drag from the given `icon`. * See the documentation for `gtk_drag_set_icon_name()` * for more details about using icons in drag and drop. * @param context the context for a drag (This must be called with a context for the source side of a drag) * @param icon a {@link Gio.Icon} * @param hot_x the X offset of the hotspot within the icon * @param hot_y the Y offset of the hotspot within the icon * @since 3.2 */ function drag_set_icon_gicon(context: Gdk.DragContext, icon: Gio.Icon, hot_x: number, hot_y: number): void; /** * Sets the icon for a given drag from a named themed icon. See * the docs for {@link Gtk.IconTheme} for more details. Note that the * size of the icon depends on the icon theme (the icon is * loaded at the symbolic size #GTK_ICON_SIZE_DND), thus * `hot_x` and `hot_y` have to be used with care. * @param context the context for a drag (This must be called with a context for the source side of a drag) * @param icon_name name of icon to use * @param hot_x the X offset of the hotspot within the icon * @param hot_y the Y offset of the hotspot within the icon * @since 2.8 */ function drag_set_icon_name(context: Gdk.DragContext, icon_name: string, hot_x: number, hot_y: number): void; /** * Sets `pixbuf` as the icon for a given drag. * @param context the context for a drag (This must be called with a context for the source side of a drag) * @param pixbuf the {@link GdkPixbuf.Pixbuf} to use as the drag icon * @param hot_x the X offset within `widget` of the hotspot * @param hot_y the Y offset within `widget` of the hotspot */ function drag_set_icon_pixbuf(context: Gdk.DragContext, pixbuf: GdkPixbuf.Pixbuf, hot_x: number, hot_y: number): void; /** * Sets the icon for a given drag from a stock ID. * @param context the context for a drag (This must be called with a context for the source side of a drag) * @param stock_id the ID of the stock icon to use for the drag * @param hot_x the X offset within the icon of the hotspot * @param hot_y the Y offset within the icon of the hotspot * @deprecated since 3.10: Use `gtk_drag_set_icon_name()` instead. */ function drag_set_icon_stock(context: Gdk.DragContext, stock_id: string, hot_x: number, hot_y: number): void; /** * Sets `surface` as the icon for a given drag. GTK+ retains * references for the arguments, and will release them when * they are no longer needed. * * To position the surface relative to the mouse, use * `cairo_surface_set_device_offset()` on `surface`. The mouse * cursor will be positioned at the (0,0) coordinate of the * surface. * @param context the context for a drag (This must be called with a context for the source side of a drag) * @param surface the surface to use as icon */ function drag_set_icon_surface(context: Gdk.DragContext, surface: cairo.Surface): void; /** * Changes the icon for drag operation to a given widget. * GTK+ will not destroy the widget, so if you don’t want * it to persist, you should connect to the “drag-end” * signal and destroy it yourself. * @param context the context for a drag. (This must be called with a context for the source side of a drag) * @param widget a widget to use as an icon * @param hot_x the X offset within `widget` of the hotspot * @param hot_y the Y offset within `widget` of the hotspot */ function drag_set_icon_widget(context: Gdk.DragContext, widget: Widget, hot_x: number, hot_y: number): void; /** * Draws a text caret on `cr` at `location`. This is not a style function * but merely a convenience function for drawing the standard cursor shape. * @param widget a {@link Gtk.Widget} * @param cr cairo context to draw to * @param location location where to draw the cursor (`location`->width is ignored) * @param is_primary if the cursor should be the primary cursor color. * @param direction whether the cursor is left-to-right or right-to-left. Should never be #GTK_TEXT_DIR_NONE * @param draw_arrow `true` to draw a directional arrow on the cursor. Should be `false` unless the cursor is split. * @since 3.0 * @deprecated since 3.4: Use `gtk_render_insertion_cursor()` instead. */ function draw_insertion_cursor(widget: Widget, cr: cairo.Context, location: Gdk.Rectangle, is_primary: boolean, direction: TextDirection, draw_arrow: boolean): void; /** * Checks if any events are pending. * * This can be used to update the UI and invoke timeouts etc. * while doing some time intensive computation. * * ## Updating the UI during a long computation * * * ```c * // computation going on... * * while (gtk_events_pending ()) * gtk_main_iteration (); * * // ...computation continued * ``` * * @returns `true` if any events are pending, `false` otherwise */ function events_pending(): boolean; /** * Analogical to `gtk_true()`, this function does nothing * but always returns `false`. * @returns `false` */ function __false(): boolean; /** * Registers an error quark for {@link Gtk.FileChooser} if necessary. * @returns The error quark used for {@link Gtk.FileChooser} errors. * @since 2.4 */ function file_chooser_error_quark(): GLib.Quark; /** * Returns the binary age as passed to `libtool` * when building the GTK+ library the process is running against. * If `libtool` means nothing to you, don't * worry about it. * @returns the binary age of the GTK+ library * @since 3.0 */ function get_binary_age(): number; /** * Obtains a copy of the event currently being processed by GTK+. * * For example, if you are handling a {@link Gtk.Button.SignalSignatures.clicked | Gtk.Button::clicked} signal, * the current event will be the {@link Gdk.EventButton} that triggered * the ::clicked signal. * @returns a copy of the current event, or `null` if there is no current event. The returned event must be freed with `gdk_event_free()`. */ function get_current_event(): Gdk.Event | null; /** * If there is a current event and it has a device, return that * device, otherwise return `null`. * @returns a {@link Gdk.Device}, or `null` */ function get_current_event_device(): Gdk.Device | null; /** * If there is a current event and it has a state field, place * that state field in `state` and return `true`, otherwise return * `false`. * @returns `true` if there was a current event and it had a state field */ function get_current_event_state(): [boolean, Gdk.ModifierType]; /** * If there is a current event and it has a timestamp, * return that timestamp, otherwise return `GDK_CURRENT_TIME`. * @returns the timestamp from the current event, or `GDK_CURRENT_TIME`. */ function get_current_event_time(): number; /** * Returns the GTK+ debug flags. * * This function is intended for GTK+ modules that want * to adjust their debug output based on GTK+ debug flags. * @returns the GTK+ debug flags. */ function get_debug_flags(): number; /** * Returns the {@link Pango.Language} 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 `pango_language_get_default()`. * See that function for details. * @returns the default language as a {@link Pango.Language}, must not be freed */ function get_default_language(): Pango.Language; /** * If `event` is `null` or the event was not associated with any widget, * returns `null`, otherwise returns the widget that received the event * originally. * @param event a {@link Gdk.Event} * @returns the widget that originally received `event`, or `null` */ function get_event_widget(event: Gdk.Event): Widget | null; /** * Returns the interface age as passed to `libtool` * when building the GTK+ library the process is running against. * If `libtool` means nothing to you, don't * worry about it. * @returns the interface age of the GTK+ library * @since 3.0 */ function get_interface_age(): number; /** * 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 Gtk.TextDirection.LTR} * direction otherwise. {@link 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 direcion. * * This function is only needed rare cases when the locale is * changed after GTK+ has already been initialized. In this case, * you can use it to update the default text direction as follows: * * * ```c * setlocale (LC_ALL, new_locale); * direction = gtk_get_locale_direction (); * gtk_widget_set_default_direction (direction); * ``` * * @returns the {@link Gtk.TextDirection} of the current locale * @since 3.12 */ function get_locale_direction(): TextDirection; /** * Returns the major version number of the GTK+ library. * (e.g. in GTK+ version 3.1.5 this is 3.) * * This function is in the library, so it represents the GTK+ library * your code is running against. Contrast with the #GTK_MAJOR_VERSION * macro, which represents the major version of the GTK+ headers you * have included when compiling your code. * @returns the major version number of the GTK+ library * @since 3.0 */ function get_major_version(): number; /** * Returns the micro version number of the GTK+ library. * (e.g. in GTK+ version 3.1.5 this is 5.) * * This function is in the library, so it represents the GTK+ library * your code is are running against. Contrast with the * #GTK_MICRO_VERSION macro, which represents the micro version of the * GTK+ headers you have included when compiling your code. * @returns the micro version number of the GTK+ library * @since 3.0 */ function get_micro_version(): number; /** * Returns the minor version number of the GTK+ library. * (e.g. in GTK+ version 3.1.5 this is 1.) * * This function is in the library, so it represents the GTK+ library * your code is are running against. Contrast with the * #GTK_MINOR_VERSION macro, which represents the minor version of the * GTK+ headers you have included when compiling your code. * @returns the minor version number of the GTK+ library * @since 3.0 */ function get_minor_version(): number; /** * Returns a {@link GLib.OptionGroup} for the commandline arguments recognized * by GTK+ and GDK. * * You should add this group to your {@link GLib.OptionContext} * with `g_option_context_add_group()`, if you are using * `g_option_context_parse()` to parse your commandline arguments. * @param open_default_display whether to open the default display when parsing the commandline arguments * @returns a {@link GLib.OptionGroup} for the commandline arguments recognized by GTK+ * @since 2.6 */ function get_option_group(open_default_display: boolean): GLib.OptionGroup; /** * Queries the current grab of the default window group. * @returns The widget which currently has the grab or `null` if no grab is active */ function grab_get_current(): Widget | null; /** * Looks up the icon size associated with `name`. * @param name the name to look up. * @returns the icon size ({@link Gtk.IconSize}) * @deprecated since 3.10: Use {@link Gtk.IconTheme} instead. */ function icon_size_from_name(name: string): number; /** * Gets the canonical name of the given icon size. The returned string * is statically allocated and should not be freed. * @param size a {@link Gtk.IconSize}. * @returns the name of the given icon size. * @deprecated since 3.10: Use {@link Gtk.IconTheme} instead. */ function icon_size_get_name(size: number): string; /** * Obtains the pixel size of a semantic icon size `size`: * #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function * isn’t normally needed, `gtk_icon_theme_load_icon()` is the usual * way to get an icon for rendering, then just look at the size of * the rendered pixbuf. The rendered pixbuf may not even correspond to * the width/height returned by `gtk_icon_size_lookup()`, because themes * are free to render the pixbuf however they like, including changing * the usual size. * @param size an icon size ({@link Gtk.IconSize}) * @returns `true` if `size` was a valid size */ function icon_size_lookup(size: number): [boolean, number, number]; /** * Obtains the pixel size of a semantic icon size, possibly * modified by user preferences for a particular * {@link Gtk.Settings}. Normally `size` would be * #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function * isn’t normally needed, `gtk_widget_render_icon_pixbuf()` is the usual * way to get an icon for rendering, then just look at the size of * the rendered pixbuf. The rendered pixbuf may not even correspond to * the width/height returned by `gtk_icon_size_lookup()`, because themes * are free to render the pixbuf however they like, including changing * the usual size. * @param settings a {@link Gtk.Settings} object, used to determine which set of user preferences to used. * @param size an icon size ({@link Gtk.IconSize}) * @returns `true` if `size` was a valid size * @since 2.2 * @deprecated since 3.10: Use `gtk_icon_size_lookup()` instead. */ function icon_size_lookup_for_settings(settings: Settings, size: number): [boolean, number, number]; /** * Registers a new icon size, along the same lines as #GTK_ICON_SIZE_MENU, * etc. Returns the integer value for the size. * @param name name of the icon size * @param width the icon width * @param height the icon height * @returns integer value representing the size ({@link Gtk.IconSize}) * @deprecated since 3.10: Use {@link Gtk.IconTheme} instead. */ function icon_size_register(name: string, width: number, height: number): number; /** * Registers `alias` as another name for `target`. * So calling `gtk_icon_size_from_name()` with `alias` as argument * will return `target`. * @param alias an alias for `target` * @param target an existing icon size ({@link Gtk.IconSize}) * @deprecated since 3.10: Use {@link Gtk.IconTheme} instead. */ function icon_size_register_alias(alias: string, target: number): void; function icon_theme_error_quark(): GLib.Quark; /** * Call this function before using any other GTK+ functions in your GUI * applications. It will initialize everything needed to operate the * toolkit and parses some standard command line options. * * Although you are expected to pass the `argc`, `argv` parameters from `main()` to * this function, it is possible to pass `null` if `argv` is not available or * commandline handling is not required. * * `argc` and `argv` are adjusted accordingly so your own code will * never see those standard arguments. * * Note that there are some alternative ways to initialize GTK+: * if you are calling `gtk_parse_args()`, `gtk_init_check()`, * `gtk_init_with_args()` or `g_option_context_parse()` with * the option group returned by `gtk_get_option_group()`, * you don’t have to call `gtk_init()`. * * And if you are using {@link Gtk.Application}, you don't have to call any of the * initialization functions either; the {@link Gtk.Application.SignalSignatures.startup | Gtk.Application::startup} handler * does it for you. * * This function will terminate your program if it was unable to * initialize the windowing system for some reason. If you want * your program to fall back to a textual interface you want to * call `gtk_init_check()` instead. * * Since 2.18, GTK+ calls `signal (SIGPIPE, SIG_IGN)` * during initialization, to ignore SIGPIPE signals, since these are * almost never wanted in graphical applications. If you do need to * handle SIGPIPE for some reason, reset the handler after `gtk_init()`, * but notice that other libraries (e.g. libdbus or gvfs) might do * similar things. * @param argv Address of the `argv` parameter of `main()`, or `null`. Any options understood by GTK+ are stripped before return. */ function init(argv: string[] | null): string[] | null; /** * This function does the same work as `gtk_init()` with only a single * change: It does not terminate the program if the commandline * arguments couldn’t be parsed or the windowing system can’t be * initialized. Instead it returns `false` on failure. * * This way the application can fall back to some other means of * communication with the user - for example a curses or command line * interface. * * Note that calling any GTK function or instantiating any GTK type after * this function returns `false` results in undefined behavior. * @param argv Address of the `argv` parameter of `main()`, or `null`. Any options understood by GTK+ are stripped before return. * @returns `true` if the commandline arguments (if any) were valid and the windowing system has been successfully initialized, `false` otherwise */ function init_check(argv: string[] | null): [boolean, string[] | null]; /** * This function does the same work as `gtk_init_check()`. * Additionally, it allows you to add your own commandline options, * and it automatically generates nicely formatted * `--help` output. Note that your program will * be terminated after writing out the help output. * @param argv Address of the `argv` parameter of `main()`, or `null`. Any options understood by GTK+ are stripped before return. * @param parameter_string a string which is displayed in the first line of `--help` output, after `programname [OPTION...]` * @param entries a `null`-terminated array of `GOptionEntrys` describing the options of your program * @param translation_domain a translation domain to use for translating the `--help` output for the options in `entries` and the `parameter_string` with `gettext()`, or `null` * @returns `true` if the commandline arguments (if any) were valid and if the windowing system has been successfully initialized, `false` otherwise * @since 2.6 */ function init_with_args(argv: string[] | null, parameter_string: string | null, entries: GLib.OptionEntry[], translation_domain: string | null): [boolean, string[] | null]; /** * Removes the key snooper function with the given id. * @param snooper_handler_id Identifies the key snooper to remove * @deprecated since 3.4: Key snooping should not be done. Events should be handled by widgets. */ function key_snooper_remove(snooper_handler_id: number): void; /** * Runs the main loop until `gtk_main_quit()` is called. * * You can nest calls to `gtk_main()`. In that case `gtk_main_quit()` * will make the innermost invocation of the main loop return. */ function main(): void; /** * Processes a single GDK event. * * This is public only to allow filtering of events between GDK and GTK+. * You will not usually need to call this function directly. * * While you should not call this function directly, you might want to * know how exactly events are handled. So here is what this function * does with the event: * * 1. Compress enter/leave notify events. If the event passed build an * enter/leave pair together with the next event (peeked from GDK), both * events are thrown away. This is to avoid a backlog of (de-)highlighting * widgets crossed by the pointer. * * 2. Find the widget which got the event. If the widget can’t be determined * the event is thrown away unless it belongs to a INCR transaction. * * 3. Then the event is pushed onto a stack so you can query the currently * handled event with `gtk_get_current_event()`. * * 4. The event is sent to a widget. If a grab is active all events for widgets * that are not in the contained in the grab widget are sent to the latter * with a few exceptions: * - Deletion and destruction events are still sent to the event widget for * obvious reasons. * - Events which directly relate to the visual representation of the event * widget. * - Leave events are delivered to the event widget if there was an enter * event delivered to it before without the paired leave event. * - Drag events are not redirected because it is unclear what the semantics * of that would be. * Another point of interest might be that all key events are first passed * through the key snooper functions if there are any. Read the description * of `gtk_key_snooper_install()` if you need this feature. * * 5. After finishing the delivery the event is popped from the event stack. * @param event An event to process (normally passed by GDK) */ function main_do_event(event: Gdk.Event): void; /** * Runs a single iteration of the mainloop. * * If no events are waiting to be processed GTK+ will block * until the next event is noticed. If you don’t want to block * look at `gtk_main_iteration_do()` or check if any events are * pending with `gtk_events_pending()` first. * @returns `true` if `gtk_main_quit()` has been called for the innermost mainloop */ function main_iteration(): boolean; /** * Runs a single iteration of the mainloop. * If no events are available either return or block depending on * the value of `blocking`. * @param blocking `true` if you want GTK+ to block if no events are pending * @returns `true` if `gtk_main_quit()` has been called for the innermost mainloop */ function main_iteration_do(blocking: boolean): boolean; /** * Asks for the current nesting level of the main loop. * @returns the nesting level of the current invocation of the main loop */ function main_level(): number; /** * Makes the innermost invocation of the main loop return * when it regains control. */ function main_quit(): void; /** * Draws an arrow in the given rectangle on `cr` using the given * parameters. `arrow_type` determines the direction of the arrow. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type the type of shadow to draw * @param widget the widget * @param detail a style detail * @param arrow_type the type of arrow to draw * @param fill `true` if the arrow tip should be filled * @param x x origin of the rectangle to draw the arrow in * @param y y origin of the rectangle to draw the arrow in * @param width width of the rectangle to draw the arrow in * @param height height of the rectangle to draw the arrow in * @deprecated since 3.0: Use `gtk_render_arrow()` instead */ function paint_arrow(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, arrow_type: ArrowType, fill: boolean, x: number, y: number, width: number, height: number): void; /** * Draws a box on `cr` with the given parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type the type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the box * @param y y origin of the box * @param width the width of the box * @param height the height of the box * @deprecated since 3.0: Use `gtk_render_frame()` and `gtk_render_background()` instead */ function paint_box(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number): void; /** * Draws a box in `cr` using the given style and state and shadow type, * leaving a gap in one side. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle * @param gap_side side in which to leave the gap * @param gap_x starting position of the gap * @param gap_width width of the gap * @deprecated since 3.0: Use `gtk_render_frame_gap()` instead */ function paint_box_gap(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, gap_side: PositionType, gap_x: number, gap_width: number): void; /** * Draws a check button indicator in the given rectangle on `cr` with * the given parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type the type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle to draw the check in * @param y y origin of the rectangle to draw the check in * @param width the width of the rectangle to draw the check in * @param height the height of the rectangle to draw the check in * @deprecated since 3.0: Use `gtk_render_check()` instead */ function paint_check(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number): void; /** * Draws a diamond in the given rectangle on `window` using the given * parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type the type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle to draw the diamond in * @param y y origin of the rectangle to draw the diamond in * @param width width of the rectangle to draw the diamond in * @param height height of the rectangle to draw the diamond in * @deprecated since 3.0: Use cairo instead */ function paint_diamond(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number): void; /** * Draws an expander as used in {@link Gtk.TreeView}. `x` and `y` specify the * center the expander. The size of the expander is determined by the * “expander-size” style property of `widget`. (If widget is not * specified or doesn’t have an “expander-size” property, an * unspecified default size will be used, since the caller doesn't * have sufficient information to position the expander, this is * likely not useful.) The expander is expander_size pixels tall * in the collapsed position and expander_size pixels wide in the * expanded position. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param widget the widget * @param detail a style detail * @param x the x position to draw the expander at * @param y the y position to draw the expander at * @param expander_style the style to draw the expander in; determines whether the expander is collapsed, expanded, or in an intermediate state. * @deprecated since 3.0: Use `gtk_render_expander()` instead */ function paint_expander(style: Style, cr: cairo.Context, state_type: StateType, widget: Widget | null, detail: string | null, x: number, y: number, expander_style: ExpanderStyle): void; /** * Draws an extension, i.e. a notebook tab. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the extension * @param y y origin of the extension * @param width width of the extension * @param height width of the extension * @param gap_side the side on to which the extension is attached * @deprecated since 3.0: Use `gtk_render_extension()` instead */ function paint_extension(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, gap_side: PositionType): void; /** * Draws a flat box on `cr` with the given parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type the type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the box * @param y y origin of the box * @param width the width of the box * @param height the height of the box * @deprecated since 3.0: Use `gtk_render_frame()` and `gtk_render_background()` instead */ function paint_flat_box(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number): void; /** * Draws a focus indicator around the given rectangle on `cr` using the * given style. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param widget the widget * @param detail a style detail * @param x the x origin of the rectangle around which to draw a focus indicator * @param y the y origin of the rectangle around which to draw a focus indicator * @param width the width of the rectangle around which to draw a focus indicator * @param height the height of the rectangle around which to draw a focus indicator * @deprecated since 3.0: Use `gtk_render_focus()` instead */ function paint_focus(style: Style, cr: cairo.Context, state_type: StateType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number): void; /** * Draws a handle as used in {@link Gtk.HandleBox} and {@link Gtk.Paned}. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the handle * @param y y origin of the handle * @param width with of the handle * @param height height of the handle * @param orientation the orientation of the handle * @deprecated since 3.0: Use `gtk_render_handle()` instead */ function paint_handle(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, orientation: Orientation): void; /** * Draws a horizontal line from (`x1`, `y`) to (`x2`, `y`) in `cr` * using the given style and state. * @param style a {@link Gtk.Style} * @param cr a `caio_t` * @param state_type a state * @param widget the widget * @param detail a style detail * @param x1 the starting x coordinate * @param x2 the ending x coordinate * @param y the y coordinate * @deprecated since 3.0: Use `gtk_render_line()` instead */ function paint_hline(style: Style, cr: cairo.Context, state_type: StateType, widget: Widget | null, detail: string | null, x1: number, x2: number, y: number): void; /** * Draws a layout on `cr` using the given parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param use_text whether to use the text or foreground graphics context of `style` * @param widget the widget * @param detail a style detail * @param x x origin * @param y y origin * @param layout the layout to draw * @deprecated since 3.0: Use `gtk_render_layout()` instead */ function paint_layout(style: Style, cr: cairo.Context, state_type: StateType, use_text: boolean, widget: Widget | null, detail: string | null, x: number, y: number, layout: Pango.Layout): void; /** * Draws a radio button indicator in the given rectangle on `cr` with * the given parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type the type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle to draw the option in * @param y y origin of the rectangle to draw the option in * @param width the width of the rectangle to draw the option in * @param height the height of the rectangle to draw the option in * @deprecated since 3.0: Use `gtk_render_option()` instead */ function paint_option(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number): void; /** * Draws a resize grip in the given rectangle on `cr` using the given * parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param widget the widget * @param detail a style detail * @param edge the edge in which to draw the resize grip * @param x the x origin of the rectangle in which to draw the resize grip * @param y the y origin of the rectangle in which to draw the resize grip * @param width the width of the rectangle in which to draw the resize grip * @param height the height of the rectangle in which to draw the resize grip * @deprecated since 3.0: Use `gtk_render_handle()` instead */ function paint_resize_grip(style: Style, cr: cairo.Context, state_type: StateType, widget: Widget | null, detail: string | null, edge: Gdk.WindowEdge, x: number, y: number, width: number, height: number): void; /** * Draws a shadow around the given rectangle in `cr` * using the given style and state and shadow type. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle * @deprecated since 3.0: Use `gtk_render_frame()` instead */ function paint_shadow(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number): void; /** * Draws a shadow around the given rectangle in `cr` * using the given style and state and shadow type, leaving a * gap in one side. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle * @param gap_side side in which to leave the gap * @param gap_x starting position of the gap * @param gap_width width of the gap * @deprecated since 3.0: Use `gtk_render_frame_gap()` instead */ function paint_shadow_gap(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, gap_side: PositionType, gap_x: number, gap_width: number): void; /** * Draws a slider in the given rectangle on `cr` using the * given style and orientation. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type a shadow * @param widget the widget * @param detail a style detail * @param x the x origin of the rectangle in which to draw a slider * @param y the y origin of the rectangle in which to draw a slider * @param width the width of the rectangle in which to draw a slider * @param height the height of the rectangle in which to draw a slider * @param orientation the orientation to be used * @deprecated since 3.0: Use `gtk_render_slider()` instead */ function paint_slider(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, orientation: Orientation): void; /** * Draws a spinner on `window` using the given parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param widget the widget (may be `null`) * @param detail a style detail (may be `null`) * @param step the nth step * @param x the x origin of the rectangle in which to draw the spinner * @param y the y origin of the rectangle in which to draw the spinner * @param width the width of the rectangle in which to draw the spinner * @param height the height of the rectangle in which to draw the spinner * @deprecated since 3.0: Use `gtk_render_icon()` and the {@link Gtk.StyleContext} you are drawing instead */ function paint_spinner(style: Style, cr: cairo.Context, state_type: StateType, widget: Widget | null, detail: string | null, step: number, x: number, y: number, width: number, height: number): void; /** * Draws an option menu tab (i.e. the up and down pointing arrows) * in the given rectangle on `cr` using the given parameters. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param shadow_type the type of shadow to draw * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle to draw the tab in * @param y y origin of the rectangle to draw the tab in * @param width the width of the rectangle to draw the tab in * @param height the height of the rectangle to draw the tab in * @deprecated since 3.0: Use cairo instead */ function paint_tab(style: Style, cr: cairo.Context, state_type: StateType, shadow_type: ShadowType, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number): void; /** * Draws a vertical line from (`x`, `y1_`) to (`x`, `y2_`) in `cr` * using the given style and state. * @param style a {@link Gtk.Style} * @param cr a {@link cairo.Context} * @param state_type a state * @param widget the widget * @param detail a style detail * @param y1_ the starting y coordinate * @param y2_ the ending y coordinate * @param x the x coordinate * @deprecated since 3.0: Use `gtk_render_line()` instead */ function paint_vline(style: Style, cr: cairo.Context, state_type: StateType, widget: Widget | null, detail: string | null, y1_: number, y2_: number, x: number): void; /** * Returns the name of the default paper size, which * depends on the current locale. * @returns the name of the default paper size. The string is owned by GTK+ and should not be modified. * @since 2.10 */ function paper_size_get_default(): string; /** * Creates a list of known paper sizes. * @param include_custom whether to include custom paper sizes as defined in the page setup dialog * @returns a newly allocated list of newly allocated {@link Gtk.PaperSize} objects * @since 2.12 */ function paper_size_get_paper_sizes(include_custom: boolean): PaperSize[]; /** * Parses command line arguments, and initializes global * attributes of GTK+, but does not actually open a connection * to a display. (See `gdk_display_open()`, `gdk_get_display_arg_name()`) * * Any arguments used by GTK+ or GDK are removed from the array and * `argc` and `argv` are updated accordingly. * * There is no need to call this function explicitly if you are using * `gtk_init()`, or `gtk_init_check()`. * * Note that many aspects of GTK+ require a display connection to * function, so this way of initializing GTK+ is really only useful * for specialized use cases. * @param argv a pointer to the array of command line arguments * @returns `true` if initialization succeeded, otherwise `false` */ function parse_args(argv: string[]): [boolean, string[]]; /** * Registers an error quark for {@link Gtk.PrintOperation} if necessary. * @returns The error quark used for {@link Gtk.PrintOperation} errors. * @since 2.10 */ function print_error_quark(): GLib.Quark; /** * Runs a page setup dialog, letting the user modify the values from * `page_setup`. If the user cancels the dialog, the returned {@link Gtk.PageSetup} * is identical to the passed in `page_setup`, otherwise it contains the * modifications done in the dialog. * * Note that this function may use a recursive mainloop to show the page * setup dialog. See `gtk_print_run_page_setup_dialog_async()` if this is * a problem. * @param parent transient parent * @param page_setup an existing {@link Gtk.PageSetup} * @param settings a {@link Gtk.PrintSettings} * @returns a new {@link Gtk.PageSetup} * @since 2.10 */ function print_run_page_setup_dialog(parent: Window | null, page_setup: PageSetup | null, settings: PrintSettings): PageSetup; /** * Runs a page setup dialog, letting the user modify the values from `page_setup`. * * In contrast to `gtk_print_run_page_setup_dialog()`, this function returns after * showing the page setup dialog on platforms that support this, and calls `done_cb` * from a signal handler for the ::response signal of the dialog. * @param parent transient parent, or `null` * @param page_setup an existing {@link Gtk.PageSetup}, or `null` * @param settings a {@link Gtk.PrintSettings} * @param done_cb a function to call when the user saves the modified page setup * @since 2.10 */ function print_run_page_setup_dialog_async(parent: Window | null, page_setup: PageSetup | null, settings: PrintSettings, done_cb: PageSetupDoneFunc): void; /** * Sends an event to a widget, propagating the event to parent widgets * if the event remains unhandled. * * Events received by GTK+ from GDK normally begin in `gtk_main_do_event()`. * Depending on the type of event, existence of modal dialogs, grabs, etc., * the event may be propagated; if so, this function is used. * * `gtk_propagate_event()` calls `gtk_widget_event()` on each widget it * decides to send the event to. So `gtk_widget_event()` is the lowest-level * function; it simply emits the {@link Gtk.Widget.SignalSignatures.event | Gtk.Widget::event} and possibly an * event-specific signal on a widget. `gtk_propagate_event()` is a bit * higher-level, and `gtk_main_do_event()` is the highest level. * * All that said, you most likely don’t want to use any of these * functions; synthesizing events is rarely needed. There are almost * certainly better ways to achieve your goals. For example, use * `gdk_window_invalidate_rect()` or `gtk_widget_queue_draw()` instead * of making up expose events. * @param widget a {@link Gtk.Widget} * @param event an event */ function propagate_event(widget: Widget, event: Gdk.Event): void; /** * Adds a file to the list of files to be parsed at the * end of `gtk_init()`. * @param filename the pathname to the file. If `filename` is not absolute, it is searched in the current directory. * @deprecated since 3.0: Use {@link Gtk.StyleContext} with a custom {@link Gtk.StyleProvider} instead */ function rc_add_default_file(filename: string): void; /** * Searches for a theme engine in the GTK+ search path. This function * is not useful for applications and should not be used. * @param module_file name of a theme engine * @returns The filename, if found (must be freed with `g_free()`), otherwise `null`. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_find_module_in_path(module_file: string): string; /** * Looks up a file in pixmap path for the specified {@link Gtk.Settings}. * If the file is not found, it outputs a warning message using * `g_warning()` and returns `null`. * @param settings a {@link Gtk.Settings} * @param scanner Scanner used to get line number information for the warning message, or `null` * @param pixmap_file name of the pixmap file to locate. * @returns the filename. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_find_pixmap_in_path(settings: Settings, scanner: GLib.Scanner, pixmap_file: string): string; /** * Retrieves the current list of RC files that will be parsed * at the end of `gtk_init()`. * @returns A `null`-terminated array of filenames. This memory is owned by GTK+ and must not be freed by the application. If you want to store this information, you should make a copy. * @deprecated since 3.0: Use {@link Gtk.StyleContext} instead */ function rc_get_default_files(): string[]; /** * Obtains the path to the IM modules file. See the documentation * of the `GTK_IM_MODULE_FILE` * environment variable for more details. * @returns a newly-allocated string containing the name of the file listing the IM modules available for loading * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_get_im_module_file(): string; /** * Obtains the path in which to look for IM modules. See the documentation * of the `GTK_PATH` * environment variable for more details about looking up modules. This * function is useful solely for utilities supplied with GTK+ and should * not be used by applications under normal circumstances. * @returns a newly-allocated string containing the path in which to look for IM modules. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_get_im_module_path(): string; /** * Returns a directory in which GTK+ looks for theme engines. * For full information about the search for theme engines, * see the docs for `GTK_PATH` in [Running GTK+ Applications][gtk-running]. * @returns the directory. (Must be freed with `g_free()`) * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_get_module_dir(): string; /** * Finds all matching RC styles for a given widget, * composites them together, and then creates a * {@link Gtk.Style} representing the composite appearance. * (GTK+ actually keeps a cache of previously * created styles, so a new style may not be * created.) * @param widget a {@link Gtk.Widget} * @returns the resulting style. No refcount is added to the returned style, so if you want to save this style around, you should add a reference yourself. * @deprecated since 3.0: Use {@link Gtk.StyleContext} instead */ function rc_get_style(widget: Widget): Style; /** * Creates up a {@link Gtk.Style} from styles defined in a RC file by providing * the raw components used in matching. This function may be useful * when creating pseudo-widgets that should be themed like widgets but * don’t actually have corresponding GTK+ widgets. An example of this * would be items inside a GNOME canvas widget. * * The action of `gtk_rc_get_style()` is similar to: * * ```c * gtk_widget_path (widget, NULL, &path, NULL); * gtk_widget_class_path (widget, NULL, &class_path, NULL); * gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget), * path, class_path, * G_OBJECT_TYPE (widget)); * ``` * * @param settings a {@link Gtk.Settings} object * @param widget_path the widget path to use when looking up the style, or `null` if no matching against the widget path should be done * @param class_path the class path to use when looking up the style, or `null` if no matching against the class path should be done. * @param type a type that will be used along with parent types of this type when matching against class styles, or #G_TYPE_NONE * @returns A style created by matching with the supplied paths, or `null` if nothing matching was specified and the default style should be used. The returned value is owned by GTK+ as part of an internal cache, so you must call `g_object_ref()` on the returned value if you want to keep a reference to it. * @deprecated since 3.0: Use {@link Gtk.StyleContext} instead */ function rc_get_style_by_paths(settings: Settings, widget_path: string | null, class_path: string | null, type: GObject.GType): Style | null; /** * Returns the standard directory in which themes should * be installed. (GTK+ does not actually use this directory * itself.) * @returns The directory (must be freed with `g_free()`). * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_get_theme_dir(): string; /** * Parses a given resource file. * @param filename the filename of a file to parse. If `filename` is not absolute, it is searched in the current directory. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_parse(filename: string): void; /** * Parses a color in the format expected * in a RC file. * * Note that theme engines should use `gtk_rc_parse_color_full()` in * order to support symbolic colors. * @param scanner a {@link GLib.Scanner} * @returns {@link GLib.TokenType.NONE} if parsing succeeded, otherwise the token that was expected but not found * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead */ function rc_parse_color(scanner: GLib.Scanner): [number, Gdk.Color]; /** * Parses a color in the format expected * in a RC file. If `style` is not `null`, it will be consulted to resolve * references to symbolic colors. * @param scanner a {@link GLib.Scanner} * @param style a {@link Gtk.RcStyle}, or `null` * @returns {@link GLib.TokenType.NONE} if parsing succeeded, otherwise the token that was expected but not found * @since 2.12 * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead */ function rc_parse_color_full(scanner: GLib.Scanner, style: RcStyle | null): [number, Gdk.Color]; /** * Parses a {@link Gtk.PathPriorityType} variable from the format expected * in a RC file. * @param scanner a {@link GLib.Scanner} (must be initialized for parsing an RC file) * @param priority A pointer to {@link Gtk.PathPriorityType} variable in which to store the result. * @returns {@link GLib.TokenType.NONE} if parsing succeeded, otherwise the token that was expected but not found. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead */ function rc_parse_priority(scanner: GLib.Scanner, priority: PathPriorityType): number; /** * Parses a {@link Gtk.StateType} variable from the format expected * in a RC file. * @param scanner a {@link GLib.Scanner} (must be initialized for parsing an RC file) * @returns {@link GLib.TokenType.NONE} if parsing succeeded, otherwise the token that was expected but not found. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead */ function rc_parse_state(scanner: GLib.Scanner): [number, StateType]; /** * Parses resource information directly from a string. * @param rc_string a string to parse. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_parse_string(rc_string: string): void; /** * A {@link Gtk.RcPropertyParser} for use with `gtk_settings_install_property_parser()` * or `gtk_widget_class_install_style_property_parser()` which parses * borders in the form * `"{ left, right, top, bottom }"` for integers * left, right, top and bottom. * @param pspec a {@link GObject.ParamSpec} * @param gstring the {@link GLib.String} to be parsed * @param property_value a {@link GObject.Value} which must hold boxed values. * @returns `true` if `gstring` could be parsed and `property_value` has been set to the resulting {@link Gtk.Border}. */ function rc_property_parse_border(pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any): boolean; /** * A {@link Gtk.RcPropertyParser} for use with `gtk_settings_install_property_parser()` * or `gtk_widget_class_install_style_property_parser()` which parses a * color given either by its name or in the form * `{ red, green, blue }` where red, green and * blue are integers between 0 and 65535 or floating-point numbers * between 0 and 1. * @param pspec a {@link GObject.ParamSpec} * @param gstring the {@link GLib.String} to be parsed * @param property_value a {@link GObject.Value} which must hold {@link Gdk.Color} values. * @returns `true` if `gstring` could be parsed and `property_value` has been set to the resulting {@link Gdk.Color}. */ function rc_property_parse_color(pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any): boolean; /** * A {@link Gtk.RcPropertyParser} for use with `gtk_settings_install_property_parser()` * or `gtk_widget_class_install_style_property_parser()` which parses a single * enumeration value. * * The enumeration value can be specified by its name, its nickname or * its numeric value. For consistency with flags parsing, the value * may be surrounded by parentheses. * @param pspec a {@link GObject.ParamSpec} * @param gstring the {@link GLib.String} to be parsed * @param property_value a {@link GObject.Value} which must hold enum values. * @returns `true` if `gstring` could be parsed and `property_value` has been set to the resulting {@link GObject.EnumValue}. */ function rc_property_parse_enum(pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any): boolean; /** * A {@link Gtk.RcPropertyParser} for use with `gtk_settings_install_property_parser()` * or `gtk_widget_class_install_style_property_parser()` which parses flags. * * Flags can be specified by their name, their nickname or * numerically. Multiple flags can be specified in the form * `"( flag1 | flag2 | ... )"`. * @param pspec a {@link GObject.ParamSpec} * @param gstring the {@link GLib.String} to be parsed * @param property_value a {@link GObject.Value} which must hold flags values. * @returns `true` if `gstring` could be parsed and `property_value` has been set to the resulting flags value. */ function rc_property_parse_flags(pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any): boolean; /** * A {@link Gtk.RcPropertyParser} for use with `gtk_settings_install_property_parser()` * or `gtk_widget_class_install_style_property_parser()` which parses a * requisition in the form * `"{ width, height }"` for integers %width and %height. * @param pspec a {@link GObject.ParamSpec} * @param gstring the {@link GLib.String} to be parsed * @param property_value a {@link GObject.Value} which must hold boxed values. * @returns `true` if `gstring` could be parsed and `property_value` has been set to the resulting {@link Gtk.Requisition}. */ function rc_property_parse_requisition(pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any): boolean; /** * If the modification time on any previously read file for the * default {@link Gtk.Settings} has changed, discard all style information * and then reread all previously read RC files. * @returns `true` if the files were reread. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_reparse_all(): boolean; /** * If the modification time on any previously read file * for the given {@link Gtk.Settings} has changed, discard all style information * and then reread all previously read RC files. * @param settings a {@link Gtk.Settings} * @param force_load load whether or not anything changed * @returns `true` if the files were reread. * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_reparse_all_for_settings(settings: Settings, force_load: boolean): boolean; /** * This function recomputes the styles for all widgets that use a * particular {@link Gtk.Settings} object. (There is one {@link Gtk.Settings} object * per {@link Gdk.Screen}, see `gtk_settings_get_for_screen()`); It is useful * when some global parameter has changed that affects the appearance * of all widgets, because when a widget gets a new style, it will * both redraw and recompute any cached information about its * appearance. As an example, it is used when the default font size * set by the operating system changes. Note that this function * doesn’t affect widgets that have a style set explicitly on them * with `gtk_widget_set_style()`. * @param settings a {@link Gtk.Settings} * @since 2.4 * @deprecated since 3.0: Use {@link Gtk.CssProvider} instead. */ function rc_reset_styles(settings: Settings): void; /** * Sets the list of files that GTK+ will read at the * end of `gtk_init()`. * @param filenames A `null`-terminated list of filenames. * @deprecated since 3.0: Use {@link Gtk.StyleContext} with a custom {@link Gtk.StyleProvider} instead */ function rc_set_default_files(filenames: string[]): void; function recent_chooser_error_quark(): GLib.Quark; function recent_manager_error_quark(): GLib.Quark; /** * Renders an activity indicator (such as in {@link Gtk.Spinner}). * The state {@link Gtk.StateFlags.CHECKED} determines whether there is * activity going on. * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.0 */ function render_activity(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders an arrow pointing to `angle`. * * Typical arrow rendering at 0, 1⁄2 π;, π; and 3⁄2 π: * * ![](arrows.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param angle arrow angle from 0 to 2 * `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 * @since 3.0 */ function render_arrow(context: StyleContext, cr: cairo.Context, angle: number, x: number, y: number, size: number): void; /** * Renders the background of an element. * * Typical background rendering, showing the effect of * `background-image`, `border-width` and `border-radius`: * * ![](background.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.0 */ function render_background(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Returns the area that will be affected (i.e. drawn to) when * calling `gtk_render_background()` for the given `context` and * rectangle. * @param context a {@link Gtk.StyleContext} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.20 */ function render_background_get_clip(context: StyleContext, x: number, y: number, width: number, height: number): Gdk.Rectangle; /** * Renders a checkmark (as in a {@link Gtk.CheckButton}). * * The {@link Gtk.StateFlags.CHECKED} state determines whether the check is * on or off, and {@link Gtk.StateFlags.INCONSISTENT} determines whether it * should be marked as undefined. * * Typical checkmark rendering: * * ![](checks.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.0 */ function render_check(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders an expander (as used in {@link Gtk.TreeView} and {@link Gtk.Expander}) in the area * defined by `x`, `y`, `width`, `height`. The state {@link Gtk.StateFlags.CHECKED} * determines whether the expander is collapsed or expanded. * * Typical expander rendering: * * ![](expanders.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.0 */ function render_expander(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders a extension (as in a {@link Gtk.Notebook} tab) in the rectangle * defined by `x`, `y`, `width`, `height`. The side where the extension * connects to is defined by `gap_side`. * * Typical extension rendering: * * ![](extensions.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @param gap_side side where the gap is * @since 3.0 */ function render_extension(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number, gap_side: PositionType): void; /** * Renders a focus indicator on the rectangle determined by `x`, `y`, `width`, `height`. * * Typical focus rendering: * * ![](focus.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.0 */ function render_focus(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders a frame around the rectangle defined by `x`, `y`, `width`, `height`. * * Examples of frame rendering, showing the effect of `border-image`, * `border-color`, `border-width`, `border-radius` and junctions: * * ![](frames.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.0 */ function render_frame(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders a frame around the rectangle defined by (`x`, `y`, `width`, `height`), * leaving a gap on one side. `xy0_gap` and `xy1_gap` will mean X coordinates * for {@link Gtk.PositionType.TOP} and {@link Gtk.PositionType.BOTTOM} gap sides, and Y coordinates for * {@link Gtk.PositionType.LEFT} and {@link Gtk.PositionType.RIGHT}. * * Typical rendering of a frame with a gap: * * ![](frame-gap.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @param gap_side side where the gap is * @param xy0_gap initial coordinate (X or Y depending on `gap_side`) for the gap * @param xy1_gap end coordinate (X or Y depending on `gap_side`) for the gap * @since 3.0 * @deprecated since 3.24: Use `gtk_render_frame()` instead. Themes can create gaps by omitting borders via CSS. */ function render_frame_gap(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number, gap_side: PositionType, xy0_gap: number, xy1_gap: number): void; /** * Renders a handle (as in {@link Gtk.HandleBox}, {@link Gtk.Paned} and * {@link Gtk.Window}’s resize grip), in the rectangle * determined by `x`, `y`, `width`, `height`. * * Handles rendered for the paned and grip classes: * * ![](handles.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.0 */ function render_handle(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders the icon in `pixbuf` at the specified `x` and `y` coordinates. * * This function will render the icon in `pixbuf` at exactly its size, * regardless of scaling factors, which may not be appropriate when * drawing on displays with high pixel densities. * * You probably want to use `gtk_render_icon_surface()` instead, if you * already have a Cairo surface. * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param pixbuf a {@link GdkPixbuf.Pixbuf} containing the icon to draw * @param x X position for the `pixbuf` * @param y Y position for the `pixbuf` * @since 3.2 */ function render_icon(context: StyleContext, cr: cairo.Context, pixbuf: GdkPixbuf.Pixbuf, x: number, y: number): void; /** * Renders the icon specified by `source` at the given `size`, returning the result * in a pixbuf. * @param context a {@link Gtk.StyleContext} * @param source the {@link Gtk.IconSource} specifying the icon to render * @param size the size ({@link Gtk.IconSize}) to render the icon at. A size of `(GtkIconSize) -1` means render at the size of the source and don’t scale. * @returns a newly-created {@link GdkPixbuf.Pixbuf} containing the rendered icon * @since 3.0 * @deprecated since 3.10: Use `gtk_icon_theme_load_icon()` instead. */ function render_icon_pixbuf(context: StyleContext, source: IconSource, size: number): GdkPixbuf.Pixbuf; /** * Renders the icon in `surface` at the specified `x` and `y` coordinates. * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param surface a {@link cairo.Surface} containing the icon to draw * @param x X position for the `icon` * @param y Y position for the `incon` * @since 3.10 */ function render_icon_surface(context: StyleContext, cr: cairo.Context, surface: cairo.Surface, x: number, y: number): void; /** * Draws a text caret on `cr` at the specified index of `layout`. * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin * @param y Y origin * @param layout the {@link Pango.Layout} of the text * @param index the index in the {@link Pango.Layout} * @param direction the {@link Pango.Direction} of the text * @since 3.4 */ function render_insertion_cursor(context: StyleContext, cr: cairo.Context, x: number, y: number, layout: Pango.Layout, index: number, direction: Pango.Direction): void; /** * Renders `layout` on the coordinates `x`, `y` * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin * @param y Y origin * @param layout the {@link Pango.Layout} to render * @since 3.0 */ function render_layout(context: StyleContext, cr: cairo.Context, x: number, y: number, layout: Pango.Layout): void; /** * Renders a line from (x0, y0) to (x1, y1). * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @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 * @since 3.0 */ function render_line(context: StyleContext, cr: cairo.Context, x0: number, y0: number, x1: number, y1: number): void; /** * Renders an option mark (as in a {@link Gtk.RadioButton}), the {@link Gtk.StateFlags.CHECKED} * state will determine whether the option is on or off, and * {@link Gtk.StateFlags.INCONSISTENT} whether it should be marked as undefined. * * Typical option mark rendering: * * ![](options.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @since 3.0 */ function render_option(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders a slider (as in {@link Gtk.Scale}) in the rectangle defined by `x`, `y`, * `width`, `height`. `orientation` defines whether the slider is vertical * or horizontal. * * Typical slider rendering: * * ![](sliders.png) * @param context a {@link Gtk.StyleContext} * @param cr a {@link cairo.Context} * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @param orientation orientation of the slider * @since 3.0 */ function render_slider(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number, orientation: Orientation): void; /** * 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 * @since 2.14 */ function rgb_to_hsv(r: number, g: number, b: number): [number, number, number]; /** * Appends a specified target to the list of supported targets for a * given widget and selection. * @param widget a {@link Gtk.Widget} * @param selection the selection * @param target target to add. * @param info A unsigned integer which will be passed back to the application. */ function selection_add_target(widget: Widget, selection: Gdk.Atom, target: Gdk.Atom, info: number): void; /** * Prepends a table of targets to the list of supported targets * for a given widget and selection. * @param widget a {@link Gtk.Widget} * @param selection the selection * @param targets a table of targets to add */ function selection_add_targets(widget: Widget, selection: Gdk.Atom, targets: TargetEntry[]): void; /** * Remove all targets registered for the given selection for the * widget. * @param widget a {@link Gtk.Widget} * @param selection an atom representing a selection */ function selection_clear_targets(widget: Widget, selection: Gdk.Atom): void; /** * Requests the contents of a selection. When received, * a “selection-received” signal will be generated. * @param widget The widget which acts as requestor * @param selection Which selection to get * @param target Form of information desired (e.g., STRING) * @param time_ Time of request (usually of triggering event) In emergency, you could use #GDK_CURRENT_TIME * @returns `true` if requested succeeded. `false` if we could not process request. (e.g., there was already a request in process for this widget). */ function selection_convert(widget: Widget, selection: Gdk.Atom, target: Gdk.Atom, time_: number): boolean; /** * Claims ownership of a given selection for a particular widget, * or, if `widget` is `null`, release ownership of the selection. * @param widget a {@link Gtk.Widget}, or `null`. * @param selection an interned atom representing the selection to claim * @param time_ timestamp with which to claim the selection * @returns `true` if the operation succeeded */ function selection_owner_set(widget: Widget | null, selection: Gdk.Atom, time_: number): boolean; /** * Claim ownership of a given selection for a particular widget, or, * if `widget` is `null`, release ownership of the selection. * @param display the {@link Gdk.Display} where the selection is set * @param widget new selection owner (a {@link Gtk.Widget}), or `null`. * @param selection an interned atom representing the selection to claim. * @param time_ timestamp with which to claim the selection * @returns TRUE if the operation succeeded * @since 2.2 */ function selection_owner_set_for_display(display: Gdk.Display, widget: Widget | null, selection: Gdk.Atom, time_: number): boolean; /** * Removes all handlers and unsets ownership of all * selections for a widget. Called when widget is being * destroyed. This function will not generally be * called by applications. * @param widget a {@link Gtk.Widget} */ function selection_remove_all(widget: Widget): void; /** * Sets the GTK+ debug flags. * @param flags */ function set_debug_flags(flags: number): void; /** * A convenience function for launching the default application * to show the uri. Like `gtk_show_uri_on_window()`, but takes a screen * as transient parent instead of a window. * * Note that this function is deprecated as it does not pass the necessary * information for helpers to parent their dialog properly, when run from * sandboxed applications for example. * @param screen screen to show the uri on or `null` for the default screen * @param uri the uri to show * @param timestamp a timestamp to prevent focus stealing * @returns `true` on success, `false` on error * @since 2.14 * @deprecated since 3.22: Use `gtk_show_uri_on_window()` instead. */ function show_uri(screen: Gdk.Screen | null, uri: string, timestamp: number): boolean; /** * This is a convenience function for launching the default application * to show the uri. The uri must be of a form understood by GIO (i.e. you * need to install gvfs to get support for uri schemes such as http:// * or ftp://, as only local files are handled by GIO itself). * Typical examples are * - `file:///home/gnome/pict.jpg` * - `http://www.gnome.org` * - `mailto:me@gnome.org` * * Ideally the timestamp is taken from the event triggering * the `gtk_show_uri()` call. If timestamp is not known you can take * `GDK_CURRENT_TIME`. * * 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 a timestamp to prevent focus stealing * @returns `true` on success, `false` on error * @since 3.22 */ function show_uri_on_window(parent: Window | null, uri: string, timestamp: number): boolean; /** * Registers each of the stock items in `items`. If an item already * exists with the same stock ID as one of the `items`, the old item * gets replaced. The stock items are copied, so GTK+ does not hold * any pointer into `items` and `items` can be freed. Use * `gtk_stock_add_static()` if `items` is persistent and GTK+ need not * copy the array. * @param items a {@link Gtk.StockItem} or array of items * @deprecated since 3.10 */ function stock_add(items: StockItem[]): void; /** * Same as `gtk_stock_add()`, but doesn’t copy `items`, so * `items` must persist until application exit. * @param items a {@link Gtk.StockItem} or array of {@link Gtk.StockItem} * @deprecated since 3.10 */ function stock_add_static(items: StockItem[]): void; /** * Retrieves a list of all known stock IDs added to a {@link Gtk.IconFactory} * or registered with `gtk_stock_add()`. The list must be freed with `g_slist_free()`, * and each string in the list must be freed with `g_free()`. * @returns a list of known stock IDs * @deprecated since 3.10 */ function stock_list_ids(): string[]; /** * Fills `item` with the registered values for `stock_id`, returning `true` * if `stock_id` was known. * @param stock_id a stock item name * @returns `true` if `item` was initialized * @deprecated since 3.10 */ function stock_lookup(stock_id: string): [boolean, StockItem]; /** * Sets a function to be used for translating the `label` of * a stock item. * * If no function is registered for a translation domain, * `g_dgettext()` is used. * * The function is used for all stock items whose * `translation_domain` matches `domain`. Note that it is possible * to use strings different from the actual gettext translation domain * of your application for this, as long as your {@link Gtk.TranslateFunc} uses * the correct domain when calling `dgettext()`. This can be useful, e.g. * when dealing with message contexts: * * * ```c * GtkStockItem items[] = { * { MY_ITEM1, NC_("odd items", "Item 1"), 0, 0, "odd-item-domain" }, * { MY_ITEM2, NC_("even items", "Item 2"), 0, 0, "even-item-domain" }, * }; * * gchar * * my_translate_func (const gchar *msgid, * gpointer data) * { * gchar *msgctxt = data; * * return (gchar*)g_dpgettext2 (GETTEXT_PACKAGE, msgctxt, msgid); * } * * ... * * gtk_stock_add (items, G_N_ELEMENTS (items)); * gtk_stock_set_translate_func ("odd-item-domain", my_translate_func, "odd items"); * gtk_stock_set_translate_func ("even-item-domain", my_translate_func, "even items"); * ``` * * @param domain the translation domain for which `func` shall be used * @param func a {@link Gtk.TranslateFunc} * @since 2.8 * @deprecated since 3.10 */ function stock_set_translate_func(domain: string, func: TranslateFunc): void; /** * This function frees a target table as returned by * `gtk_target_table_new_from_list()` * @param targets a {@link Gtk.TargetEntry} array * @since 2.10 */ function target_table_free(targets: TargetEntry[]): void; /** * This function creates an {@link Gtk.TargetEntry} array that contains the * same targets as the passed %list. The returned table is newly * allocated and should be freed using `gtk_target_table_free()` when no * longer needed. * @param list a {@link Gtk.TargetList} * @returns the new table. * @since 2.10 */ function target_table_new_from_list(list: TargetList): TargetEntry[]; /** * Determines if any of the targets in `targets` can be used to * provide a {@link GdkPixbuf.Pixbuf}. * @param targets an array of `GdkAtoms` * @param writable whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format * @returns `true` if `targets` include a suitable target for images, otherwise `false`. * @since 2.10 */ function targets_include_image(targets: Gdk.Atom[], writable: boolean): boolean; /** * Determines if any of the targets in `targets` can be used to * provide rich text. * @param targets an array of `GdkAtoms` * @param buffer a {@link Gtk.TextBuffer} * @returns `true` if `targets` include a suitable target for rich text, otherwise `false`. * @since 2.10 */ function targets_include_rich_text(targets: Gdk.Atom[], buffer: TextBuffer): boolean; /** * Determines if any of the targets in `targets` can be used to * provide text. * @param targets an array of `GdkAtoms` * @returns `true` if `targets` include a suitable target for text, otherwise `false`. * @since 2.10 */ function targets_include_text(targets: Gdk.Atom[]): boolean; /** * Determines if any of the targets in `targets` can be used to * provide an uri list. * @param targets an array of `GdkAtoms` * @returns `true` if `targets` include a suitable target for uri lists, otherwise `false`. * @since 2.10 */ function targets_include_uri(targets: Gdk.Atom[]): boolean; /** * Create a simple window with window title `window_title` and * text contents `dialog_text`. * The window will quit any running `gtk_main()`-loop when destroyed, and it * will automatically be destroyed upon test function teardown. * @param window_title Title of the window to be displayed. * @param dialog_text Text inside the window to be displayed. * @returns a widget pointer to the newly created GtkWindow. * @since 2.14 * @deprecated since 3.20: This testing infrastructure is phased out in favor of reftests. */ function test_create_simple_window(window_title: string, dialog_text: string): Widget; /** * This function will search `widget` and all its descendants for a GtkLabel * widget with a text string matching `label_pattern`. * The `label_pattern` may contain asterisks “*” and question marks “?” as * placeholders, `g_pattern_match()` is used for the matching. * Note that locales other than "C“ tend to alter (translate” label strings, * so this function is genrally only useful in test programs with * predetermined locales, see `gtk_test_init()` for more details. * @param widget Valid label or container widget. * @param label_pattern Shell-glob pattern to match a label string. * @returns a GtkLabel widget if any is found. * @since 2.14 */ function test_find_label(widget: Widget, label_pattern: string): Widget; /** * This function will search siblings of `base_widget` and siblings of its * ancestors for all widgets matching `widget_type`. * Of the matching widgets, the one that is geometrically closest to * `base_widget` will be returned. * The general purpose of this function is to find the most likely “action” * widget, relative to another labeling widget. Such as finding a * button or text entry widget, given its corresponding label widget. * @param base_widget Valid widget, part of a widget hierarchy * @param widget_type Type of a aearched for sibling widget * @returns a widget of type `widget_type` if any is found. * @since 2.14 */ function test_find_sibling(base_widget: Widget, widget_type: GObject.GType): Widget; /** * This function will search the descendants of `widget` for a widget * of type `widget_type` that has a label matching `label_pattern` next * to it. This is most useful for automated GUI testing, e.g. to find * the “OK” button in a dialog and synthesize clicks on it. * However see `gtk_test_find_label()`, `gtk_test_find_sibling()` and * `gtk_test_widget_click()` for possible caveats involving the search of * such widgets and synthesizing widget events. * @param widget Container widget, usually a GtkWindow. * @param label_pattern Shell-glob pattern to match a label string. * @param widget_type Type of a aearched for label sibling widget. * @returns a valid widget if any is found or `null`. * @since 2.14 */ function test_find_widget(widget: Widget, label_pattern: string, widget_type: GObject.GType): Widget | null; /** * Return the type ids that have been registered after * calling `gtk_test_register_all_types()`. * @returns 0-terminated array of type ids * @since 2.14 */ function test_list_all_types(): GObject.GType[]; /** * Force registration of all core Gtk+ and Gdk object types. * This allowes to refer to any of those object types via * `g_type_from_name()` after calling this function. * @since 2.14 */ function test_register_all_types(): void; /** * Retrive the literal adjustment value for GtkRange based * widgets and spin buttons. Note that the value returned by * this function is anything between the lower and upper bounds * of the adjustment belonging to `widget`, and is not a percentage * as passed in to `gtk_test_slider_set_perc()`. * @param widget valid widget pointer. * @returns gtk_adjustment_get_value (adjustment) for an adjustment belonging to `widget`. * @since 2.14 * @deprecated since 3.20: This testing infrastructure is phased out in favor of reftests. */ function test_slider_get_value(widget: Widget): number; /** * This function will adjust the slider position of all GtkRange * based widgets, such as scrollbars or scales, it’ll also adjust * spin buttons. The adjustment value of these widgets is set to * a value between the lower and upper limits, according to the * `percentage` argument. * @param widget valid widget pointer. * @param percentage value between 0 and 100. * @since 2.14 * @deprecated since 3.20: This testing infrastructure is phased out in favor of reftests. */ function test_slider_set_perc(widget: Widget, percentage: number): void; /** * This function will generate a `button` click in the upwards or downwards * spin button arrow areas, usually leading to an increase or decrease of * spin button’s value. * @param spinner valid GtkSpinButton widget. * @param button Number of the pointer button for the event, usually 1, 2 or 3. * @param upwards `true` for upwards arrow click, `false` for downwards arrow click. * @returns whether all actions neccessary for the button click simulation were carried out successfully. * @since 2.14 * @deprecated since 3.20: This testing infrastructure is phased out in favor of reftests. */ function test_spin_button_click(spinner: SpinButton, button: number, upwards: boolean): boolean; /** * Retrive the text string of `widget` if it is a GtkLabel, * GtkEditable (entry and text widgets) or GtkTextView. * @param widget valid widget pointer. * @returns new 0-terminated C string, needs to be released with `g_free()`. * @since 2.14 * @deprecated since 3.20: This testing infrastructure is phased out in favor of reftests. */ function test_text_get(widget: Widget): string; /** * Set the text string of `widget` to `string` if it is a GtkLabel, * GtkEditable (entry and text widgets) or GtkTextView. * @param widget valid widget pointer. * @param string a 0-terminated C string * @since 2.14 * @deprecated since 3.20: This testing infrastructure is phased out in favor of reftests. */ function test_text_set(widget: Widget, string: string): void; /** * This function will generate a `button` click (button press and button * release event) in the middle of the first GdkWindow found that belongs * to `widget`. * For windowless widgets like {@link Gtk.Button} (which returns `false` from * `gtk_widget_get_has_window()`), this will often be an * input-only event window. For other widgets, this is usually widget->window. * Certain caveats should be considered when using this function, in * particular because the mouse pointer is warped to the button click * location, see `gdk_test_simulate_button()` for details. * @param widget Widget to generate a button click on. * @param button Number of the pointer button for the event, usually 1, 2 or 3. * @param modifiers Keyboard modifiers the event is setup with. * @returns whether all actions neccessary for the button click simulation were carried out successfully. * @since 2.14 * @deprecated since 3.20: This testing infrastructure is phased out in favor of reftests. */ function test_widget_click(widget: Widget, button: number, modifiers: Gdk.ModifierType): boolean; /** * This function will generate keyboard press and release events in * the middle of the first GdkWindow found that belongs to `widget`. * For windowless widgets like {@link Gtk.Button} (which returns `false` from * `gtk_widget_get_has_window()`), this will often be an * input-only event window. For other widgets, this is usually widget->window. * Certain caveats should be considered when using this function, in * particular because the mouse pointer is warped to the key press * location, see `gdk_test_simulate_key()` for details. * @param widget Widget to generate a key press and release on. * @param keyval A Gdk keyboard value. * @param modifiers Keyboard modifiers the event is setup with. * @returns whether all actions neccessary for the key event simulation were carried out successfully. * @since 2.14 */ function test_widget_send_key(widget: Widget, keyval: number, modifiers: Gdk.ModifierType): boolean; /** * Enters the main loop and waits for `widget` to be “drawn”. In this * context that means it waits for the frame clock of `widget` to have * run a full styling, layout and drawing cycle. * * This function is intended to be used for syncing with actions that * depend on `widget` relayouting or on interaction with the display * server. * @param widget the widget to wait for * @since 3.10 */ function test_widget_wait_for_draw(widget: Widget): void; /** * Obtains a `tree_model` and `path` from selection data of target type * `GTK_TREE_MODEL_ROW`. Normally called from a drag_data_received handler. * This function can only be used if `selection_data` originates from the same * process that’s calling this function, because a pointer to the tree model * is being passed around. If you aren’t in the same process, then you'll * get memory corruption. In the {@link Gtk.TreeDragDest} drag_data_received handler, * you can assume that selection data of type `GTK_TREE_MODEL_ROW` is * in from the current process. The returned path must be freed with * `gtk_tree_path_free()`. * @param selection_data a {@link Gtk.SelectionData} * @returns `true` if `selection_data` had target type `GTK_TREE_MODEL_ROW` and is otherwise valid */ function tree_get_row_drag_data(selection_data: SelectionData): [boolean, TreeModel | null, TreePath | null]; /** * Lets a set of row reference created by * `gtk_tree_row_reference_new_proxy()` know that the * model emitted the {@link Gtk.TreeModel.SignalSignatures.row_deleted | Gtk.TreeModel::row-deleted} signal. * @param proxy a {@link GObject.Object} * @param path the path position that was deleted */ function tree_row_reference_deleted(proxy: GObject.Object, path: TreePath): void; /** * Lets a set of row reference created by * `gtk_tree_row_reference_new_proxy()` know that the * model emitted the {@link Gtk.TreeModel.SignalSignatures.row_inserted | Gtk.TreeModel::row-inserted} signal. * @param proxy a {@link GObject.Object} * @param path the row position that was inserted */ function tree_row_reference_inserted(proxy: GObject.Object, path: TreePath): void; /** * Sets selection data of target type `GTK_TREE_MODEL_ROW`. Normally used * in a drag_data_get handler. * @param selection_data some {@link Gtk.SelectionData} * @param tree_model a {@link Gtk.TreeModel} * @param path a row in `tree_model` * @returns `true` if the {@link Gtk.SelectionData} had the proper target type to allow us to set a tree row */ function tree_set_row_drag_data(selection_data: SelectionData, tree_model: TreeModel, path: TreePath): boolean; /** * All this function does it to return `true`. * * This can be useful for example if you want to inhibit the deletion * of a window. Of course you should not do this as the user expects * a reaction from clicking the close icon of the window... * * ## A persistent window * * * ```c * #include * * int * main (int argc, char **argv) * { * GtkWidget *win, *but; * const char *text = "Close yourself. I mean it!"; * * gtk_init (&argc, &argv); * * win = gtk_window_new (GTK_WINDOW_TOPLEVEL); * g_signal_connect (win, * "delete-event", * G_CALLBACK (gtk_true), * NULL); * g_signal_connect (win, "destroy", * G_CALLBACK (gtk_main_quit), * NULL); * * but = gtk_button_new_with_label (text); * g_signal_connect_swapped (but, "clicked", * G_CALLBACK (gtk_object_destroy), * win); * gtk_container_add (GTK_CONTAINER (win), but); * * gtk_widget_show_all (win); * * gtk_main (); * * return 0; * } * ``` * * @returns `true` */ function __true(): boolean; /** * @gir-type Callback */ interface AccelGroupActivate { (accel_group: AccelGroup, acceleratable: A, keyval: number, modifier: Gdk.ModifierType): boolean; } /** * @gir-type Callback */ interface AccelGroupFindFunc { (key: AccelKey, closure: GObject.Closure): boolean; } /** * @gir-type Callback */ interface AccelMapForeach { (data: null, accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType, changed: boolean): void; } /** * @gir-type Callback */ interface AssistantPageFunc { (current_page: number): number; } /** * @gir-type Callback */ interface BuilderConnectFunc { (builder: Builder, object: A, signal_name: string, handler_name: string, connect_object: B | null, flags: GObject.ConnectFlags): void; } /** * @gir-type Callback */ interface CalendarDetailFunc { (calendar: Calendar, year: number, month: number, day: number): string | null; } /** * @gir-type Callback */ interface Callback { (widget: Widget): void; } /** * @gir-type Callback */ interface CellAllocCallback { (renderer: CellRenderer, cell_area: Gdk.Rectangle, cell_background: Gdk.Rectangle): boolean; } /** * @gir-type Callback */ interface CellCallback { (renderer: CellRenderer): boolean; } /** * @gir-type Callback */ interface CellLayoutDataFunc { (cell_layout: CellLayout, cell: CellRenderer, tree_model: TreeModel, iter: TreeIter): void; } /** * @gir-type Callback */ interface ClipboardClearFunc { (clipboard: Clipboard, user_data_or_owner: null): void; } /** * @gir-type Callback */ interface ClipboardGetFunc { (clipboard: Clipboard, selection_data: SelectionData, info: number, user_data_or_owner: null): void; } /** * @gir-type Callback */ interface ClipboardImageReceivedFunc { (clipboard: Clipboard, pixbuf: GdkPixbuf.Pixbuf): void; } /** * @gir-type Callback */ interface ClipboardReceivedFunc { (clipboard: Clipboard, selection_data: SelectionData): void; } /** * @gir-type Callback */ interface ClipboardRichTextReceivedFunc { (clipboard: Clipboard, format: Gdk.Atom, text: string | null, length: number): void; } /** * @gir-type Callback */ interface ClipboardTargetsReceivedFunc { (clipboard: Clipboard, atoms: Gdk.Atom[] | null): void; } /** * @gir-type Callback */ interface ClipboardTextReceivedFunc { (clipboard: Clipboard, text: string | null): void; } /** * @gir-type Callback */ interface ClipboardURIReceivedFunc { (clipboard: Clipboard, uris: string[]): void; } /** * @gir-type Callback */ interface ColorSelectionChangePaletteFunc { (colors: Gdk.Color[]): void; } /** * @gir-type Callback */ interface ColorSelectionChangePaletteWithScreenFunc { (screen: Gdk.Screen, colors: Gdk.Color[]): void; } /** * @gir-type Callback */ interface EntryCompletionMatchFunc { (completion: EntryCompletion, key: string, iter: TreeIter): boolean; } /** * @gir-type Callback */ interface FileFilterFunc { (filter_info: FileFilterInfo): boolean; } /** * @gir-type Callback */ interface FlowBoxCreateWidgetFunc { (item: A): Widget; } /** * @gir-type Callback */ interface FlowBoxFilterFunc { (child: FlowBoxChild): boolean; } /** * @gir-type Callback */ interface FlowBoxForeachFunc { (box: FlowBox, child: FlowBoxChild): void; } /** * @gir-type Callback */ interface FlowBoxSortFunc { (child1: FlowBoxChild, child2: FlowBoxChild): number; } /** * @gir-type Callback */ interface FontFilterFunc { (family: Pango.FontFamily, face: Pango.FontFace): boolean; } /** * @gir-type Callback */ interface IconViewForeachFunc { (icon_view: IconView, path: TreePath): void; } /** * @gir-type Callback */ interface KeySnoopFunc { (grab_widget: Widget, event: Gdk.EventKey): number; } /** * @gir-type Callback */ interface ListBoxCreateWidgetFunc { (item: A): Widget; } /** * @gir-type Callback */ interface ListBoxFilterFunc { (row: ListBoxRow): boolean; } /** * @gir-type Callback */ interface ListBoxForeachFunc { (box: ListBox, row: ListBoxRow): void; } /** * @gir-type Callback */ interface ListBoxSortFunc { (row1: ListBoxRow, row2: ListBoxRow): number; } /** * @gir-type Callback */ interface ListBoxUpdateHeaderFunc { (row: ListBoxRow, before: ListBoxRow | null): void; } /** * @gir-type Callback */ interface MenuDetachFunc { (attach_widget: Widget, menu: Menu): void; } /** * @gir-type Callback */ interface MenuPositionFunc { (menu: Menu, x: number, y: number): void; } /** * @gir-type Callback */ interface ModuleDisplayInitFunc { (display: Gdk.Display): void; } /** * @gir-type Callback */ interface ModuleInitFunc { (argv: string[] | null): void; } /** * @gir-type Callback */ interface PageSetupDoneFunc { (page_setup: PageSetup): void; } /** * @gir-type Callback */ interface PrintSettingsFunc { (key: string, value: string): void; } /** * @gir-type Callback */ interface RcPropertyParser { (pspec: GObject.ParamSpec, rc_string: GLib.String, property_value: unknown): boolean; } /** * @gir-type Callback */ interface RecentFilterFunc { (filter_info: RecentFilterInfo): boolean; } /** * @gir-type Callback */ interface RecentSortFunc { (a: RecentInfo, b: RecentInfo): number; } /** * @gir-type Callback */ interface StylePropertyParser { (string: string, value: unknown): boolean; } /** * @gir-type Callback */ interface TextBufferDeserializeFunc { (register_buffer: TextBuffer, content_buffer: TextBuffer, iter: TextIter, data: Uint8Array, create_tags: boolean): boolean; } /** * @gir-type Callback */ interface TextBufferSerializeFunc { (register_buffer: TextBuffer, content_buffer: TextBuffer, start: TextIter, end: TextIter): Uint8Array | null; } /** * @gir-type Callback */ interface TextCharPredicate { (ch: string): boolean; } /** * @gir-type Callback */ interface TextTagTableForeach { (tag: TextTag): void; } /** * @gir-type Callback */ interface TickCallback { (widget: Widget, frame_clock: Gdk.FrameClock): boolean; } /** * @gir-type Callback */ interface TranslateFunc { (path: string): string; } /** * @gir-type Callback */ interface TreeCellDataFunc { (tree_column: TreeViewColumn, cell: CellRenderer, tree_model: TreeModel, iter: TreeIter): void; } /** * @gir-type Callback */ interface TreeDestroyCountFunc { (tree_view: TreeView, path: TreePath, children: number): void; } /** * @gir-type Callback */ interface TreeIterCompareFunc { (model: TreeModel, a: TreeIter, b: TreeIter): number; } /** * @gir-type Callback */ interface TreeModelFilterModifyFunc { (model: TreeModel, iter: TreeIter, column: number): void; } /** * @gir-type Callback */ interface TreeModelFilterVisibleFunc { (model: TreeModel, iter: TreeIter): boolean; } /** * @gir-type Callback */ interface TreeModelForeachFunc { (model: TreeModel, path: TreePath, iter: TreeIter): boolean; } /** * @gir-type Callback */ interface TreeSelectionForeachFunc { (model: TreeModel, path: TreePath, iter: TreeIter): void; } /** * @gir-type Callback */ interface TreeSelectionFunc { (selection: TreeSelection, model: TreeModel, path: TreePath, path_currently_selected: boolean): boolean; } /** * @gir-type Callback */ interface TreeViewColumnDropFunc { (tree_view: TreeView, column: TreeViewColumn, prev_column: TreeViewColumn, next_column: TreeViewColumn): boolean; } /** * @gir-type Callback */ interface TreeViewMappingFunc { (tree_view: TreeView, path: TreePath): void; } /** * @gir-type Callback */ interface TreeViewRowSeparatorFunc { (model: TreeModel, iter: TreeIter): boolean; } /** * @gir-type Callback */ interface TreeViewSearchEqualFunc { (model: TreeModel, column: number, key: string, iter: TreeIter): boolean; } /** * @gir-type Callback */ interface TreeViewSearchPositionFunc { (tree_view: TreeView, search_dialog: Widget): void; } /** * @gir-type Flags */ export namespace AccelFlags { export const $gtype: GObject.GType; } /** * Accelerator flags used with `gtk_accel_group_connect()`. * @gir-type Flags */ enum AccelFlags { /** * Accelerator is visible */ VISIBLE, /** * Accelerator not removable */ LOCKED, /** * Mask */ MASK, } /** * @gir-type Flags */ export namespace ApplicationInhibitFlags { export const $gtype: GObject.GType; } /** * Types of user actions that may be blocked by `gtk_application_inhibit()`. * @gir-type Flags * @since 3.4 */ enum ApplicationInhibitFlags { /** * Inhibit ending the user session * by logging out or by shutting down the computer */ LOGOUT, /** * Inhibit user switching */ SWITCH, /** * Inhibit suspending the * session or computer */ SUSPEND, /** * Inhibit the session being * marked as idle (and possibly locked) */ IDLE, } /** * @gir-type Flags */ export namespace AttachOptions { export const $gtype: GObject.GType; } /** * Denotes the expansion properties that a widget will have when it (or its * parent) is resized. * @gir-type Flags */ enum AttachOptions { /** * the widget should expand to take up any extra space in its * container that has been allocated. */ EXPAND, /** * the widget should shrink as and when possible. */ SHRINK, /** * the widget should fill the space allocated to it. */ FILL, } /** * @gir-type Flags */ export namespace CalendarDisplayOptions { export const $gtype: GObject.GType; } /** * These options can be used to influence the display and behaviour of a {@link Gtk.Calendar}. * @gir-type Flags */ enum CalendarDisplayOptions { /** * Specifies that the month and year should be displayed. */ SHOW_HEADING, /** * Specifies that three letter day descriptions should be present. */ SHOW_DAY_NAMES, /** * Prevents the user from switching months with the calendar. */ NO_MONTH_CHANGE, /** * Displays each week numbers of the current year, down the * left side of the calendar. */ SHOW_WEEK_NUMBERS, /** * Just show an indicator, not the full details * text when details are provided. See `gtk_calendar_set_detail_func()`. */ SHOW_DETAILS, } /** * @gir-type Flags */ export namespace CellRendererState { export const $gtype: GObject.GType; } /** * Tells how a cell is to be rendered. * @gir-type Flags */ enum CellRendererState { /** * The cell is currently selected, and * probably has a selection colored background to render to. */ SELECTED, /** * The mouse is hovering over the cell. */ PRELIT, /** * The cell is drawn in an insensitive manner */ INSENSITIVE, /** * The cell is in a sorted row */ SORTED, /** * The cell is in the focus row. */ FOCUSED, /** * The cell is in a row that can be expanded. Since 3.4 */ EXPANDABLE, /** * The cell is in a row that is expanded. Since 3.4 */ EXPANDED, } /** * @gir-type Flags */ export namespace DebugFlag { export const $gtype: GObject.GType; } /** * @gir-type Flags */ enum DebugFlag { MISC, PLUGSOCKET, TEXT, TREE, UPDATES, KEYBINDINGS, MULTIHEAD, MODULES, GEOMETRY, ICONTHEME, PRINTING, BUILDER, SIZE_REQUEST, NO_CSS_CACHE, BASELINES, PIXEL_CACHE, NO_PIXEL_CACHE, INTERACTIVE, TOUCHSCREEN, ACTIONS, RESIZE, LAYOUT, } /** * @gir-type Flags */ export namespace DestDefaults { export const $gtype: GObject.GType; } /** * The {@link Gtk.DestDefaults} enumeration specifies the various * types of action that will be taken on behalf * of the user for a drag destination site. * @gir-type Flags */ enum DestDefaults { /** * If set for a widget, GTK+, during a drag over this * widget will check if the drag matches this widget’s list of possible targets * and actions. * GTK+ will then call `gdk_drag_status()` as appropriate. */ MOTION, /** * If set for a widget, GTK+ will draw a highlight on * this widget as long as a drag is over this widget and the widget drag format * and action are acceptable. */ HIGHLIGHT, /** * If set for a widget, when a drop occurs, GTK+ will * will check if the drag matches this widget’s list of possible targets and * actions. If so, GTK+ will call `gtk_drag_get_data()` on behalf of the widget. * Whether or not the drop is successful, GTK+ will call `gtk_drag_finish()`. If * the action was a move, then if the drag was successful, then `true` will be * passed for the `delete` parameter to `gtk_drag_finish()`. */ DROP, /** * If set, specifies that all default actions should * be taken. */ ALL, } /** * @gir-type Flags */ export namespace DialogFlags { export const $gtype: GObject.GType; } /** * Flags used to influence dialog construction. * @gir-type Flags */ enum DialogFlags { /** * Make the constructed dialog modal, * see `gtk_window_set_modal()` */ MODAL, /** * Destroy the dialog when its * parent is destroyed, see `gtk_window_set_destroy_with_parent()` */ DESTROY_WITH_PARENT, /** * Create dialog with actions in header * bar instead of action area. Since 3.12. */ USE_HEADER_BAR, } /** * @gir-type Flags */ export namespace EventControllerScrollFlags { export const $gtype: GObject.GType; } /** * Describes the behavior of a {@link Gtk.EventControllerScroll}. * @gir-type Flags * @since 3.24 */ enum EventControllerScrollFlags { /** * Don't emit scroll. */ NONE, /** * Emit scroll with vertical deltas. */ VERTICAL, /** * Emit scroll with horizontal deltas. */ HORIZONTAL, /** * Only emit deltas that are multiples of 1. */ DISCRETE, /** * Emit {@link Gtk.EventControllerScroll.SignalSignatures.decelerate | Gtk.EventControllerScroll::decelerate} * after continuous scroll finishes. */ KINETIC, /** * Emit scroll on both axes. */ BOTH_AXES, } /** * @gir-type Flags */ export namespace FileFilterFlags { export const $gtype: GObject.GType; } /** * These flags indicate what parts of a {@link Gtk.FileFilterInfo} struct * are filled or need to be filled. * @gir-type Flags */ enum FileFilterFlags { /** * the filename of the file being tested */ FILENAME, /** * the URI for the file being tested */ URI, /** * the string that will be used to * display the file in the file chooser */ DISPLAY_NAME, /** * the mime type of the file */ MIME_TYPE, } /** * @gir-type Flags */ export namespace FontChooserLevel { export const $gtype: GObject.GType; } /** * This enumeration specifies the granularity of font selection * that is desired in a font chooser. * * This enumeration may be extended in the future; applications should * ignore unknown values. * @gir-type Flags */ enum FontChooserLevel { /** * Allow selecting a font family */ FAMILY, /** * Allow selecting a specific font face */ STYLE, /** * Allow selecting a specific font size */ SIZE, VARIATIONS, /** * Allow selecting specific OpenType font features */ FEATURES, } /** * @gir-type Flags */ export namespace IconLookupFlags { export const $gtype: GObject.GType; } /** * Used to specify options for `gtk_icon_theme_lookup_icon()` * @gir-type Flags */ enum IconLookupFlags { /** * Never get SVG icons, even if gdk-pixbuf * supports them. Cannot be used together with {@link Gtk.IconLookupFlags.FORCE_SVG}. */ NO_SVG, /** * Get SVG icons, even if gdk-pixbuf * doesn’t support them. * Cannot be used together with {@link Gtk.IconLookupFlags.NO_SVG}. */ FORCE_SVG, /** * When passed to * `gtk_icon_theme_lookup_icon()` includes builtin icons * as well as files. For a builtin icon, `gtk_icon_info_get_filename()` * is `null` and you need to call `gtk_icon_info_get_builtin_pixbuf()`. */ USE_BUILTIN, /** * Try to shorten icon name at '-' * characters before looking at inherited themes. This flag is only * supported in functions that take a single icon name. For more general * fallback, see `gtk_icon_theme_choose_icon()`. Since 2.12. */ GENERIC_FALLBACK, /** * Always get the icon scaled to the * requested size. Since 2.14. */ FORCE_SIZE, /** * Try to always load regular icons, even * when symbolic icon names are given. Since 3.14. */ FORCE_REGULAR, /** * Try to always load symbolic icons, even * when regular icon names are given. Since 3.14. */ FORCE_SYMBOLIC, /** * Try to load a variant of the icon for left-to-right * text direction. Since 3.14. */ DIR_LTR, /** * Try to load a variant of the icon for right-to-left * text direction. Since 3.14. */ DIR_RTL, } /** * @gir-type Flags */ export namespace InputHints { export const $gtype: GObject.GType; } /** * Describes hints that might be taken into account by input methods * or applications. Note that input methods may already tailor their * behaviour according to the {@link Gtk.InputPurpose} of the entry. * * Some common sense is expected when using these flags - mixing * `GTK_INPUT_HINT_LOWERCASE` with any of the uppercase hints makes no sense. * * This enumeration may be extended in the future; input methods should * ignore unknown values. * @gir-type Flags * @since 3.6 */ enum InputHints { /** * No special behaviour suggested */ NONE, /** * Suggest checking for typos */ SPELLCHECK, /** * Suggest not checking for typos */ NO_SPELLCHECK, /** * Suggest word completion */ WORD_COMPLETION, /** * Suggest to convert all text to lowercase */ LOWERCASE, /** * Suggest to capitalize all text */ UPPERCASE_CHARS, /** * Suggest to capitalize the first * character of each word */ UPPERCASE_WORDS, /** * Suggest to capitalize the * first word of each sentence */ UPPERCASE_SENTENCES, /** * Suggest to not show an onscreen keyboard * (e.g for a calculator that already has all the keys). */ INHIBIT_OSK, /** * The text is vertical. Since 3.18 */ VERTICAL_WRITING, /** * Suggest offering Emoji support. Since 3.22.20 */ EMOJI, /** * Suggest not offering Emoji support. Since 3.22.20 */ NO_EMOJI, } /** * @gir-type Flags */ export namespace JunctionSides { export const $gtype: GObject.GType; } /** * Describes how a rendered element connects to adjacent elements. * @gir-type Flags */ enum JunctionSides { /** * No junctions. */ NONE, /** * Element connects on the top-left corner. */ CORNER_TOPLEFT, /** * Element connects on the top-right corner. */ CORNER_TOPRIGHT, /** * Element connects on the bottom-left corner. */ CORNER_BOTTOMLEFT, /** * Element connects on the bottom-right corner. */ CORNER_BOTTOMRIGHT, /** * Element connects on the top side. */ TOP, /** * Element connects on the bottom side. */ BOTTOM, /** * Element connects on the left side. */ LEFT, /** * Element connects on the right side. */ RIGHT, } /** * @gir-type Flags */ export namespace PlacesOpenFlags { export const $gtype: GObject.GType; } /** * These flags serve two purposes. First, the application can call `gtk_places_sidebar_set_open_flags()` * using these flags as a bitmask. This tells the sidebar that the application is able to open * folders selected from the sidebar in various ways, for example, in new tabs or in new windows in * addition to the normal mode. * * Second, when one of these values gets passed back to the application in the * {@link Gtk.PlacesSidebar.SignalSignatures.open_location | Gtk.PlacesSidebar::open-location} signal, it means that the application should * open the selected location in the normal way, in a new tab, or in a new * window. The sidebar takes care of determining the desired way to open the location, * based on the modifier keys that the user is pressing at the time the selection is made. * * If the application never calls `gtk_places_sidebar_set_open_flags()`, then the sidebar will only * use #GTK_PLACES_OPEN_NORMAL in the {@link Gtk.PlacesSidebar.SignalSignatures.open_location | Gtk.PlacesSidebar::open-location} signal. This is the * default mode of operation. * @gir-type Flags */ enum PlacesOpenFlags { /** * This is the default mode that {@link Gtk.PlacesSidebar} uses if no other flags * are specified. It indicates that the calling application should open the selected location * in the normal way, for example, in the folder view beside the sidebar. */ NORMAL, /** * When passed to `gtk_places_sidebar_set_open_flags()`, this indicates * that the application can open folders selected from the sidebar in new tabs. This value * will be passed to the {@link Gtk.PlacesSidebar.SignalSignatures.open_location | Gtk.PlacesSidebar::open-location} signal when the user selects * that a location be opened in a new tab instead of in the standard fashion. */ NEW_TAB, /** * Similar to `GTK_PLACES_OPEN_NEW_TAB`, but indicates that the application * can open folders in new windows. */ NEW_WINDOW, } /** * @gir-type Flags */ export namespace RcFlags { export const $gtype: GObject.GType; } /** * Deprecated * @gir-type Flags */ enum RcFlags { /** * Deprecated */ FG, /** * Deprecated */ BG, /** * Deprecated */ TEXT, /** * Deprecated */ BASE, } /** * @gir-type Flags */ export namespace RecentFilterFlags { export const $gtype: GObject.GType; } /** * These flags indicate what parts of a {@link Gtk.RecentFilterInfo} struct * are filled or need to be filled. * @gir-type Flags */ enum RecentFilterFlags { /** * the URI of the file being tested */ URI, /** * the string that will be used to * display the file in the recent chooser */ DISPLAY_NAME, /** * the mime type of the file */ MIME_TYPE, /** * the list of applications that have * registered the file */ APPLICATION, /** * the groups to which the file belongs to */ GROUP, /** * the number of days elapsed since the file * has been registered */ AGE, } /** * @gir-type Flags */ export namespace RegionFlags { export const $gtype: GObject.GType; } /** * Describes a region within a widget. * @gir-type Flags */ enum RegionFlags { /** * Region has an even number within a set. */ EVEN, /** * Region has an odd number within a set. */ ODD, /** * Region is the first one within a set. */ FIRST, /** * Region is the last one within a set. */ LAST, /** * Region is the only one within a set. */ ONLY, /** * Region is part of a sorted area. */ SORTED, } /** * @gir-type Flags */ export namespace StateFlags { export const $gtype: GObject.GType; } /** * Describes a widget state. Widget states are used to match the widget * against CSS pseudo-classes. Note that GTK extends the regular CSS * classes and sometimes uses different names. * @gir-type Flags */ enum StateFlags { /** * State during normal operation. */ NORMAL, /** * Widget is active. */ ACTIVE, /** * Widget has a mouse pointer over it. */ PRELIGHT, /** * Widget is selected. */ SELECTED, /** * Widget is insensitive. */ INSENSITIVE, /** * Widget is inconsistent. */ INCONSISTENT, /** * Widget has the keyboard focus. */ FOCUSED, /** * Widget is in a background toplevel window. */ BACKDROP, /** * Widget is in left-to-right text direction. Since 3.8 */ DIR_LTR, /** * Widget is in right-to-left text direction. Since 3.8 */ DIR_RTL, /** * Widget is a link. Since 3.12 */ LINK, /** * The location the widget points to has already been visited. Since 3.12 */ VISITED, /** * Widget is checked. Since 3.14 */ CHECKED, /** * Widget is highlighted as a drop target for DND. Since 3.20 */ DROP_ACTIVE, } /** * @gir-type Flags */ export namespace StyleContextPrintFlags { export const $gtype: GObject.GType; } /** * Flags that modify the behavior of `gtk_style_context_to_string()`. * New values may be added to this enumeration. * @gir-type Flags */ enum StyleContextPrintFlags { NONE, /** * Print the entire tree of * CSS nodes starting at the style context's node */ RECURSE, /** * Show the values of the * CSS properties for each node */ SHOW_STYLE, } /** * @gir-type Flags */ export namespace TargetFlags { export const $gtype: GObject.GType; } /** * The {@link Gtk.TargetFlags} enumeration is used to specify * constraints on a {@link Gtk.TargetEntry}. * @gir-type Flags */ enum TargetFlags { /** * If this is set, the target will only be selected * for drags within a single application. */ SAME_APP, /** * If this is set, the target will only be selected * for drags within a single widget. */ SAME_WIDGET, /** * If this is set, the target will not be selected * for drags within a single application. */ OTHER_APP, /** * If this is set, the target will not be selected * for drags withing a single widget. */ OTHER_WIDGET, } /** * @gir-type Flags */ export namespace TextSearchFlags { export const $gtype: GObject.GType; } /** * Flags affecting how a search is done. * * If neither #GTK_TEXT_SEARCH_VISIBLE_ONLY nor #GTK_TEXT_SEARCH_TEXT_ONLY are * enabled, the match must be exact; the special 0xFFFC character will match * embedded pixbufs or child widgets. * @gir-type Flags */ enum TextSearchFlags { /** * Search only visible data. A search match may * have invisible text interspersed. */ VISIBLE_ONLY, /** * Search only text. A match may have pixbufs or * child widgets mixed inside the matched range. */ TEXT_ONLY, /** * The text will be matched regardless of * what case it is in. */ CASE_INSENSITIVE, } /** * @gir-type Flags */ export namespace ToolPaletteDragTargets { export const $gtype: GObject.GType; } /** * Flags used to specify the supported drag targets. * @gir-type Flags */ enum ToolPaletteDragTargets { /** * Support drag of items. */ ITEMS, /** * Support drag of groups. */ GROUPS, } /** * @gir-type Flags */ export namespace TreeModelFlags { export const $gtype: GObject.GType; } /** * These flags indicate various properties of a {@link Gtk.TreeModel}. * * They are returned by `gtk_tree_model_get_flags()`, and must be * static for the lifetime of the object. A more complete description * of #GTK_TREE_MODEL_ITERS_PERSIST can be found in the overview of * this section. * @gir-type Flags */ enum TreeModelFlags { /** * iterators survive all signals * emitted by the tree */ ITERS_PERSIST, /** * the model is a list only, and never * has children */ LIST_ONLY, } /** * @gir-type Flags */ export namespace UIManagerItemType { export const $gtype: GObject.GType; } /** * These enumeration values are used by `gtk_ui_manager_add_ui()` to determine * what UI element to create. * @gir-type Flags * @deprecated since 3.10 */ enum UIManagerItemType { /** * Pick the type of the UI element according to context. */ AUTO, /** * Create a menubar. */ MENUBAR, /** * Create a menu. */ MENU, /** * Create a toolbar. */ TOOLBAR, /** * Insert a placeholder. */ PLACEHOLDER, /** * Create a popup menu. */ POPUP, /** * Create a menuitem. */ MENUITEM, /** * Create a toolitem. */ TOOLITEM, /** * Create a separator. */ SEPARATOR, /** * Install an accelerator. */ ACCELERATOR, /** * Same as {@link Gtk.UIManagerItemType.POPUP}, but the * actions’ accelerators are shown. */ POPUP_WITH_ACCELS, } namespace AboutDialog { // Signal signatures interface SignalSignatures extends Dialog.SignalSignatures { /** * The signal which gets emitted to activate a URI. * Applications may connect to it to override the default behaviour, * which is to call `gtk_show_uri_on_window()`. * @signal * @since 2.24 * @run-last */ "activate-link": (arg0: string) => boolean | void; "notify::artists": (pspec: GObject.ParamSpec) => void; "notify::authors": (pspec: GObject.ParamSpec) => void; "notify::comments": (pspec: GObject.ParamSpec) => void; "notify::copyright": (pspec: GObject.ParamSpec) => void; "notify::documenters": (pspec: GObject.ParamSpec) => void; "notify::license": (pspec: GObject.ParamSpec) => void; "notify::license-type": (pspec: GObject.ParamSpec) => void; "notify::logo": (pspec: GObject.ParamSpec) => void; "notify::logo-icon-name": (pspec: GObject.ParamSpec) => void; "notify::program-name": (pspec: GObject.ParamSpec) => void; "notify::translator-credits": (pspec: GObject.ParamSpec) => void; "notify::version": (pspec: GObject.ParamSpec) => void; "notify::website": (pspec: GObject.ParamSpec) => void; "notify::website-label": (pspec: GObject.ParamSpec) => void; "notify::wrap-license": (pspec: GObject.ParamSpec) => void; "notify::use-header-bar": (pspec: GObject.ParamSpec) => void; "notify::accept-focus": (pspec: GObject.ParamSpec) => void; "notify::application": (pspec: GObject.ParamSpec) => void; "notify::attached-to": (pspec: GObject.ParamSpec) => void; "notify::decorated": (pspec: GObject.ParamSpec) => void; "notify::default-height": (pspec: GObject.ParamSpec) => void; "notify::default-width": (pspec: GObject.ParamSpec) => void; "notify::deletable": (pspec: GObject.ParamSpec) => void; "notify::destroy-with-parent": (pspec: GObject.ParamSpec) => void; "notify::focus-on-map": (pspec: GObject.ParamSpec) => void; "notify::focus-visible": (pspec: GObject.ParamSpec) => void; "notify::gravity": (pspec: GObject.ParamSpec) => void; "notify::has-resize-grip": (pspec: GObject.ParamSpec) => void; "notify::has-toplevel-focus": (pspec: GObject.ParamSpec) => void; "notify::hide-titlebar-when-maximized": (pspec: GObject.ParamSpec) => void; "notify::icon": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-active": (pspec: GObject.ParamSpec) => void; "notify::is-maximized": (pspec: GObject.ParamSpec) => void; "notify::mnemonics-visible": (pspec: GObject.ParamSpec) => void; "notify::modal": (pspec: GObject.ParamSpec) => void; "notify::resizable": (pspec: GObject.ParamSpec) => void; "notify::resize-grip-visible": (pspec: GObject.ParamSpec) => void; "notify::role": (pspec: GObject.ParamSpec) => void; "notify::screen": (pspec: GObject.ParamSpec) => void; "notify::skip-pager-hint": (pspec: GObject.ParamSpec) => void; "notify::skip-taskbar-hint": (pspec: GObject.ParamSpec) => void; "notify::startup-id": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; "notify::transient-for": (pspec: GObject.ParamSpec) => void; "notify::type": (pspec: GObject.ParamSpec) => void; "notify::type-hint": (pspec: GObject.ParamSpec) => void; "notify::urgency-hint": (pspec: GObject.ParamSpec) => void; "notify::window-position": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Dialog.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { artists: string[]; authors: string[]; comments: string; copyright: string; documenters: string[]; license: string; license_type: License; licenseType: License; logo: GdkPixbuf.Pixbuf; logo_icon_name: string; logoIconName: string; program_name: string; programName: string; translator_credits: string; translatorCredits: string; version: string; website: string; website_label: string; websiteLabel: string; wrap_license: boolean; wrapLicense: boolean; } } /** * The GtkAboutDialog offers a simple way to display information about * a program like its logo, name, copyright, website and license. It is * also possible to give credits to the authors, documenters, translators * and artists who have worked on the program. An about dialog is typically * opened when the user selects the `About` option from the `Help` menu. * All parts of the dialog are optional. * * About dialogs often contain links and email addresses. GtkAboutDialog * displays these as clickable links. By default, it calls `gtk_show_uri_on_window()` * when a user clicks one. The behaviour can be overridden with the * {@link Gtk.AboutDialog.SignalSignatures.activate_link | Gtk.AboutDialog::activate-link} signal. * * To specify a person with an email address, use a string like * "Edgar Allan Poe ". To specify a website with a title, * use a string like "GTK+ team http://www.gtk.org". * * To make constructing a GtkAboutDialog as convenient as possible, you can * use the function `gtk_show_about_dialog()` which constructs and shows a dialog * and keeps it around so that it can be shown again. * * Note that GTK+ sets a default title of `_("About %s")` on the dialog * window (where \%s is replaced by the name of the application, but in * order to ensure proper translation of the title, applications should * set the title property explicitly when constructing a GtkAboutDialog, * as shown in the following example: * * ```c * GdkPixbuf *example_logo = gdk_pixbuf_new_from_file ("./logo.png", NULL); * gtk_show_about_dialog (NULL, * "program-name", "ExampleCode", * "logo", example_logo, * "title", _("About ExampleCode"), * NULL); * ``` * * * It is also possible to show a {@link Gtk.AboutDialog} like any other {@link Gtk.Dialog}, * e.g. using `gtk_dialog_run()`. In this case, you might need to know that * the “Close” button returns the #GTK_RESPONSE_CANCEL response id. * @gir-type Class */ class AboutDialog extends Dialog implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties /** * The people who contributed artwork to the program, as a `null`-terminated * array of strings. Each string may contain email addresses and URLs, which * will be displayed as links, see the introduction for more details. * @since 2.6 */ get artists(): string[]; set artists(val: string[]); /** * The authors of the program, as a `null`-terminated array of strings. * Each string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. * @since 2.6 */ get authors(): string[]; set authors(val: string[]); /** * Comments about the program. This string is displayed in a label * in the main dialog, thus it should be a short explanation of * the main purpose of the program, not a detailed list of features. * @since 2.6 * @default null */ get comments(): string; set comments(val: string); /** * Copyright information for the program. * @since 2.6 * @default null */ get copyright(): string; set copyright(val: string); /** * The people documenting the program, as a `null`-terminated array of strings. * Each string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. * @since 2.6 */ get documenters(): string[]; set documenters(val: string[]); /** * The license of the program. This string is displayed in a * text view in a secondary dialog, therefore it is fine to use * a long multi-paragraph text. Note that the text is only wrapped * in the text view if the "wrap-license" property is set to `true`; * otherwise the text itself must contain the intended linebreaks. * When setting this property to a non-`null` value, the * {@link Gtk.AboutDialog.license_type} property is set to {@link Gtk.License.CUSTOM} * as a side effect. * @since 2.6 * @default null */ get license(): string; set license(val: string); /** * The license of the program, as a value of the %GtkLicense enumeration. * * The {@link Gtk.AboutDialog} will automatically fill out a standard disclaimer * and link the user to the appropriate online resource for the license * text. * * If {@link Gtk.License.UNKNOWN} is used, the link used will be the same * specified in the {@link Gtk.AboutDialog.website} property. * * If {@link Gtk.License.CUSTOM} is used, the current contents of the * {@link Gtk.AboutDialog.license} property are used. * * For any other {@link Gtk.License} value, the contents of the * {@link Gtk.AboutDialog.license} property are also set by this property as * a side effect. * @since 3.0 * @default Gtk.License.UNKNOWN */ get license_type(): License; set license_type(val: License); /** * The license of the program, as a value of the %GtkLicense enumeration. * * The {@link Gtk.AboutDialog} will automatically fill out a standard disclaimer * and link the user to the appropriate online resource for the license * text. * * If {@link Gtk.License.UNKNOWN} is used, the link used will be the same * specified in the {@link Gtk.AboutDialog.website} property. * * If {@link Gtk.License.CUSTOM} is used, the current contents of the * {@link Gtk.AboutDialog.license} property are used. * * For any other {@link Gtk.License} value, the contents of the * {@link Gtk.AboutDialog.license} property are also set by this property as * a side effect. * @since 3.0 * @default Gtk.License.UNKNOWN */ get licenseType(): License; set licenseType(val: License); /** * A logo for the about box. If it is `null`, the default window icon * set with `gtk_window_set_default_icon()` will be used. * @since 2.6 */ get logo(): GdkPixbuf.Pixbuf; set logo(val: GdkPixbuf.Pixbuf); /** * A named icon to use as the logo for the about box. This property * overrides the {@link Gtk.AboutDialog.logo} property. * @since 2.6 * @default image-missing */ get logo_icon_name(): string; set logo_icon_name(val: string); /** * A named icon to use as the logo for the about box. This property * overrides the {@link Gtk.AboutDialog.logo} property. * @since 2.6 * @default image-missing */ get logoIconName(): string; set logoIconName(val: string); /** * The name of the program. * If this is not set, it defaults to `g_get_application_name()`. * @since 2.12 * @default null */ get program_name(): string; set program_name(val: string); /** * The name of the program. * If this is not set, it defaults to `g_get_application_name()`. * @since 2.12 * @default null */ get programName(): string; set programName(val: string); /** * Credits to the translators. This string should be marked as translatable. * The string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. * @since 2.6 * @default null */ get translator_credits(): string; set translator_credits(val: string); /** * Credits to the translators. This string should be marked as translatable. * The string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. * @since 2.6 * @default null */ get translatorCredits(): string; set translatorCredits(val: string); /** * The version of the program. * @since 2.6 * @default null */ get version(): string; set version(val: string); /** * The URL for the link to the website of the program. * This should be a string starting with "http://. * @since 2.6 * @default null */ get website(): string; set website(val: string); /** * The label for the link to the website of the program. * @since 2.6 * @default null */ get website_label(): string; set website_label(val: string); /** * The label for the link to the website of the program. * @since 2.6 * @default null */ get websiteLabel(): string; set websiteLabel(val: string); /** * Whether to wrap the text in the license dialog. * @since 2.8 * @default false */ get wrap_license(): boolean; set wrap_license(val: boolean); /** * Whether to wrap the text in the license dialog. * @since 2.8 * @default false */ get wrapLicense(): boolean; set wrapLicense(val: boolean); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: AboutDialog.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](): AboutDialog; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * @param uri * @virtual */ vfunc_activate_link(uri: string): boolean; // Methods /** * Creates a new section in the Credits page. * @param section_name The name of the section * @param people The people who belong to that section */ add_credit_section(section_name: string, people: string[]): void; /** * Returns the string which are displayed in the artists tab * of the secondary credits dialog. * @returns A `null`-terminated string array containing the artists. The array is owned by the about dialog and must not be modified. */ get_artists(): string[]; /** * Returns the string which are displayed in the authors tab * of the secondary credits dialog. * @returns A `null`-terminated string array containing the authors. The array is owned by the about dialog and must not be modified. */ get_authors(): string[]; /** * Returns the comments string. * @returns The comments. The string is owned by the about dialog and must not be modified. */ get_comments(): string; /** * Returns the copyright string. * @returns The copyright string. The string is owned by the about dialog and must not be modified. */ get_copyright(): string; /** * Returns the string which are displayed in the documenters * tab of the secondary credits dialog. * @returns A `null`-terminated string array containing the documenters. The array is owned by the about dialog and must not be modified. */ get_documenters(): string[]; /** * Returns the license information. * @returns The license information. The string is owned by the about dialog and must not be modified. */ get_license(): string; /** * Retrieves the license set using `gtk_about_dialog_set_license_type()` * @returns a {@link Gtk.License} value */ get_license_type(): License; /** * Returns the pixbuf displayed as logo in the about dialog. * @returns the pixbuf displayed as logo. The pixbuf is owned by the about dialog. If you want to keep a reference to it, you have to call `g_object_ref()` on it. */ get_logo(): GdkPixbuf.Pixbuf; /** * Returns the icon name displayed as logo in the about dialog. * @returns the icon name displayed as logo. The string is owned by the dialog. If you want to keep a reference to it, you have to call `g_strdup()` on it. */ get_logo_icon_name(): string; /** * Returns the program name displayed in the about dialog. * @returns The program name. The string is owned by the about dialog and must not be modified. */ get_program_name(): string; /** * Returns the translator credits string which is displayed * in the translators tab of the secondary credits dialog. * @returns The translator credits string. The string is owned by the about dialog and must not be modified. */ get_translator_credits(): string; /** * Returns the version string. * @returns The version string. The string is owned by the about dialog and must not be modified. */ get_version(): string; /** * Returns the website URL. * @returns The website URL. The string is owned by the about dialog and must not be modified. */ get_website(): string; /** * Returns the label used for the website link. * @returns The label used for the website link. The string is owned by the about dialog and must not be modified. */ get_website_label(): string; /** * Returns whether the license text in `about` is * automatically wrapped. * @returns `true` if the license text is wrapped */ get_wrap_license(): boolean; /** * Sets the strings which are displayed in the artists tab * of the secondary credits dialog. * @param artists a `null`-terminated array of strings */ set_artists(artists: string[]): void; /** * Sets the strings which are displayed in the authors tab * of the secondary credits dialog. * @param authors a `null`-terminated array of strings */ set_authors(authors: string[]): void; /** * Sets the comments string to display in the about dialog. * This should be a short string of one or two lines. * @param comments a comments string */ set_comments(comments: string | null): void; /** * Sets the copyright string to display in the about dialog. * This should be a short string of one or two lines. * @param copyright the copyright string */ set_copyright(copyright: string | null): void; /** * Sets the strings which are displayed in the documenters tab * of the secondary credits dialog. * @param documenters a `null`-terminated array of strings */ set_documenters(documenters: string[]): void; /** * Sets the license information to be displayed in the secondary * license dialog. If `license` is `null`, the license button is * hidden. * @param license the license information or `null` */ set_license(license: string | null): void; /** * Sets the license of the application showing the `about` dialog from a * list of known licenses. * * This function overrides the license set using * `gtk_about_dialog_set_license()`. * @param license_type the type of license */ set_license_type(license_type: License): void; /** * Sets the pixbuf to be displayed as logo in the about dialog. * If it is `null`, the default window icon set with * `gtk_window_set_default_icon()` will be used. * @param logo a {@link GdkPixbuf.Pixbuf}, or `null` */ set_logo(logo: GdkPixbuf.Pixbuf | null): void; /** * Sets the pixbuf to be displayed as logo in the about dialog. * If it is `null`, the default window icon set with * `gtk_window_set_default_icon()` will be used. * @param icon_name an icon name, or `null` */ set_logo_icon_name(icon_name: string | null): void; /** * Sets the name to display in the about dialog. * If this is not set, it defaults to `g_get_application_name()`. * @param name the program name */ set_program_name(name: string): void; /** * Sets the translator credits string which is displayed in * the translators tab of the secondary credits dialog. * * The intended use for this string is to display the translator * of the language which is currently used in the user interface. * Using `gettext()`, a simple way to achieve that is to mark the * string for translation: * * ```c * GtkWidget *about = gtk_about_dialog_new (); * gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (about), * _("translator-credits")); * ``` * * It is a good idea to use the customary msgid “translator-credits” for this * purpose, since translators will already know the purpose of that msgid, and * since {@link Gtk.AboutDialog} will detect if “translator-credits” is untranslated * and hide the tab. * @param translator_credits the translator credits */ set_translator_credits(translator_credits: string | null): void; /** * Sets the version string to display in the about dialog. * @param version the version string */ set_version(version: string | null): void; /** * Sets the URL to use for the website link. * @param website a URL string starting with "http://" */ set_website(website: string | null): void; /** * Sets the label to be used for the website link. * @param website_label the label used for the website link */ set_website_label(website_label: string): void; /** * Sets whether the license text in `about` is * automatically wrapped. * @param wrap_license whether to wrap the license */ set_wrap_license(wrap_license: boolean): void; } namespace AccelGroup { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { /** * The accel-activate signal is an implementation detail of * {@link Gtk.AccelGroup} and not meant to be used by applications. * @signal * @detailed */ "accel-activate": (arg0: GObject.Object, arg1: number, arg2: Gdk.ModifierType) => boolean | void; /** * The accel-changed signal is emitted when an entry * is added to or removed from the accel group. * * Widgets like {@link Gtk.AccelLabel} which display an associated * accelerator should connect to this signal, and rebuild * their visual representation if the `accel_closure` is theirs. * @signal * @detailed * @run-first */ "accel-changed": (arg0: number, arg1: Gdk.ModifierType, arg2: GObject.Closure) => void; "notify::is-locked": (pspec: GObject.ParamSpec) => void; "notify::modifier-mask": (pspec: GObject.ParamSpec) => void; /** * The accel-activate signal is an implementation detail of * {@link Gtk.AccelGroup} and not meant to be used by applications. * @signal * @detailed */ "accel-activate::is-locked": (arg0: GObject.Object, arg1: number, arg2: Gdk.ModifierType) => boolean | void; /** * The accel-activate signal is an implementation detail of * {@link Gtk.AccelGroup} and not meant to be used by applications. * @signal * @detailed */ "accel-activate::modifier-mask": (arg0: GObject.Object, arg1: number, arg2: Gdk.ModifierType) => boolean | void; [key: `accel-activate::${string}`]: (arg0: GObject.Object, arg1: number, arg2: Gdk.ModifierType) => boolean | void; /** * The accel-changed signal is emitted when an entry * is added to or removed from the accel group. * * Widgets like {@link Gtk.AccelLabel} which display an associated * accelerator should connect to this signal, and rebuild * their visual representation if the `accel_closure` is theirs. * @signal * @detailed * @run-first */ "accel-changed::is-locked": (arg0: number, arg1: Gdk.ModifierType, arg2: GObject.Closure) => void; /** * The accel-changed signal is emitted when an entry * is added to or removed from the accel group. * * Widgets like {@link Gtk.AccelLabel} which display an associated * accelerator should connect to this signal, and rebuild * their visual representation if the `accel_closure` is theirs. * @signal * @detailed * @run-first */ "accel-changed::modifier-mask": (arg0: number, arg1: Gdk.ModifierType, arg2: GObject.Closure) => void; [key: `accel-changed::${string}`]: (arg0: number, arg1: Gdk.ModifierType, arg2: GObject.Closure) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { is_locked: boolean; isLocked: boolean; modifier_mask: Gdk.ModifierType; modifierMask: Gdk.ModifierType; } } /** * A {@link Gtk.AccelGroup} represents a group of keyboard accelerators, * typically attached to a toplevel {@link Gtk.Window} (with * `gtk_window_add_accel_group()`). Usually you won’t need to create a * {@link Gtk.AccelGroup} directly; instead, when using {@link Gtk.UIManager}, GTK+ * automatically sets up the accelerators for your menus in the ui * manager’s {@link Gtk.AccelGroup}. * * Note that “accelerators” are different from * “mnemonics”. Accelerators are shortcuts for * activating a menu item; they appear alongside the menu item they’re a * shortcut for. For example “Ctrl+Q” might appear alongside the “Quit” * menu item. Mnemonics are shortcuts for GUI elements such as text * entries or buttons; they appear as underlined characters. See * `gtk_label_new_with_mnemonic()`. Menu items can have both accelerators * and mnemonics, of course. * @gir-type Class */ class AccelGroup extends GObject.Object { static $gtype: GObject.GType; // Properties /** * @read-only * @default false */ get is_locked(): boolean; /** * @read-only * @default false */ get isLocked(): boolean; /** * @read-only * @default 0 */ get modifier_mask(): Gdk.ModifierType; /** * @read-only * @default 0 */ get modifierMask(): Gdk.ModifierType; /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: AccelGroup.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](): AccelGroup; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Static methods /** * Finds the {@link Gtk.AccelGroup} to which `closure` is connected; * see `gtk_accel_group_connect()`. * @param closure a {@link GObject.Closure} */ static from_accel_closure(closure: GObject.Closure): AccelGroup | null; // Virtual methods /** * Signal emitted when an entry is added to or removed * from the accel group. * @param keyval * @param modifier * @param accel_closure * @virtual */ vfunc_accel_changed(keyval: number, modifier: Gdk.ModifierType, accel_closure: GObject.Closure): void; // Methods /** * Finds the first accelerator in `accel_group` that matches * `accel_key` and `accel_mods`, and activates it. * @param accel_quark the quark for the accelerator name * @param acceleratable the {@link GObject.Object}, usually a {@link Gtk.Window}, on which to activate the accelerator * @param accel_key accelerator keyval from a key event * @param accel_mods keyboard state mask from a key event * @returns `true` if an accelerator was activated and handled this keypress */ activate(accel_quark: GLib.Quark, acceleratable: GObject.Object, accel_key: number, accel_mods: Gdk.ModifierType): boolean; /** * Installs an accelerator in this group. When `accel_group` is being * activated in response to a call to `gtk_accel_groups_activate()`, * `closure` will be invoked if the `accel_key` and `accel_mods` from * `gtk_accel_groups_activate()` match those of this connection. * * The signature used for the `closure` is that of {@link Gtk.AccelGroupActivate}. * * Note that, due to implementation details, a single closure can * only be connected to one accelerator group. * @param accel_key key value of the accelerator * @param accel_mods modifier combination of the accelerator * @param accel_flags a flag mask to configure this accelerator * @param closure closure to be executed upon accelerator activation */ connect(accel_key: number, accel_mods: Gdk.ModifierType, accel_flags: AccelFlags, closure: GObject.Closure): void; /** * @param args */ connect(...args: never[]): any; /** * Installs an accelerator in this group, using an accelerator path * to look up the appropriate key and modifiers (see * `gtk_accel_map_add_entry()`). When `accel_group` is being activated * in response to a call to `gtk_accel_groups_activate()`, `closure` will * be invoked if the `accel_key` and `accel_mods` from * `gtk_accel_groups_activate()` match the key and modifiers for the path. * * The signature used for the `closure` is that of {@link Gtk.AccelGroupActivate}. * * Note that `accel_path` string will be stored in a {@link GLib.Quark}. Therefore, * if you pass a static string, you can save some memory by interning it * first with `g_intern_static_string()`. * @param accel_path path used for determining key and modifiers * @param closure closure to be executed upon accelerator activation */ connect_by_path(accel_path: string, closure: GObject.Closure): void; /** * Removes an accelerator previously installed through * `gtk_accel_group_connect()`. * * Since 2.20 `closure` can be `null`. * @param closure the closure to remove from this accelerator group, or `null` to remove all closures * @returns `true` if the closure was found and got disconnected */ disconnect(closure: GObject.Closure | null): boolean; /** * @param args */ // Conflicted with GObject.Object.disconnect disconnect(...args: never[]): any; /** * Removes an accelerator previously installed through * `gtk_accel_group_connect()`. * @param accel_key key value of the accelerator * @param accel_mods modifier combination of the accelerator * @returns `true` if there was an accelerator which could be removed, `false` otherwise */ disconnect_key(accel_key: number, accel_mods: Gdk.ModifierType): boolean; /** * Finds the first entry in an accelerator group for which * `find_func` returns `true` and returns its {@link Gtk.AccelKey}. * @param find_func a function to filter the entries of `accel_group` with * @returns the key of the first entry passing `find_func`. The key is owned by GTK+ and must not be freed. */ find(find_func: AccelGroupFindFunc): AccelKey; /** * Locks are added and removed using `gtk_accel_group_lock()` and * `gtk_accel_group_unlock()`. * @returns `true` if there are 1 or more locks on the `accel_group`, `false` otherwise. */ get_is_locked(): boolean; /** * Gets a {@link Gdk.ModifierType} representing the mask for this * `accel_group`. For example, #GDK_CONTROL_MASK, #GDK_SHIFT_MASK, etc. * @returns the modifier mask for this accel group. */ get_modifier_mask(): Gdk.ModifierType; /** * Locks the given accelerator group. * * Locking an acelerator group prevents the accelerators contained * within it to be changed during runtime. Refer to * `gtk_accel_map_change_entry()` about runtime accelerator changes. * * If called more than once, `accel_group` remains locked until * `gtk_accel_group_unlock()` has been called an equivalent number * of times. */ lock(): void; /** * Queries an accelerator group for all entries matching `accel_key` * and `accel_mods`. * @param accel_key key value of the accelerator * @param accel_mods modifier combination of the accelerator * @returns an array of `n_entries` {@link Gtk.AccelGroupEntry} elements, or `null`. The array is owned by GTK+ and must not be freed. */ query(accel_key: number, accel_mods: Gdk.ModifierType): AccelGroupEntry[] | null; /** * Undoes the last call to `gtk_accel_group_lock()` on this `accel_group`. */ unlock(): void; } namespace AccelLabel { // Signal signatures interface SignalSignatures extends Label.SignalSignatures { "notify::accel-closure": (pspec: GObject.ParamSpec) => void; "notify::accel-widget": (pspec: GObject.ParamSpec) => void; "notify::angle": (pspec: GObject.ParamSpec) => void; "notify::attributes": (pspec: GObject.ParamSpec) => void; "notify::cursor-position": (pspec: GObject.ParamSpec) => void; "notify::ellipsize": (pspec: GObject.ParamSpec) => void; "notify::justify": (pspec: GObject.ParamSpec) => void; "notify::label": (pspec: GObject.ParamSpec) => void; "notify::lines": (pspec: GObject.ParamSpec) => void; "notify::max-width-chars": (pspec: GObject.ParamSpec) => void; "notify::mnemonic-keyval": (pspec: GObject.ParamSpec) => void; "notify::mnemonic-widget": (pspec: GObject.ParamSpec) => void; "notify::pattern": (pspec: GObject.ParamSpec) => void; "notify::selectable": (pspec: GObject.ParamSpec) => void; "notify::selection-bound": (pspec: GObject.ParamSpec) => void; "notify::single-line-mode": (pspec: GObject.ParamSpec) => void; "notify::track-visited-links": (pspec: GObject.ParamSpec) => void; "notify::use-markup": (pspec: GObject.ParamSpec) => void; "notify::use-underline": (pspec: GObject.ParamSpec) => void; "notify::width-chars": (pspec: GObject.ParamSpec) => void; "notify::wrap": (pspec: GObject.ParamSpec) => void; "notify::wrap-mode": (pspec: GObject.ParamSpec) => void; "notify::xalign": (pspec: GObject.ParamSpec) => void; "notify::yalign": (pspec: GObject.ParamSpec) => void; "notify::xpad": (pspec: GObject.ParamSpec) => void; "notify::ypad": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Label.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { accel_closure: GObject.Closure; accelClosure: GObject.Closure; accel_widget: Widget | null; accelWidget: Widget | null; } } /** * The {@link Gtk.AccelLabel} widget is a subclass of {@link Gtk.Label} that also displays an * accelerator key on the right of the label text, e.g. “Ctrl+S”. * It is commonly used in menus to show the keyboard short-cuts for commands. * * The accelerator key to display is typically not set explicitly (although it * can be, with `gtk_accel_label_set_accel()`). Instead, the {@link Gtk.AccelLabel} displays * the accelerators which have been added to a particular widget. This widget is * set by calling `gtk_accel_label_set_accel_widget()`. * * For example, a {@link Gtk.MenuItem} widget may have an accelerator added to emit * the “activate” signal when the “Ctrl+S” key combination is pressed. * A {@link Gtk.AccelLabel} is created and added to the {@link Gtk.MenuItem}, and * `gtk_accel_label_set_accel_widget()` is called with the {@link Gtk.MenuItem} as the * second argument. The {@link Gtk.AccelLabel} will now display “Ctrl+S” after its label. * * Note that creating a {@link Gtk.MenuItem} with `gtk_menu_item_new_with_label()` (or * one of the similar functions for {@link Gtk.CheckMenuItem} and {@link Gtk.RadioMenuItem}) * automatically adds a {@link Gtk.AccelLabel} to the {@link Gtk.MenuItem} and calls * `gtk_accel_label_set_accel_widget()` to set it up for you. * * A {@link Gtk.AccelLabel} will only display accelerators which have {@link Gtk.AccelFlags.VISIBLE} * set (see {@link Gtk.AccelFlags}). * A {@link Gtk.AccelLabel} can display multiple accelerators and even signal names, * though it is almost always used to display just one accelerator key. * * ## Creating a simple menu item with an accelerator key. * * * ```c * GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); * GtkWidget *menu = gtk_menu_new (); * GtkWidget *save_item; * GtkAccelGroup *accel_group; * * // Create a GtkAccelGroup and add it to the window. * accel_group = gtk_accel_group_new (); * gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); * * // Create the menu item using the convenience function. * save_item = gtk_menu_item_new_with_label ("Save"); * gtk_widget_show (save_item); * gtk_container_add (GTK_CONTAINER (menu), save_item); * * // Now add the accelerator to the GtkMenuItem. Note that since we * // called `gtk_menu_item_new_with_label()` to create the GtkMenuItem * // the GtkAccelLabel is automatically set up to display the * // GtkMenuItem accelerators. We just need to make sure we use * // GTK_ACCEL_VISIBLE here. * gtk_widget_add_accelerator (save_item, "activate", accel_group, * GDK_KEY_s, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); * ``` * * * # CSS nodes * * * ``` * label * ╰── accelerator * ``` * * * Like {@link Gtk.Label}, GtkAccelLabel has a main CSS node with the name label. * It adds a subnode with name accelerator. * @gir-type Class */ class AccelLabel extends Label implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties get accel_closure(): GObject.Closure; set accel_closure(val: GObject.Closure); get accelClosure(): GObject.Closure; set accelClosure(val: GObject.Closure); get accel_widget(): Widget | null; set accel_widget(val: Widget | null); get accelWidget(): Widget | null; set accelWidget(val: Widget | null); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: AccelLabel.SignalSignatures; // Fields // @ts-expect-error This property conflicts with an accessor in a parent class or interface. label: Label; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](string: string): AccelLabel; // Conflicted with Gtk.Label.new static ["new"](...args: never[]): any; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Gets the keyval and modifier mask set with * `gtk_accel_label_set_accel()`. */ get_accel(): [number, Gdk.ModifierType]; /** * Fetches the widget monitored by this accelerator label. See * `gtk_accel_label_set_accel_widget()`. * @returns the object monitored by the accelerator label, or `null`. */ get_accel_widget(): Widget | null; /** * Returns the width needed to display the accelerator key(s). * This is used by menus to align all of the {@link Gtk.MenuItem} widgets, and shouldn't * be needed by applications. * @returns the width needed to display the accelerator key(s). */ get_accel_width(): number; /** * Recreates the string representing the accelerator keys. * This should not be needed since the string is automatically updated whenever * accelerators are added or removed from the associated widget. * @returns always returns `false`. */ refetch(): boolean; /** * Manually sets a keyval and modifier mask as the accelerator rendered * by `accel_label`. * * If a keyval and modifier are explicitly set then these values are * used regardless of any associated accel closure or widget. * * Providing an `accelerator_key` of 0 removes the manual setting. * @param accelerator_key a keyval, or 0 * @param accelerator_mods the modifier mask for the accel */ set_accel(accelerator_key: number, accelerator_mods: Gdk.ModifierType): void; /** * Sets the closure to be monitored by this accelerator label. The closure * must be connected to an accelerator group; see `gtk_accel_group_connect()`. * Passing `null` for `accel_closure` will dissociate `accel_label` from its * current closure, if any. * @param accel_closure the closure to monitor for accelerator changes, or `null` */ set_accel_closure(accel_closure: GObject.Closure | null): void; /** * Sets the widget to be monitored by this accelerator label. Passing `null` for * `accel_widget` will dissociate `accel_label` from its current widget, if any. * @param accel_widget the widget to be monitored, or `null` */ set_accel_widget(accel_widget: Widget | null): void; } namespace AccelMap { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { /** * Notifies of a change in the global accelerator map. * The path is also used as the detail for the signal, * so it is possible to connect to * changed::`accel_path`. * @signal * @since 2.4 * @detailed * @run-last */ changed: (arg0: string, arg1: number, arg2: Gdk.ModifierType) => void; [key: `changed::${string}`]: (arg0: string, arg1: number, arg2: Gdk.ModifierType) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } /** * Accelerator maps are used to define runtime configurable accelerators. * Functions for manipulating them are are usually used by higher level * convenience mechanisms like {@link Gtk.UIManager} and are thus considered * “low-level”. You’ll want to use them if you’re manually creating menus that * should have user-configurable accelerators. * * An accelerator is uniquely defined by: * - accelerator path * - accelerator key * - accelerator modifiers * * The accelerator path must consist of * “/Category1/Category2/.../Action”, where WINDOWTYPE * should be a unique application-specific identifier that corresponds * to the kind of window the accelerator is being used in, e.g. * “Gimp-Image”, “Abiword-Document” or “Gnumeric-Settings”. * The “Category1/.../Action” portion is most appropriately chosen by * the action the accelerator triggers, i.e. for accelerators on menu * items, choose the item’s menu path, e.g. “File/Save As”, * “Image/View/Zoom” or “Edit/Select All”. So a full valid accelerator * path may look like: “/File/Dialogs/Tool Options...”. * * All accelerators are stored inside one global {@link Gtk.AccelMap} that can * be obtained using `gtk_accel_map_get()`. See * [Monitoring changes][monitoring-changes] for additional * details. * * # Manipulating accelerators * * New accelerators can be added using `gtk_accel_map_add_entry()`. * To search for specific accelerator, use `gtk_accel_map_lookup_entry()`. * Modifications of existing accelerators should be done using * `gtk_accel_map_change_entry()`. * * In order to avoid having some accelerators changed, they can be * locked using `gtk_accel_map_lock_path()`. Unlocking is done using * `gtk_accel_map_unlock_path()`. * * # Saving and loading accelerator maps * * Accelerator maps can be saved to and loaded from some external * resource. For simple saving and loading from file, * `gtk_accel_map_save()` and `gtk_accel_map_load()` are provided. * Saving and loading can also be done by providing file descriptor * to `gtk_accel_map_save_fd()` and `gtk_accel_map_load_fd()`. * * # Monitoring changes * * {@link Gtk.AccelMap} object is only useful for monitoring changes of * accelerators. By connecting to {@link Gtk.AccelMap.SignalSignatures.changed | Gtk.AccelMap::changed} signal, one * can monitor changes of all accelerators. It is also possible to * monitor only single accelerator path by using it as a detail of * the {@link Gtk.AccelMap.SignalSignatures.changed | Gtk.AccelMap::changed} signal. * @gir-type Class */ class AccelMap extends GObject.Object { static $gtype: GObject.GType; /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: AccelMap.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Static methods /** * Registers a new accelerator with the global accelerator map. * This function should only be called once per `accel_path` * with the canonical `accel_key` and `accel_mods` for this path. * To change the accelerator during runtime programatically, use * `gtk_accel_map_change_entry()`. * * Set `accel_key` and `accel_mods` to 0 to request a removal of * the accelerator. * * Note that `accel_path` string will be stored in a {@link GLib.Quark}. Therefore, if you * pass a static string, you can save some memory by interning it first with * `g_intern_static_string()`. * @param accel_path valid accelerator path * @param accel_key the accelerator key * @param accel_mods the accelerator modifiers */ static add_entry(accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType): void; /** * Adds a filter to the global list of accel path filters. * * Accel map entries whose accel path matches one of the filters * are skipped by `gtk_accel_map_foreach()`. * * This function is intended for GTK+ modules that create their own * menus, but don’t want them to be saved into the applications accelerator * map dump. * @param filter_pattern a pattern (see {@link GLib.PatternSpec}) */ static add_filter(filter_pattern: string): void; /** * Changes the `accel_key` and `accel_mods` currently associated with `accel_path`. * Due to conflicts with other accelerators, a change may not always be possible, * `replace` indicates whether other accelerators may be deleted to resolve such * conflicts. A change will only occur if all conflicts could be resolved (which * might not be the case if conflicting accelerators are locked). Successful * changes are indicated by a `true` return value. * * Note that `accel_path` string will be stored in a {@link GLib.Quark}. Therefore, if you * pass a static string, you can save some memory by interning it first with * `g_intern_static_string()`. * @param accel_path a valid accelerator path * @param accel_key the new accelerator key * @param accel_mods the new accelerator modifiers * @param replace `true` if other accelerators may be deleted upon conflicts */ static change_entry(accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType, replace: boolean): boolean; /** * Loops over the entries in the accelerator map whose accel path * doesn’t match any of the filters added with `gtk_accel_map_add_filter()`, * and execute `foreach_func` on each. The signature of `foreach_func` is * that of {@link Gtk.AccelMapForeach}, the `changed` parameter indicates whether * this accelerator was changed during runtime (thus, would need * saving during an accelerator map dump). * @param data data to be passed into `foreach_func` * @param foreach_func function to be executed for each accel map entry which is not filtered out */ static foreach(data: null, foreach_func: AccelMapForeach): void; /** * Loops over all entries in the accelerator map, and execute * `foreach_func` on each. The signature of `foreach_func` is that of * {@link Gtk.AccelMapForeach}, the `changed` parameter indicates whether * this accelerator was changed during runtime (thus, would need * saving during an accelerator map dump). * @param data data to be passed into `foreach_func` * @param foreach_func function to be executed for each accel map entry */ static foreach_unfiltered(data: null, foreach_func: AccelMapForeach): void; /** * Gets the singleton global {@link Gtk.AccelMap} object. This object * is useful only for notification of changes to the accelerator * map via the ::changed signal; it isn’t a parameter to the * other accelerator map functions. */ static get(): AccelMap; /** * Parses a file previously saved with `gtk_accel_map_save()` for * accelerator specifications, and propagates them accordingly. * @param file_name a file containing accelerator specifications, in the GLib file name encoding */ static load(file_name: string): void; /** * Filedescriptor variant of `gtk_accel_map_load()`. * * Note that the file descriptor will not be closed by this function. * @param fd a valid readable file descriptor */ static load_fd(fd: number): void; /** * {@link GLib.Scanner} variant of `gtk_accel_map_load()`. * @param scanner a {@link GLib.Scanner} which has already been provided with an input file */ static load_scanner(scanner: GLib.Scanner): void; /** * Locks the given accelerator path. If the accelerator map doesn’t yet contain * an entry for `accel_path`, a new one is created. * * Locking an accelerator path prevents its accelerator from being changed * during runtime. A locked accelerator path can be unlocked by * `gtk_accel_map_unlock_path()`. Refer to `gtk_accel_map_change_entry()` * for information about runtime accelerator changes. * * If called more than once, `accel_path` remains locked until * `gtk_accel_map_unlock_path()` has been called an equivalent number * of times. * * Note that locking of individual accelerator paths is independent from * locking the {@link Gtk.AccelGroup} containing them. For runtime accelerator * changes to be possible, both the accelerator path and its {@link Gtk.AccelGroup} * have to be unlocked. * @param accel_path a valid accelerator path */ static lock_path(accel_path: string): void; /** * Looks up the accelerator entry for `accel_path` and fills in `key`. * @param accel_path a valid accelerator path */ static lookup_entry(accel_path: string): [boolean, AccelKey | null]; /** * Saves current accelerator specifications (accelerator path, key * and modifiers) to `file_name`. * The file is written in a format suitable to be read back in by * `gtk_accel_map_load()`. * @param file_name the name of the file to contain accelerator specifications, in the GLib file name encoding */ static save(file_name: string): void; /** * Filedescriptor variant of `gtk_accel_map_save()`. * * Note that the file descriptor will not be closed by this function. * @param fd a valid writable file descriptor */ static save_fd(fd: number): void; /** * Undoes the last call to `gtk_accel_map_lock_path()` on this `accel_path`. * Refer to `gtk_accel_map_lock_path()` for information about accelerator path locking. * @param accel_path a valid accelerator path */ static unlock_path(accel_path: string): void; } namespace Accessible { // Signal signatures interface SignalSignatures extends Atk.Object.SignalSignatures { "notify::widget": (pspec: GObject.ParamSpec) => void; "notify::accessible-component-layer": (pspec: GObject.ParamSpec) => void; "notify::accessible-component-mdi-zorder": (pspec: GObject.ParamSpec) => void; "notify::accessible-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-help-text": (pspec: GObject.ParamSpec) => void; "notify::accessible-hypertext-nlinks": (pspec: GObject.ParamSpec) => void; "notify::accessible-id": (pspec: GObject.ParamSpec) => void; "notify::accessible-name": (pspec: GObject.ParamSpec) => void; "notify::accessible-parent": (pspec: GObject.ParamSpec) => void; "notify::accessible-role": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-caption": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-caption-object": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-column-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-column-header": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-row-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-row-header": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-summary": (pspec: GObject.ParamSpec) => void; "notify::accessible-value": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Atk.Object.ConstructorProps { widget: Widget | null; } } /** * The {@link Gtk.Accessible} class is the base class for accessible * implementations for {@link Gtk.Widget} subclasses. It is a thin * wrapper around {@link Atk.Object}, which adds facilities for associating * a widget with its accessible object. * * An accessible implementation for a third-party widget should * derive from {@link Gtk.Accessible} and implement the suitable interfaces * from ATK, such as {@link Atk.Text} or {@link Atk.Selection}. To establish * the connection between the widget class and its corresponding * acccessible implementation, override the get_accessible vfunc * in {@link Gtk.WidgetClass}. * @gir-type Class */ class Accessible extends Atk.Object { static $gtype: GObject.GType; // Properties get widget(): Widget | null; set widget(val: Widget | null); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Accessible.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * This function specifies the callback function to be called * when the widget corresponding to a GtkAccessible is destroyed. * @virtual */ vfunc_connect_widget_destroyed(): void; /** * @virtual */ vfunc_widget_set(): void; /** * @virtual */ vfunc_widget_unset(): void; // Methods /** * This function specifies the callback function to be called * when the widget corresponding to a GtkAccessible is destroyed. */ connect_widget_destroyed(): void; /** * Gets the {@link Gtk.Widget} corresponding to the {@link Gtk.Accessible}. * The returned widget does not have a reference added, so * you do not need to unref it. * @returns pointer to the {@link Gtk.Widget} corresponding to the {@link Gtk.Accessible}, or `null`. */ get_widget(): Widget | null; /** * Sets the {@link Gtk.Widget} corresponding to the {@link Gtk.Accessible}. * * `accessible` will not hold a reference to `widget`. * It is the caller’s responsibility to ensure that when `widget` * is destroyed, the widget is unset by calling this function * again with `widget` set to `null`. * @param widget a {@link Gtk.Widget} or `null` to unset */ set_widget(widget: Widget | null): void; } namespace Action { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { /** * The "activate" signal is emitted when the action is activated. * @signal * @since 2.4 * @deprecated since 3.10: Use {@link Gio.SimpleAction.SignalSignatures.activate | Gio.SimpleAction::activate} instead * @run-first */ activate: () => void; "notify::action-group": (pspec: GObject.ParamSpec) => void; "notify::always-show-image": (pspec: GObject.ParamSpec) => void; "notify::gicon": (pspec: GObject.ParamSpec) => void; "notify::hide-if-empty": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-important": (pspec: GObject.ParamSpec) => void; "notify::label": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::short-label": (pspec: GObject.ParamSpec) => void; "notify::stock-id": (pspec: GObject.ParamSpec) => void; "notify::tooltip": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::visible-horizontal": (pspec: GObject.ParamSpec) => void; "notify::visible-overflown": (pspec: GObject.ParamSpec) => void; "notify::visible-vertical": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps { action_group: ActionGroup; actionGroup: ActionGroup; always_show_image: boolean; alwaysShowImage: boolean; gicon: Gio.Icon; hide_if_empty: boolean; hideIfEmpty: boolean; icon_name: string; iconName: string; is_important: boolean; isImportant: boolean; label: string; name: string; sensitive: boolean; short_label: string; shortLabel: string; stock_id: string; stockId: string; tooltip: string; visible: boolean; visible_horizontal: boolean; visibleHorizontal: boolean; visible_overflown: boolean; visibleOverflown: boolean; visible_vertical: boolean; visibleVertical: boolean; } } /** * > In GTK+ 3.10, GtkAction has been deprecated. Use {@link Gio.Action} * > instead, and associate actions with {@link Gtk.Actionable} widgets. Use * > {@link Gio.MenuModel} for creating menus with `gtk_menu_new_from_model()`. * * Actions represent operations that the user can be perform, along with * some information how it should be presented in the interface. Each action * provides methods to create icons, menu items and toolbar items * representing itself. * * As well as the callback that is called when the action gets activated, * the following also gets associated with the action: * * - a name (not translated, for path lookup) * * - a label (translated, for display) * * - an accelerator * * - whether label indicates a stock id * * - a tooltip (optional, translated) * * - a toolbar label (optional, shorter than label) * * * The action will also have some state information: * * - visible (shown/hidden) * * - sensitive (enabled/disabled) * * Apart from regular actions, there are [toggle actions][GtkToggleAction], * which can be toggled between two states and * [radio actions][GtkRadioAction], of which only one in a group * can be in the “active” state. Other actions can be implemented as {@link Gtk.Action} * subclasses. * * Each action can have one or more proxy widgets. To act as an action proxy, * widget needs to implement {@link Gtk.Activatable} interface. Proxies mirror the state * of the action and should change when the action’s state changes. Properties * that are always mirrored by proxies are {@link Gtk.Action.sensitive} and * {@link Gtk.Action.visible}. {@link Gtk.Action.gicon}, {@link Gtk.Action.icon_name}, {@link Gtk.Action.label}, * {@link Gtk.Action.short_label} and {@link Gtk.Action.stock_id} properties are only mirorred * if proxy widget has {@link Gtk.Activatable.use_action_appearance} property set to * `true`. * * When the proxy is activated, it should activate its action. * @gir-type Class */ class Action extends GObject.Object implements Buildable { static $gtype: GObject.GType; // Properties /** * The GtkActionGroup this GtkAction is associated with, or NULL * (for internal use). * @deprecated since 3.10: Lookup the {@link Gio.Action} using `g_action_map_lookup_action()` instead */ get action_group(): ActionGroup; set action_group(val: ActionGroup); /** * The GtkActionGroup this GtkAction is associated with, or NULL * (for internal use). * @deprecated since 3.10: Lookup the {@link Gio.Action} using `g_action_map_lookup_action()` instead */ get actionGroup(): ActionGroup; set actionGroup(val: ActionGroup); /** * If `true`, the action's menu item proxies will ignore the {@link Gtk.Settings.gtk_menu_images} * setting and always show their image, if available. * * Use this property if the menu item would be useless or hard to use * without their image. * @since 2.20 * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default false */ get always_show_image(): boolean; set always_show_image(val: boolean); /** * If `true`, the action's menu item proxies will ignore the {@link Gtk.Settings.gtk_menu_images} * setting and always show their image, if available. * * Use this property if the menu item would be useless or hard to use * without their image. * @since 2.20 * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default false */ get alwaysShowImage(): boolean; set alwaysShowImage(val: boolean); /** * The {@link Gio.Icon} displayed in the {@link Gtk.Action}. * * Note that the stock icon is preferred, if the {@link Gtk.Action.stock_id} * property holds the id of an existing stock icon. * * This is an appearance property and thus only applies if * {@link Gtk.Activatable.use_action_appearance} is `true`. * @since 2.16 * @deprecated since 3.10: Use the "icon" attribute on a {@link Gio.MenuItem} instead */ get gicon(): Gio.Icon; set gicon(val: Gio.Icon); /** * When TRUE, empty menu proxies for this action are hidden. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get hide_if_empty(): boolean; set hide_if_empty(val: boolean); /** * When TRUE, empty menu proxies for this action are hidden. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get hideIfEmpty(): boolean; set hideIfEmpty(val: boolean); /** * The name of the icon from the icon theme. * * Note that the stock icon is preferred, if the {@link Gtk.Action.stock_id} * property holds the id of an existing stock icon, and the {@link Gio.Icon} is * preferred if the {@link Gtk.Action.gicon} property is set. * * This is an appearance property and thus only applies if * {@link Gtk.Activatable.use_action_appearance} is `true`. * @since 2.10 * @deprecated since 3.10: Use the "icon" attribute on a {@link Gio.MenuItem} instead * @default null */ get icon_name(): string; set icon_name(val: string); /** * The name of the icon from the icon theme. * * Note that the stock icon is preferred, if the {@link Gtk.Action.stock_id} * property holds the id of an existing stock icon, and the {@link Gio.Icon} is * preferred if the {@link Gtk.Action.gicon} property is set. * * This is an appearance property and thus only applies if * {@link Gtk.Activatable.use_action_appearance} is `true`. * @since 2.10 * @deprecated since 3.10: Use the "icon" attribute on a {@link Gio.MenuItem} instead * @default null */ get iconName(): string; set iconName(val: string); /** * Whether the action is considered important. When TRUE, toolitem * proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default false */ get is_important(): boolean; set is_important(val: boolean); /** * Whether the action is considered important. When TRUE, toolitem * proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default false */ get isImportant(): boolean; set isImportant(val: boolean); /** * The label used for menu items and buttons that activate * this action. If the label is `null`, GTK+ uses the stock * label specified via the stock-id property. * * This is an appearance property and thus only applies if * {@link Gtk.Activatable.use_action_appearance} is `true`. * @deprecated since 3.10: Use the "label" attribute on {@link Gio.MenuItem} instead * @default null */ get label(): string; set label(val: string); /** * A unique name for the action. * @deprecated since 3.10: Use {@link Gio.Action.name} instead * @construct-only * @default null */ get name(): string; /** * Whether the action is enabled. * @deprecated since 3.10: Use {@link Gio.Action.enabled} and {@link Gio.SimpleAction.enabled} instead * @default true */ get sensitive(): boolean; set sensitive(val: boolean); /** * A shorter label that may be used on toolbar buttons. * * This is an appearance property and thus only applies if * {@link Gtk.Activatable.use_action_appearance} is `true`. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default null */ get short_label(): string; set short_label(val: string); /** * A shorter label that may be used on toolbar buttons. * * This is an appearance property and thus only applies if * {@link Gtk.Activatable.use_action_appearance} is `true`. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default null */ get shortLabel(): string; set shortLabel(val: string); /** * The stock icon displayed in widgets representing this action. * * This is an appearance property and thus only applies if * {@link Gtk.Activatable.use_action_appearance} is `true`. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default null */ get stock_id(): string; set stock_id(val: string); /** * The stock icon displayed in widgets representing this action. * * This is an appearance property and thus only applies if * {@link Gtk.Activatable.use_action_appearance} is `true`. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default null */ get stockId(): string; set stockId(val: string); /** * A tooltip for this action. * @deprecated since 3.10: Use `gtk_widget_set_tooltip_text()` instead * @default null */ get tooltip(): string; set tooltip(val: string); /** * Whether the action is visible. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get visible(): boolean; set visible(val: boolean); /** * Whether the toolbar item is visible when the toolbar is in a horizontal orientation. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get visible_horizontal(): boolean; set visible_horizontal(val: boolean); /** * Whether the toolbar item is visible when the toolbar is in a horizontal orientation. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get visibleHorizontal(): boolean; set visibleHorizontal(val: boolean); /** * When `true`, toolitem proxies for this action are represented in the * toolbar overflow menu. * @since 2.6 * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get visible_overflown(): boolean; set visible_overflown(val: boolean); /** * When `true`, toolitem proxies for this action are represented in the * toolbar overflow menu. * @since 2.6 * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get visibleOverflown(): boolean; set visibleOverflown(val: boolean); /** * Whether the toolbar item is visible when the toolbar is in a vertical orientation. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get visible_vertical(): boolean; set visible_vertical(val: boolean); /** * Whether the toolbar item is visible when the toolbar is in a vertical orientation. * @deprecated since 3.10: There is no corresponding replacement when using {@link Gio.Action} * @default true */ get visibleVertical(): boolean; set visibleVertical(val: boolean); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Action.SignalSignatures; // Fields object: GObject.Object; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](name: string, label: string | null, tooltip: string | null, stock_id: string | null): Action; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * Emits the “activate” signal on the specified action, if it isn't * insensitive. This gets called by the proxy widgets when they get * activated. * * It can also be used to manually activate an action. * @virtual */ vfunc_activate(): void; /** * @param proxy * @virtual */ vfunc_connect_proxy(proxy: Widget): void; /** * If `action` provides a {@link Gtk.Menu} widget as a submenu for the menu * item or the toolbar item it creates, this function returns an * instance of that menu. * @virtual */ vfunc_create_menu(): Widget; /** * Creates a menu item widget that proxies for the given action. * @virtual */ vfunc_create_menu_item(): Widget; /** * Creates a toolbar item widget that proxies for the given action. * @virtual */ vfunc_create_tool_item(): Widget; /** * @param proxy * @virtual */ vfunc_disconnect_proxy(proxy: Widget): void; // Methods /** * Emits the “activate” signal on the specified action, if it isn't * insensitive. This gets called by the proxy widgets when they get * activated. * * It can also be used to manually activate an action. */ activate(): void; /** * Disable activation signals from the action * * This is needed when updating the state of your proxy * {@link Gtk.Activatable} widget could result in calling `gtk_action_activate()`, * this is a convenience function to avoid recursing in those * cases (updating toggle state for instance). */ block_activate(): void; /** * Installs the accelerator for `action` if `action` has an * accel path and group. See `gtk_action_set_accel_path()` and * `gtk_action_set_accel_group()` * * Since multiple proxies may independently trigger the installation * of the accelerator, the `action` counts the number of times this * function has been called and doesn’t remove the accelerator until * `gtk_action_disconnect_accelerator()` has been called as many times. */ connect_accelerator(): void; /** * This function is intended for use by action implementations to * create icons displayed in the proxy widgets. * @param icon_size the size of the icon ({@link Gtk.IconSize}) that should be created. * @returns a widget that displays the icon for this action. */ create_icon(icon_size: number): Widget; /** * If `action` provides a {@link Gtk.Menu} widget as a submenu for the menu * item or the toolbar item it creates, this function returns an * instance of that menu. * @returns the menu item provided by the action, or `null`. */ create_menu(): Widget; /** * Creates a menu item widget that proxies for the given action. * @returns a menu item connected to the action. */ create_menu_item(): Widget; /** * Creates a toolbar item widget that proxies for the given action. * @returns a toolbar item connected to the action. */ create_tool_item(): Widget; /** * Undoes the effect of one call to `gtk_action_connect_accelerator()`. */ disconnect_accelerator(): void; /** * Returns the accel closure for this action. * @returns the accel closure for this action. The returned closure is owned by GTK+ and must not be unreffed or modified. */ get_accel_closure(): GObject.Closure; /** * Returns the accel path for this action. * @returns the accel path for this action, or `null` if none is set. The returned string is owned by GTK+ and must not be freed or modified. */ get_accel_path(): string; /** * Returns whether `action`'s menu item proxies will always * show their image, if available. * @returns `true` if the menu item proxies will always show their image */ get_always_show_image(): boolean; /** * Gets the gicon of `action`. * @returns The action’s {@link Gio.Icon} if one is set. */ get_gicon(): Gio.Icon; /** * Gets the icon name of `action`. * @returns the icon name */ get_icon_name(): string; /** * Checks whether `action` is important or not * @returns whether `action` is important */ get_is_important(): boolean; /** * Gets the label text of `action`. * @returns the label text */ get_label(): string; /** * Returns the name of the action. * @returns the name of the action. The string belongs to GTK+ and should not be freed. */ get_name(): string; /** * Returns the proxy widgets for an action. * See also `gtk_activatable_get_related_action()`. * @returns a {@link GLib.SList} of proxy widgets. The list is owned by GTK+ and must not be modified. */ get_proxies(): Widget[]; /** * Returns whether the action itself is sensitive. Note that this doesn’t * necessarily mean effective sensitivity. See `gtk_action_is_sensitive()` * for that. * @returns `true` if the action itself is sensitive. */ get_sensitive(): boolean; /** * Gets the short label text of `action`. * @returns the short label text. */ get_short_label(): string; /** * Gets the stock id of `action`. * @returns the stock id */ get_stock_id(): string; /** * Gets the tooltip text of `action`. * @returns the tooltip text */ get_tooltip(): string; /** * Returns whether the action itself is visible. Note that this doesn’t * necessarily mean effective visibility. See `gtk_action_is_sensitive()` * for that. * @returns `true` if the action itself is visible. */ get_visible(): boolean; /** * Checks whether `action` is visible when horizontal * @returns whether `action` is visible when horizontal */ get_visible_horizontal(): boolean; /** * Checks whether `action` is visible when horizontal * @returns whether `action` is visible when horizontal */ get_visible_vertical(): boolean; /** * Returns whether the action is effectively sensitive. * @returns `true` if the action and its associated action group are both sensitive. */ is_sensitive(): boolean; /** * Returns whether the action is effectively visible. * @returns `true` if the action and its associated action group are both visible. */ is_visible(): boolean; /** * Sets the {@link Gtk.AccelGroup} in which the accelerator for this action * will be installed. * @param accel_group a {@link Gtk.AccelGroup} or `null` */ set_accel_group(accel_group: AccelGroup | null): void; /** * Sets the accel path for this action. All proxy widgets associated * with the action will have this accel path, so that their * accelerators are consistent. * * Note that `accel_path` string will be stored in a {@link GLib.Quark}. Therefore, if you * pass a static string, you can save some memory by interning it first with * `g_intern_static_string()`. * @param accel_path the accelerator path */ set_accel_path(accel_path: string): void; /** * Sets whether `action`'s menu item proxies will ignore the * {@link Gtk.Settings.gtk_menu_images} setting and always show their image, if available. * * Use this if the menu item would be useless or hard to use * without their image. * @param always_show `true` if menuitem proxies should always show their image */ set_always_show_image(always_show: boolean): void; /** * Sets the icon of `action`. * @param icon the {@link Gio.Icon} to set */ set_gicon(icon: Gio.Icon): void; /** * Sets the icon name on `action` * @param icon_name the icon name to set */ set_icon_name(icon_name: string): void; /** * Sets whether the action is important, this attribute is used * primarily by toolbar items to decide whether to show a label * or not. * @param is_important `true` to make the action important */ set_is_important(is_important: boolean): void; /** * Sets the label of `action`. * @param label the label text to set */ set_label(label: string): void; /** * Sets the :sensitive property of the action to `sensitive`. Note that * this doesn’t necessarily mean effective sensitivity. See * `gtk_action_is_sensitive()` * for that. * @param sensitive `true` to make the action sensitive */ set_sensitive(sensitive: boolean): void; /** * Sets a shorter label text on `action`. * @param short_label the label text to set */ set_short_label(short_label: string): void; /** * Sets the stock id on `action` * @param stock_id the stock id */ set_stock_id(stock_id: string): void; /** * Sets the tooltip text on `action` * @param tooltip the tooltip text */ set_tooltip(tooltip: string): void; /** * Sets the :visible property of the action to `visible`. Note that * this doesn’t necessarily mean effective visibility. See * `gtk_action_is_visible()` * for that. * @param visible `true` to make the action visible */ set_visible(visible: boolean): void; /** * Sets whether `action` is visible when horizontal * @param visible_horizontal whether the action is visible horizontally */ set_visible_horizontal(visible_horizontal: boolean): void; /** * Sets whether `action` is visible when vertical * @param visible_vertical whether the action is visible vertically */ set_visible_vertical(visible_vertical: boolean): void; /** * Reenable activation signals from the action */ unblock_activate(): void; /** * Adds a child to `buildable`. `type` is an optional string * describing how the child should be added. * @param builder a {@link Gtk.Builder} * @param child child to add * @param type kind of child or `null` */ add_child(builder: Builder, child: GObject.Object, type: string | null): void; /** * Constructs a child of `buildable` with the name `name`. * * {@link Gtk.Builder} calls this function if a “constructor” has been * specified in the UI definition. * @param builder {@link Gtk.Builder} used to construct this object * @param name name of child to construct * @returns the constructed child */ construct_child(builder: Builder, name: string): T; /** * This is similar to `gtk_buildable_parser_finished()` but is * called once for each custom tag handled by the `buildable`. * @param builder a {@link Gtk.Builder} * @param child child object or `null` for non-child tags * @param tagname the name of the tag * @param data user data created in custom_tag_start */ custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data: null): void; /** * This is called at the end of each custom element handled by * the buildable. * @param builder {@link Gtk.Builder} used to construct this object * @param child child object or `null` for non-child tags * @param tagname name of tag * @param data user data that will be passed in to parser functions */ custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data: null): void; /** * This is called for each unknown element under ``. * @param builder a {@link Gtk.Builder} used to construct this object * @param child child object or `null` for non-child tags * @param tagname name of tag * @returns `true` if a object has a custom implementation, `false` if it doesn't. */ custom_tag_start(builder: Builder, child: GObject.Object | null, tagname: string): [boolean, GLib.MarkupParser, null]; /** * Get the internal child called `childname` of the `buildable` object. * @param builder a {@link Gtk.Builder} * @param childname name of child * @returns the internal child of the buildable object */ get_internal_child(builder: Builder, childname: string): T; /** * Called when the builder finishes the parsing of a * [GtkBuilder UI definition][BUILDER-UI]. * Note that this will be called once for each time * `gtk_builder_add_from_file()` or `gtk_builder_add_from_string()` * is called on a builder. * @param builder a {@link Gtk.Builder} */ parser_finished(builder: Builder): void; /** * Sets the property name `name` to `value` on the `buildable` object. * @param builder a {@link Gtk.Builder} * @param name name of property * @param value value of property */ set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void; /** * Sets the name of the `buildable` object. * @param name name to set */ set_name(name: string): void; /** * Adds a child to `buildable`. `type` is an optional string * describing how the child should be added. * @param builder a {@link Gtk.Builder} * @param child child to add * @param type kind of child or `null` * @virtual */ vfunc_add_child(builder: Builder, child: GObject.Object, type: string | null): void; /** * Constructs a child of `buildable` with the name `name`. * * {@link Gtk.Builder} calls this function if a “constructor” has been * specified in the UI definition. * @param builder {@link Gtk.Builder} used to construct this object * @param name name of child to construct * @virtual */ vfunc_construct_child(builder: Builder, name: string): T; /** * This is similar to `gtk_buildable_parser_finished()` but is * called once for each custom tag handled by the `buildable`. * @param builder a {@link Gtk.Builder} * @param child child object or `null` for non-child tags * @param tagname the name of the tag * @param data user data created in custom_tag_start * @virtual */ vfunc_custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data: null): void; /** * This is called at the end of each custom element handled by * the buildable. * @param builder {@link Gtk.Builder} used to construct this object * @param child child object or `null` for non-child tags * @param tagname name of tag * @param data user data that will be passed in to parser functions * @virtual */ vfunc_custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data: null): void; /** * This is called for each unknown element under ``. * @param builder a {@link Gtk.Builder} used to construct this object * @param child child object or `null` for non-child tags * @param tagname name of tag * @virtual */ vfunc_custom_tag_start(builder: Builder, child: GObject.Object | null, tagname: string): [boolean, GLib.MarkupParser, never]; /** * Get the internal child called `childname` of the `buildable` object. * @param builder a {@link Gtk.Builder} * @param childname name of child * @virtual */ vfunc_get_internal_child(builder: Builder, childname: string): T; /** * Gets the name of the `buildable` object. * * {@link Gtk.Builder} sets the name based on the * [GtkBuilder UI definition][BUILDER-UI] * used to construct the `buildable`. * @virtual */ vfunc_get_name(): string; /** * Called when the builder finishes the parsing of a * [GtkBuilder UI definition][BUILDER-UI]. * Note that this will be called once for each time * `gtk_builder_add_from_file()` or `gtk_builder_add_from_string()` * is called on a builder. * @param builder a {@link Gtk.Builder} * @virtual */ vfunc_parser_finished(builder: Builder): void; /** * Sets the property name `name` to `value` on the `buildable` object. * @param builder a {@link Gtk.Builder} * @param name name of property * @param value value of property * @virtual */ vfunc_set_buildable_property(builder: Builder, name: string, value: unknown): void; /** * Sets the name of the `buildable` object. * @param name name to set * @virtual */ vfunc_set_name(name: string): void; } namespace ActionBar { // Signal signatures interface SignalSignatures extends Bin.SignalSignatures { "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Bin.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps {} } /** * GtkActionBar is designed to present contextual actions. It is * expected to be displayed below the content and expand horizontally * to fill the area. * * It allows placing children at the start or the end. In addition, it * contains an internal centered box which is centered with respect to * the full width of the box, even if the children at either side take * up different amounts of space. * * # CSS nodes * * GtkActionBar has a single CSS node with name actionbar. * @gir-type Class */ class ActionBar extends Bin implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: ActionBar.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](): ActionBar; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Retrieves the center bar widget of the bar. * @returns the center {@link Gtk.Widget} or `null`. */ get_center_widget(): Widget | null; /** * Adds `child` to `action_bar`, packed with reference to the * end of the `action_bar`. * @param child the {@link Gtk.Widget} to be added to `action_bar` */ pack_end(child: Widget): void; /** * Adds `child` to `action_bar`, packed with reference to the * start of the `action_bar`. * @param child the {@link Gtk.Widget} to be added to `action_bar` */ pack_start(child: Widget): void; /** * Sets the center widget for the {@link Gtk.ActionBar}. * @param center_widget a widget to use for the center */ set_center_widget(center_widget: Widget | null): void; } namespace ActionGroup { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { /** * The ::connect-proxy signal is emitted after connecting a proxy to * an action in the group. Note that the proxy may have been connected * to a different action before. * * This is intended for simple customizations for which a custom action * class would be too clumsy, e.g. showing tooltips for menuitems in the * statusbar. * * {@link Gtk.UIManager} proxies the signal and provides global notification * just before any action is connected to a proxy, which is probably more * convenient to use. * @signal * @since 2.4 * @deprecated since 3.10 */ "connect-proxy": (arg0: Action, arg1: Widget) => void; /** * The ::disconnect-proxy signal is emitted after disconnecting a proxy * from an action in the group. * * {@link Gtk.UIManager} proxies the signal and provides global notification * just before any action is connected to a proxy, which is probably more * convenient to use. * @signal * @since 2.4 * @deprecated since 3.10 */ "disconnect-proxy": (arg0: Action, arg1: Widget) => void; /** * The ::post-activate signal is emitted just after the `action` in the * `action_group` is activated * * This is intended for {@link Gtk.UIManager} to proxy the signal and provide global * notification just after any action is activated. * @signal * @since 2.4 * @deprecated since 3.10 */ "post-activate": (arg0: Action) => void; /** * The ::pre-activate signal is emitted just before the `action` in the * `action_group` is activated * * This is intended for {@link Gtk.UIManager} to proxy the signal and provide global * notification just before any action is activated. * @signal * @since 2.4 * @deprecated since 3.10 */ "pre-activate": (arg0: Action) => void; "notify::accel-group": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps { accel_group: AccelGroup; accelGroup: AccelGroup; name: string; sensitive: boolean; visible: boolean; } } /** * Actions are organised into groups. An action group is essentially a * map from names to {@link Gtk.Action} objects. * * All actions that would make sense to use in a particular context * should be in a single group. Multiple action groups may be used for a * particular user interface. In fact, it is expected that most nontrivial * applications will make use of multiple groups. For example, in an * application that can edit multiple documents, one group holding global * actions (e.g. quit, about, new), and one group per document holding * actions that act on that document (eg. save, cut/copy/paste, etc). Each * window’s menus would be constructed from a combination of two action * groups. * * ## Accelerators ## {{@link Gtk.Action}-Accel} * * Accelerators are handled by the GTK+ accelerator map. All actions are * assigned an accelerator path (which normally has the form * `/group-name/action-name`) and a shortcut is associated with * this accelerator path. All menuitems and toolitems take on this accelerator * path. The GTK+ accelerator map code makes sure that the correct shortcut * is displayed next to the menu item. * * # GtkActionGroup as GtkBuildable # {{@link Gtk.ActionGroup}-BUILDER-UI} * * The {@link Gtk.ActionGroup} implementation of the {@link Gtk.Buildable} interface accepts * {@link Gtk.Action} objects as `` elements in UI definitions. * * Note that it is probably more common to define actions and action groups * in the code, since they are directly related to what the code can do. * * The GtkActionGroup implementation of the GtkBuildable interface supports * a custom `` element, which has attributes named “key“ and * “modifiers“ and allows to specify accelerators. This is similar to the * `` element of {@link Gtk.Widget}, the main difference is that * it doesn’t allow you to specify a signal. * * ## A {@link Gtk.Dialog} UI definition fragment. ## * * * ```xml * * * * About * gtk-about * * * * * * ``` * * @gir-type Class */ class ActionGroup extends GObject.Object implements Buildable { static $gtype: GObject.GType; // Properties /** * The accelerator group the actions of this group should use. * @deprecated since 3.10 */ get accel_group(): AccelGroup; set accel_group(val: AccelGroup); /** * The accelerator group the actions of this group should use. * @deprecated since 3.10 */ get accelGroup(): AccelGroup; set accelGroup(val: AccelGroup); /** * A name for the action. * @deprecated since 3.10 * @construct-only * @default null */ get name(): string; /** * Whether the action group is enabled. * @deprecated since 3.10 * @default true */ get sensitive(): boolean; set sensitive(val: boolean); /** * Whether the action group is visible. * @deprecated since 3.10 * @default true */ get visible(): boolean; set visible(val: boolean); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: ActionGroup.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](name: string): ActionGroup; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * Looks up an action in the action group by name. * @param action_name the name of the action * @virtual */ vfunc_get_action(action_name: string): Action; // Methods /** * Adds an action object to the action group. Note that this function * does not set up the accel path of the action, which can lead to problems * if a user tries to modify the accelerator of a menuitem associated with * the action. Therefore you must either set the accel path yourself with * `gtk_action_set_accel_path()`, or use * `gtk_action_group_add_action_with_accel (..., NULL)`. * @param action an action */ add_action(action: Action): void; /** * Adds an action object to the action group and sets up the accelerator. * * If `accelerator` is `null`, attempts to use the accelerator associated * with the stock_id of the action. * * Accel paths are set to `/group-name/action-name`. * @param action the action to add * @param accelerator the accelerator for the action, in the format understood by `gtk_accelerator_parse()`, or "" for no accelerator, or `null` to use the stock accelerator */ add_action_with_accel(action: Action, accelerator: string | null): void; /** * Gets the accelerator group. * @returns the accelerator group associated with this action group or `null` if there is none. */ get_accel_group(): AccelGroup; /** * Looks up an action in the action group by name. * @param action_name the name of the action * @returns the action, or `null` if no action by that name exists */ get_action(action_name: string): Action; /** * Gets the name of the action group. * @returns the name of the action group. */ get_name(): string; /** * Returns `true` if the group is sensitive. The constituent actions * can only be logically sensitive (see `gtk_action_is_sensitive()`) if * they are sensitive (see `gtk_action_get_sensitive()`) and their group * is sensitive. * @returns `true` if the group is sensitive. */ get_sensitive(): boolean; /** * Returns `true` if the group is visible. The constituent actions * can only be logically visible (see `gtk_action_is_visible()`) if * they are visible (see `gtk_action_get_visible()`) and their group * is visible. * @returns `true` if the group is visible. */ get_visible(): boolean; /** * Lists the actions in the action group. * @returns an allocated list of the action objects in the action group */ list_actions(): Action[]; /** * Removes an action object from the action group. * @param action an action */ remove_action(action: Action): void; /** * Sets the accelerator group to be used by every action in this group. * @param accel_group a {@link Gtk.AccelGroup} to set or `null` */ set_accel_group(accel_group: AccelGroup | null): void; /** * Changes the sensitivity of `action_group` * @param sensitive new sensitivity */ set_sensitive(sensitive: boolean): void; /** * Sets a function to be used for translating the `label` and `tooltip` of * `GtkActionEntrys` added by `gtk_action_group_add_actions()`. * * If you’re using `gettext()`, it is enough to set the translation domain * with `gtk_action_group_set_translation_domain()`. * @param func a {@link Gtk.TranslateFunc} */ set_translate_func(func: TranslateFunc): void; /** * Sets the translation domain and uses `g_dgettext()` for translating the * `label` and `tooltip` of `GtkActionEntrys` added by * `gtk_action_group_add_actions()`. * * If you’re not using `gettext()` for localization, see * `gtk_action_group_set_translate_func()`. * @param domain the translation domain to use for `g_dgettext()` calls, or `null` to use the domain set with `textdomain()` */ set_translation_domain(domain: string | null): void; /** * Changes the visible of `action_group`. * @param visible new visiblity */ set_visible(visible: boolean): void; /** * Translates a string using the function set with * `gtk_action_group_set_translate_func()`. This * is mainly intended for language bindings. * @param string a string * @returns the translation of `string` */ translate_string(string: string): string; /** * Adds a child to `buildable`. `type` is an optional string * describing how the child should be added. * @param builder a {@link Gtk.Builder} * @param child child to add * @param type kind of child or `null` */ add_child(builder: Builder, child: GObject.Object, type: string | null): void; /** * Constructs a child of `buildable` with the name `name`. * * {@link Gtk.Builder} calls this function if a “constructor” has been * specified in the UI definition. * @param builder {@link Gtk.Builder} used to construct this object * @param name name of child to construct * @returns the constructed child */ construct_child(builder: Builder, name: string): T; /** * This is similar to `gtk_buildable_parser_finished()` but is * called once for each custom tag handled by the `buildable`. * @param builder a {@link Gtk.Builder} * @param child child object or `null` for non-child tags * @param tagname the name of the tag * @param data user data created in custom_tag_start */ custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data: null): void; /** * This is called at the end of each custom element handled by * the buildable. * @param builder {@link Gtk.Builder} used to construct this object * @param child child object or `null` for non-child tags * @param tagname name of tag * @param data user data that will be passed in to parser functions */ custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data: null): void; /** * This is called for each unknown element under ``. * @param builder a {@link Gtk.Builder} used to construct this object * @param child child object or `null` for non-child tags * @param tagname name of tag * @returns `true` if a object has a custom implementation, `false` if it doesn't. */ custom_tag_start(builder: Builder, child: GObject.Object | null, tagname: string): [boolean, GLib.MarkupParser, null]; /** * Get the internal child called `childname` of the `buildable` object. * @param builder a {@link Gtk.Builder} * @param childname name of child * @returns the internal child of the buildable object */ get_internal_child(builder: Builder, childname: string): T; /** * Called when the builder finishes the parsing of a * [GtkBuilder UI definition][BUILDER-UI]. * Note that this will be called once for each time * `gtk_builder_add_from_file()` or `gtk_builder_add_from_string()` * is called on a builder. * @param builder a {@link Gtk.Builder} */ parser_finished(builder: Builder): void; /** * Sets the property name `name` to `value` on the `buildable` object. * @param builder a {@link Gtk.Builder} * @param name name of property * @param value value of property */ set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void; /** * Sets the name of the `buildable` object. * @param name name to set */ set_name(name: string): void; /** * Adds a child to `buildable`. `type` is an optional string * describing how the child should be added. * @param builder a {@link Gtk.Builder} * @param child child to add * @param type kind of child or `null` * @virtual */ vfunc_add_child(builder: Builder, child: GObject.Object, type: string | null): void; /** * Constructs a child of `buildable` with the name `name`. * * {@link Gtk.Builder} calls this function if a “constructor” has been * specified in the UI definition. * @param builder {@link Gtk.Builder} used to construct this object * @param name name of child to construct * @virtual */ vfunc_construct_child(builder: Builder, name: string): T; /** * This is similar to `gtk_buildable_parser_finished()` but is * called once for each custom tag handled by the `buildable`. * @param builder a {@link Gtk.Builder} * @param child child object or `null` for non-child tags * @param tagname the name of the tag * @param data user data created in custom_tag_start * @virtual */ vfunc_custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data: null): void; /** * This is called at the end of each custom element handled by * the buildable. * @param builder {@link Gtk.Builder} used to construct this object * @param child child object or `null` for non-child tags * @param tagname name of tag * @param data user data that will be passed in to parser functions * @virtual */ vfunc_custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data: null): void; /** * This is called for each unknown element under ``. * @param builder a {@link Gtk.Builder} used to construct this object * @param child child object or `null` for non-child tags * @param tagname name of tag * @virtual */ vfunc_custom_tag_start(builder: Builder, child: GObject.Object | null, tagname: string): [boolean, GLib.MarkupParser, never]; /** * Get the internal child called `childname` of the `buildable` object. * @param builder a {@link Gtk.Builder} * @param childname name of child * @virtual */ vfunc_get_internal_child(builder: Builder, childname: string): T; /** * Gets the name of the `buildable` object. * * {@link Gtk.Builder} sets the name based on the * [GtkBuilder UI definition][BUILDER-UI] * used to construct the `buildable`. * @virtual */ vfunc_get_name(): string; /** * Called when the builder finishes the parsing of a * [GtkBuilder UI definition][BUILDER-UI]. * Note that this will be called once for each time * `gtk_builder_add_from_file()` or `gtk_builder_add_from_string()` * is called on a builder. * @param builder a {@link Gtk.Builder} * @virtual */ vfunc_parser_finished(builder: Builder): void; /** * Sets the property name `name` to `value` on the `buildable` object. * @param builder a {@link Gtk.Builder} * @param name name of property * @param value value of property * @virtual */ vfunc_set_buildable_property(builder: Builder, name: string, value: unknown): void; /** * Sets the name of the `buildable` object. * @param name name to set * @virtual */ vfunc_set_name(name: string): void; } namespace Adjustment { // Signal signatures interface SignalSignatures extends GObject.InitiallyUnowned.SignalSignatures { /** * Emitted when one or more of the {@link Gtk.Adjustment} properties have been * changed, other than the {@link Gtk.Adjustment.value} property. * @signal * @run-first */ changed: () => void; /** * Emitted when the {@link Gtk.Adjustment.value} property has been changed. * @signal * @run-first */ "value-changed": () => void; "notify::lower": (pspec: GObject.ParamSpec) => void; "notify::page-increment": (pspec: GObject.ParamSpec) => void; "notify::page-size": (pspec: GObject.ParamSpec) => void; "notify::step-increment": (pspec: GObject.ParamSpec) => void; "notify::upper": (pspec: GObject.ParamSpec) => void; "notify::value": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.InitiallyUnowned.ConstructorProps { lower: number; page_increment: number; pageIncrement: number; page_size: number; pageSize: number; step_increment: number; stepIncrement: number; upper: number; value: number; } } /** * The {@link Gtk.Adjustment} object represents a value which has an associated lower * and upper bound, together with step and page increments, and a page size. * It is used within several GTK+ widgets, including {@link Gtk.SpinButton}, {@link Gtk.Viewport}, * and {@link Gtk.Range} (which is a base class for {@link Gtk.Scrollbar} and {@link Gtk.Scale}). * * The {@link Gtk.Adjustment} object does not update the value itself. Instead * it is left up to the owner of the {@link Gtk.Adjustment} to control the value. * @gir-type Class */ class Adjustment extends GObject.InitiallyUnowned { static $gtype: GObject.GType; // Properties /** * The minimum value of the adjustment. * @since 2.4 * @default 0 */ get lower(): number; set lower(val: number); /** * The page increment of the adjustment. * @since 2.4 * @default 0 */ get page_increment(): number; set page_increment(val: number); /** * The page increment of the adjustment. * @since 2.4 * @default 0 */ get pageIncrement(): number; set pageIncrement(val: number); /** * The page size of the adjustment. * Note that the page-size is irrelevant and should be set to zero * if the adjustment is used for a simple scalar value, e.g. in a * {@link Gtk.SpinButton}. * @since 2.4 * @default 0 */ get page_size(): number; set page_size(val: number); /** * The page size of the adjustment. * Note that the page-size is irrelevant and should be set to zero * if the adjustment is used for a simple scalar value, e.g. in a * {@link Gtk.SpinButton}. * @since 2.4 * @default 0 */ get pageSize(): number; set pageSize(val: number); /** * The step increment of the adjustment. * @since 2.4 * @default 0 */ get step_increment(): number; set step_increment(val: number); /** * The step increment of the adjustment. * @since 2.4 * @default 0 */ get stepIncrement(): number; set stepIncrement(val: number); /** * The maximum value of the adjustment. * Note that values will be restricted by * `upper - page-size` if the page-size * property is nonzero. * @since 2.4 * @default 0 */ get upper(): number; set upper(val: number); /** * The value of the adjustment. * @since 2.4 * @default 0 */ get value(): number; set value(val: number); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Adjustment.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](value: number, lower: number, upper: number, step_increment: number, page_increment: number, page_size: number): Adjustment; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * Emits a {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} signal from the {@link Gtk.Adjustment}. * This is typically called by the owner of the {@link Gtk.Adjustment} after it has * changed any of the {@link Gtk.Adjustment} properties other than the value. * @virtual */ vfunc_changed(): void; /** * Emits a {@link Gtk.Adjustment.SignalSignatures.value_changed | Gtk.Adjustment::value-changed} signal from the {@link Gtk.Adjustment}. * This is typically called by the owner of the {@link Gtk.Adjustment} after it has * changed the {@link Gtk.Adjustment.value} property. * @virtual */ vfunc_value_changed(): void; // Methods /** * Emits a {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} signal from the {@link Gtk.Adjustment}. * This is typically called by the owner of the {@link Gtk.Adjustment} after it has * changed any of the {@link Gtk.Adjustment} properties other than the value. */ changed(): void; /** * Updates the {@link Gtk.Adjustment.value} property to ensure that the range * between `lower` and `upper` is in the current page (i.e. between * {@link Gtk.Adjustment.value} and {@link Gtk.Adjustment.value} + {@link Gtk.Adjustment.page_size}). * If the range is larger than the page size, then only the start of it will * be in the current page. * * A {@link Gtk.Adjustment.SignalSignatures.value_changed | Gtk.Adjustment::value-changed} signal will be emitted if the value is changed. * @param lower the lower value * @param upper the upper value */ clamp_page(lower: number, upper: number): void; /** * Sets all properties of the adjustment at once. * * Use this function to avoid multiple emissions of the * {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} signal. See `gtk_adjustment_set_lower()` * for an alternative way of compressing multiple emissions of * {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} into one. * @param value the new value * @param lower the new minimum value * @param upper the new maximum value * @param step_increment the new step increment * @param page_increment the new page increment * @param page_size the new page size */ configure(value: number, lower: number, upper: number, step_increment: number, page_increment: number, page_size: number): void; /** * Retrieves the minimum value of the adjustment. * @returns The current minimum value of the adjustment */ get_lower(): number; /** * Gets the smaller of step increment and page increment. * @returns the minimum increment of `adjustment` */ get_minimum_increment(): number; /** * Retrieves the page increment of the adjustment. * @returns The current page increment of the adjustment */ get_page_increment(): number; /** * Retrieves the page size of the adjustment. * @returns The current page size of the adjustment */ get_page_size(): number; /** * Retrieves the step increment of the adjustment. * @returns The current step increment of the adjustment. */ get_step_increment(): number; /** * Retrieves the maximum value of the adjustment. * @returns The current maximum value of the adjustment */ get_upper(): number; /** * Gets the current value of the adjustment. * See `gtk_adjustment_set_value()`. * @returns The current value of the adjustment */ get_value(): number; /** * Sets the minimum value of the adjustment. * * When setting multiple adjustment properties via their individual * setters, multiple {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} signals will be emitted. * However, since the emission of the {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} signal * is tied to the emission of the {@link GObject.Object.SignalSignatures.notify | GObject.Object::notify} signals of the changed * properties, it’s possible to compress the {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} * signals into one by calling `g_object_freeze_notify()` and * `g_object_thaw_notify()` around the calls to the individual setters. * * Alternatively, using a single `g_object_set()` for all the properties * to change, or using `gtk_adjustment_configure()` has the same effect * of compressing {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} emissions. * @param lower the new minimum value */ set_lower(lower: number): void; /** * Sets the page increment of the adjustment. * * See `gtk_adjustment_set_lower()` about how to compress multiple * emissions of the {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} signal when setting * multiple adjustment properties. * @param page_increment the new page increment */ set_page_increment(page_increment: number): void; /** * Sets the page size of the adjustment. * * See `gtk_adjustment_set_lower()` about how to compress multiple * emissions of the GtkAdjustment::changed signal when setting * multiple adjustment properties. * @param page_size the new page size */ set_page_size(page_size: number): void; /** * Sets the step increment of the adjustment. * * See `gtk_adjustment_set_lower()` about how to compress multiple * emissions of the {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} signal when setting * multiple adjustment properties. * @param step_increment the new step increment */ set_step_increment(step_increment: number): void; /** * Sets the maximum value of the adjustment. * * Note that values will be restricted by `upper - page-size` * if the page-size property is nonzero. * * See `gtk_adjustment_set_lower()` about how to compress multiple * emissions of the {@link Gtk.Adjustment.SignalSignatures.changed | Gtk.Adjustment::changed} signal when setting * multiple adjustment properties. * @param upper the new maximum value */ set_upper(upper: number): void; /** * Sets the {@link Gtk.Adjustment} value. The value is clamped to lie between * {@link Gtk.Adjustment.lower} and {@link Gtk.Adjustment.upper}. * * Note that for adjustments which are used in a {@link Gtk.Scrollbar}, the * effective range of allowed values goes from {@link Gtk.Adjustment.lower} to * {@link Gtk.Adjustment.upper} - {@link Gtk.Adjustment.page_size}. * @param value the new value */ set_value(value: number): void; /** * Emits a {@link Gtk.Adjustment.SignalSignatures.value_changed | Gtk.Adjustment::value-changed} signal from the {@link Gtk.Adjustment}. * This is typically called by the owner of the {@link Gtk.Adjustment} after it has * changed the {@link Gtk.Adjustment.value} property. */ value_changed(): void; } namespace Alignment { // Signal signatures interface SignalSignatures extends Bin.SignalSignatures { "notify::bottom-padding": (pspec: GObject.ParamSpec) => void; "notify::left-padding": (pspec: GObject.ParamSpec) => void; "notify::right-padding": (pspec: GObject.ParamSpec) => void; "notify::top-padding": (pspec: GObject.ParamSpec) => void; "notify::xalign": (pspec: GObject.ParamSpec) => void; "notify::xscale": (pspec: GObject.ParamSpec) => void; "notify::yalign": (pspec: GObject.ParamSpec) => void; "notify::yscale": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Bin.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { bottom_padding: number; bottomPadding: number; left_padding: number; leftPadding: number; right_padding: number; rightPadding: number; top_padding: number; topPadding: number; xalign: number; xscale: number; yalign: number; yscale: number; } } /** * The {@link Gtk.Alignment} widget controls the alignment and size of its child widget. * It has four settings: xscale, yscale, xalign, and yalign. * * The scale settings are used to specify how much the child widget should * expand to fill the space allocated to the {@link Gtk.Alignment}. * The values can range from 0 (meaning the child doesn’t expand at all) to * 1 (meaning the child expands to fill all of the available space). * * The align settings are used to place the child widget within the available * area. The values range from 0 (top or left) to 1 (bottom or right). * Of course, if the scale settings are both set to 1, the alignment settings * have no effect. * * GtkAlignment has been deprecated in 3.14 and should not be used in * newly-written code. The desired effect can be achieved by using the * {@link Gtk.Widget.halign}, {@link Gtk.Widget.valign} and {@link Gtk.Widget.margin} properties on the * child widget. * @gir-type Class */ class Alignment extends Bin implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties /** * The padding to insert at the bottom of the widget. * @since 2.4 * @deprecated since 3.14: Use `gtk_widget_set_margin_bottom()` instead * @default 0 */ get bottom_padding(): number; set bottom_padding(val: number); /** * The padding to insert at the bottom of the widget. * @since 2.4 * @deprecated since 3.14: Use `gtk_widget_set_margin_bottom()` instead * @default 0 */ get bottomPadding(): number; set bottomPadding(val: number); /** * The padding to insert at the left of the widget. * @since 2.4 * @deprecated since 3.14: Use `gtk_widget_set_margin_start()` instead * @default 0 */ get left_padding(): number; set left_padding(val: number); /** * The padding to insert at the left of the widget. * @since 2.4 * @deprecated since 3.14: Use `gtk_widget_set_margin_start()` instead * @default 0 */ get leftPadding(): number; set leftPadding(val: number); /** * The padding to insert at the right of the widget. * @since 2.4 * @deprecated since 3.14: Use `gtk_widget_set_margin_end()` instead * @default 0 */ get right_padding(): number; set right_padding(val: number); /** * The padding to insert at the right of the widget. * @since 2.4 * @deprecated since 3.14: Use `gtk_widget_set_margin_end()` instead * @default 0 */ get rightPadding(): number; set rightPadding(val: number); /** * The padding to insert at the top of the widget. * @since 2.4 * @deprecated since 3.14: Use `gtk_widget_set_margin_top()` instead * @default 0 */ get top_padding(): number; set top_padding(val: number); /** * The padding to insert at the top of the widget. * @since 2.4 * @deprecated since 3.14: Use `gtk_widget_set_margin_top()` instead * @default 0 */ get topPadding(): number; set topPadding(val: number); /** * Horizontal position of child in available space. A value of 0.0 * will flush the child left (or right, in RTL locales); a value * of 1.0 will flush the child right (or left, in RTL locales). * @deprecated since 3.14: Use `gtk_widget_set_halign()` on the child instead * @default 0.5 */ get xalign(): number; set xalign(val: number); /** * If available horizontal space is bigger than needed, how much * of it to use for the child. A value of 0.0 means none; a value * of 1.0 means all. * @deprecated since 3.14: Use `gtk_widget_set_hexpand()` on the child instead * @default 1 */ get xscale(): number; set xscale(val: number); /** * Vertical position of child in available space. A value of 0.0 * will flush the child to the top; a value of 1.0 will flush the * child to the bottom. * @deprecated since 3.14: Use `gtk_widget_set_valign()` on the child instead * @default 0.5 */ get yalign(): number; set yalign(val: number); /** * If available vertical space is bigger than needed, how much * of it to use for the child. A value of 0.0 means none; a value * of 1.0 means all. * @deprecated since 3.14: Use `gtk_widget_set_vexpand()` on the child instead * @default 1 */ get yscale(): number; set yscale(val: number); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Alignment.SignalSignatures; // Fields bin: Bin; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](xalign: number, yalign: number, xscale: number, yscale: number): Alignment; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Gets the padding on the different sides of the widget. * See gtk_alignment_set_padding (). */ get_padding(): [number, number, number, number]; /** * Sets the {@link Gtk.Alignment} values. * @param xalign the horizontal alignment of the child widget, from 0 (left) to 1 (right). * @param yalign the vertical alignment of the child widget, from 0 (top) to 1 (bottom). * @param xscale the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the {@link Gtk.Alignment}. * @param yscale the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to `xscale`. */ set(xalign: number, yalign: number, xscale: number, yscale: number): void; /** * @param args */ // Conflicted with GObject.Object.set set(...args: never[]): any; /** * Sets the padding on the different sides of the widget. * The padding adds blank space to the sides of the widget. For instance, * this can be used to indent the child widget towards the right by adding * padding on the left. * @param padding_top the padding at the top of the widget * @param padding_bottom the padding at the bottom of the widget * @param padding_left the padding at the left of the widget * @param padding_right the padding at the right of the widget. */ set_padding(padding_top: number, padding_bottom: number, padding_left: number, padding_right: number): void; } namespace AppChooserButton { // Signal signatures interface SignalSignatures extends ComboBox.SignalSignatures { /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated": (arg0: string) => void; "notify::heading": (pspec: GObject.ParamSpec) => void; "notify::show-default-item": (pspec: GObject.ParamSpec) => void; "notify::show-dialog-item": (pspec: GObject.ParamSpec) => void; "notify::active": (pspec: GObject.ParamSpec) => void; "notify::active-id": (pspec: GObject.ParamSpec) => void; "notify::add-tearoffs": (pspec: GObject.ParamSpec) => void; "notify::button-sensitivity": (pspec: GObject.ParamSpec) => void; "notify::cell-area": (pspec: GObject.ParamSpec) => void; "notify::column-span-column": (pspec: GObject.ParamSpec) => void; "notify::entry-text-column": (pspec: GObject.ParamSpec) => void; "notify::has-entry": (pspec: GObject.ParamSpec) => void; "notify::has-frame": (pspec: GObject.ParamSpec) => void; "notify::id-column": (pspec: GObject.ParamSpec) => void; "notify::model": (pspec: GObject.ParamSpec) => void; "notify::popup-fixed-width": (pspec: GObject.ParamSpec) => void; "notify::popup-shown": (pspec: GObject.ParamSpec) => void; "notify::row-span-column": (pspec: GObject.ParamSpec) => void; "notify::tearoff-title": (pspec: GObject.ParamSpec) => void; "notify::wrap-width": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; "notify::content-type": (pspec: GObject.ParamSpec) => void; "notify::editing-canceled": (pspec: GObject.ParamSpec) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::heading": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::show-default-item": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::show-dialog-item": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::active": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::active-id": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::add-tearoffs": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::button-sensitivity": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::cell-area": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::column-span-column": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::entry-text-column": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::has-entry": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::has-frame": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::id-column": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::model": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::popup-fixed-width": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::popup-shown": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::row-span-column": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::tearoff-title": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::wrap-width": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::border-width": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::child": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::resize-mode": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::app-paintable": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::can-default": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::can-focus": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::composite-child": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::double-buffered": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::events": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::expand": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::focus-on-click": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::halign": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::has-default": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::has-focus": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::has-tooltip": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::height-request": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::hexpand": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::hexpand-set": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::is-focus": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::margin": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::margin-bottom": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::margin-end": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::margin-left": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::margin-right": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::margin-start": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::margin-top": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::name": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::no-show-all": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::opacity": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::parent": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::receives-default": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::scale-factor": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::sensitive": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::style": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::tooltip-markup": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::tooltip-text": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::valign": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::vexpand": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::vexpand-set": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::visible": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::width-request": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::window": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::content-type": (arg0: string) => void; /** * Emitted when a custom item, previously added with * `gtk_app_chooser_button_append_custom_item()`, is activated from the * dropdown menu. * @signal * @detailed * @run-first */ "custom-item-activated::editing-canceled": (arg0: string) => void; [key: `custom-item-activated::${string}`]: (arg0: string) => void; } // Constructor properties interface interface ConstructorProps extends ComboBox.ConstructorProps, Atk.ImplementorIface.ConstructorProps, AppChooser.ConstructorProps, Buildable.ConstructorProps, CellEditable.ConstructorProps, CellLayout.ConstructorProps { heading: string | null; show_default_item: boolean; showDefaultItem: boolean; show_dialog_item: boolean; showDialogItem: boolean; } } /** * The {@link Gtk.AppChooserButton} is a widget that lets the user select * an application. It implements the {@link Gtk.AppChooser} interface. * * Initially, a {@link Gtk.AppChooserButton} selects the first application * in its list, which will either be the most-recently used application * or, if {@link Gtk.AppChooserButton.show_default_item} is `true`, the * default application. * * The list of applications shown in a {@link Gtk.AppChooserButton} includes * the recommended applications for the given content type. When * {@link Gtk.AppChooserButton.show_default_item} is set, the default application * is also included. To let the user chooser other applications, * you can set the {@link Gtk.AppChooserButton.show_dialog_item} property, * which allows to open a full {@link Gtk.AppChooserDialog}. * * It is possible to add custom items to the list, using * `gtk_app_chooser_button_append_custom_item()`. These items cause * the {@link Gtk.AppChooserButton.SignalSignatures.custom_item_activated | Gtk.AppChooserButton::custom-item-activated} signal to be * emitted when they are selected. * * To track changes in the selected application, use the * {@link Gtk.ComboBox.SignalSignatures.changed | Gtk.ComboBox::changed} signal. * @gir-type Class */ class AppChooserButton extends ComboBox implements Atk.ImplementorIface, AppChooser, Buildable, CellEditable, CellLayout { static $gtype: GObject.GType; // Properties /** * The text to show at the top of the dialog that can be * opened from the button. The string may contain Pango markup. * @default null */ get heading(): string | null; set heading(val: string | null); /** * The {@link Gtk.AppChooserButton.show_default_item} property determines * whether the dropdown menu should show the default application * on top for the provided content type. * @since 3.2 * @default false */ get show_default_item(): boolean; set show_default_item(val: boolean); /** * The {@link Gtk.AppChooserButton.show_default_item} property determines * whether the dropdown menu should show the default application * on top for the provided content type. * @since 3.2 * @default false */ get showDefaultItem(): boolean; set showDefaultItem(val: boolean); /** * The {@link Gtk.AppChooserButton.show_dialog_item} property determines * whether the dropdown menu should show an item that triggers * a {@link Gtk.AppChooserDialog} when clicked. * @default false */ get show_dialog_item(): boolean; set show_dialog_item(val: boolean); /** * The {@link Gtk.AppChooserButton.show_dialog_item} property determines * whether the dropdown menu should show an item that triggers * a {@link Gtk.AppChooserDialog} when clicked. * @default false */ get showDialogItem(): boolean; set showDialogItem(val: boolean); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: AppChooserButton.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](content_type: string): AppChooserButton; // Conflicted with Gtk.ComboBox.new static ["new"](...args: never[]): any; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * Signal emitted when a custom item, * previously added with `gtk_app_chooser_button_append_custom_item()`, * is activated from the dropdown menu. * @param item_name * @virtual */ vfunc_custom_item_activated(item_name: string): void; // Methods /** * Appends a custom item to the list of applications that is shown * in the popup; the item name must be unique per-widget. * Clients can use the provided name as a detail for the * {@link Gtk.AppChooserButton.SignalSignatures.custom_item_activated | Gtk.AppChooserButton::custom-item-activated} signal, to add a * callback for the activation of a particular custom item in the list. * See also `gtk_app_chooser_button_append_separator()`. * @param name the name of the custom item * @param label the label for the custom item * @param icon the icon for the custom item */ append_custom_item(name: string, label: string, icon: Gio.Icon): void; /** * Appends a separator to the list of applications that is shown * in the popup. */ append_separator(): void; /** * Returns the text to display at the top of the dialog. * @returns the text to display at the top of the dialog, or `null`, in which case a default text is displayed */ get_heading(): string | null; /** * Returns the current value of the {@link Gtk.AppChooserButton.show_default_item} * property. * @returns the value of {@link Gtk.AppChooserButton.show_default_item} */ get_show_default_item(): boolean; /** * Returns the current value of the {@link Gtk.AppChooserButton.show_dialog_item} * property. * @returns the value of {@link Gtk.AppChooserButton.show_dialog_item} */ get_show_dialog_item(): boolean; /** * Selects a custom item previously added with * `gtk_app_chooser_button_append_custom_item()`. * * Use `gtk_app_chooser_refresh()` to bring the selection * to its initial state. * @param name the name of the custom item */ set_active_custom_item(name: string): void; /** * Sets the text to display at the top of the dialog. * If the heading is not set, the dialog displays a default text. * @param heading a string containing Pango markup */ set_heading(heading: string): void; /** * Sets whether the dropdown menu of this button should show the * default application for the given content type at top. * @param setting the new value for {@link Gtk.AppChooserButton.show_default_item} */ set_show_default_item(setting: boolean): void; /** * Sets whether the dropdown menu of this button should show an * entry to trigger a {@link Gtk.AppChooserDialog}. * @param setting the new value for {@link Gtk.AppChooserButton.show_dialog_item} */ set_show_dialog_item(setting: boolean): void; /** * The content type of the {@link Gtk.AppChooser} object. * * See [GContentType][gio-GContentType] * for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get content_type(): string; /** * The content type of the {@link Gtk.AppChooser} object. * * See [GContentType][gio-GContentType] * for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get contentType(): string; /** * Indicates whether editing on the cell has been canceled. * @since 2.20 * @default false * @category Inherited from Gtk.CellEditable */ get editing_canceled(): boolean; set editing_canceled(val: boolean); /** * Indicates whether editing on the cell has been canceled. * @since 2.20 * @default false * @category Inherited from Gtk.CellEditable */ get editingCanceled(): boolean; set editingCanceled(val: boolean); /** * Returns the currently selected application. * @returns a {@link Gio.AppInfo} for the currently selected application, or `null` if none is selected. Free with `g_object_unref()` */ get_app_info(): Gio.AppInfo | null; /** * Returns the current value of the {@link Gtk.AppChooser.content_type} property. * @returns the content type of `self`. Free with `g_free()` */ get_content_type(): string; /** * Reloads the list of applications. */ refresh(): void; /** * Emits the {@link Gtk.CellEditable.SignalSignatures.editing_done | Gtk.CellEditable::editing-done} signal. */ editing_done(): void; /** * Emits the {@link Gtk.CellEditable.SignalSignatures.remove_widget | Gtk.CellEditable::remove-widget} signal. */ remove_widget(): void; /** * Begins editing on a `cell_editable`. * * The {@link Gtk.CellRenderer} for the cell creates and returns a {@link Gtk.CellEditable} from * `gtk_cell_renderer_start_editing()`, configured for the {@link Gtk.CellRenderer} type. * * `gtk_cell_editable_start_editing()` can then set up `cell_editable` suitably for * editing a cell, e.g. making the Esc key emit {@link Gtk.CellEditable.SignalSignatures.editing_done | Gtk.CellEditable::editing-done}. * * Note that the `cell_editable` is created on-demand for the current edit; its * lifetime is temporary and does not persist across other edits and/or cells. * @param event The {@link Gdk.Event} that began the editing process, or `null` if editing was initiated programmatically */ start_editing(event: Gdk.Event | null): void; /** * Emits the {@link Gtk.CellEditable.SignalSignatures.editing_done | Gtk.CellEditable::editing-done} signal. * @virtual */ vfunc_editing_done(): void; /** * Emits the {@link Gtk.CellEditable.SignalSignatures.remove_widget | Gtk.CellEditable::remove-widget} signal. * @virtual */ vfunc_remove_widget(): void; /** * Begins editing on a `cell_editable`. * * The {@link Gtk.CellRenderer} for the cell creates and returns a {@link Gtk.CellEditable} from * `gtk_cell_renderer_start_editing()`, configured for the {@link Gtk.CellRenderer} type. * * `gtk_cell_editable_start_editing()` can then set up `cell_editable` suitably for * editing a cell, e.g. making the Esc key emit {@link Gtk.CellEditable.SignalSignatures.editing_done | Gtk.CellEditable::editing-done}. * * Note that the `cell_editable` is created on-demand for the current edit; its * lifetime is temporary and does not persist across other edits and/or cells. * @param event The {@link Gdk.Event} that began the editing process, or `null` if editing was initiated programmatically * @virtual */ vfunc_start_editing(event: Gdk.Event | null): void; /** * Adds an attribute mapping to the list in `cell_layout`. * * The `column` is the column of the model to get a value from, and the * `attribute` is the parameter on `cell` to be set from the value. So for * example if column 2 of the model contains strings, you could have the * “text” attribute of a {@link Gtk.CellRendererText} get its values from column 2. * @param cell a {@link Gtk.CellRenderer} * @param attribute an attribute on the renderer * @param column the column position on the model to get the attribute from */ add_attribute(cell: CellRenderer, attribute: string, column: number): void; /** * Unsets all the mappings on all renderers on `cell_layout` and * removes all renderers from `cell_layout`. */ clear(): void; /** * Clears all existing attributes previously set with * `gtk_cell_layout_set_attributes()`. * @param cell a {@link Gtk.CellRenderer} to clear the attribute mapping on */ clear_attributes(cell: CellRenderer): void; /** * Returns the underlying {@link Gtk.CellArea} which might be `cell_layout` * if called on a {@link Gtk.CellArea} or might be `null` if no {@link Gtk.CellArea} * is used by `cell_layout`. * @returns the cell area used by `cell_layout`, or `null` in case no cell area is used. */ get_area(): CellArea | null; /** * Returns the cell renderers which have been added to `cell_layout`. * @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with `g_list_free()` when no longer needed. */ get_cells(): CellRenderer[]; /** * Adds the `cell` to the end of `cell_layout`. If `expand` is `false`, then the * `cell` is allocated no more space than it needs. Any unused space is * divided evenly between cells for which `expand` is `true`. * * Note that reusing the same cell renderer is not supported. * @param cell a {@link Gtk.CellRenderer} * @param expand `true` if `cell` is to be given extra space allocated to `cell_layout` */ pack_end(cell: CellRenderer, expand: boolean): void; /** * Packs the `cell` into the beginning of `cell_layout`. If `expand` is `false`, * then the `cell` is allocated no more space than it needs. Any unused space * is divided evenly between cells for which `expand` is `true`. * * Note that reusing the same cell renderer is not supported. * @param cell a {@link Gtk.CellRenderer} * @param expand `true` if `cell` is to be given extra space allocated to `cell_layout` */ pack_start(cell: CellRenderer, expand: boolean): void; /** * Re-inserts `cell` at `position`. * * Note that `cell` has already to be packed into `cell_layout` * for this to function properly. * @param cell a {@link Gtk.CellRenderer} to reorder * @param position new position to insert `cell` at */ reorder(cell: CellRenderer, position: number): void; /** * Sets the {@link Gtk.CellLayoutDataFunc} to use for `cell_layout`. * * This function is used instead of the standard attributes mapping * for setting the column value, and should set the value of `cell_layout`’s * cell renderer(s) as appropriate. * * `func` may be `null` to remove a previously set function. * @param cell a {@link Gtk.CellRenderer} * @param func the {@link Gtk.CellLayoutDataFunc} to use, or `null` */ set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc | null): void; /** * Adds an attribute mapping to the list in `cell_layout`. * * The `column` is the column of the model to get a value from, and the * `attribute` is the parameter on `cell` to be set from the value. So for * example if column 2 of the model contains strings, you could have the * “text” attribute of a {@link Gtk.CellRendererText} get its values from column 2. * @param cell a {@link Gtk.CellRenderer} * @param attribute an attribute on the renderer * @param column the column position on the model to get the attribute from * @virtual */ vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void; /** * Unsets all the mappings on all renderers on `cell_layout` and * removes all renderers from `cell_layout`. * @virtual */ vfunc_clear(): void; /** * Clears all existing attributes previously set with * `gtk_cell_layout_set_attributes()`. * @param cell a {@link Gtk.CellRenderer} to clear the attribute mapping on * @virtual */ vfunc_clear_attributes(cell: CellRenderer): void; /** * Returns the underlying {@link Gtk.CellArea} which might be `cell_layout` * if called on a {@link Gtk.CellArea} or might be `null` if no {@link Gtk.CellArea} * is used by `cell_layout`. * @virtual */ vfunc_get_area(): CellArea | null; /** * Returns the cell renderers which have been added to `cell_layout`. * @virtual */ vfunc_get_cells(): CellRenderer[]; /** * Adds the `cell` to the end of `cell_layout`. If `expand` is `false`, then the * `cell` is allocated no more space than it needs. Any unused space is * divided evenly between cells for which `expand` is `true`. * * Note that reusing the same cell renderer is not supported. * @param cell a {@link Gtk.CellRenderer} * @param expand `true` if `cell` is to be given extra space allocated to `cell_layout` * @virtual */ vfunc_pack_end(cell: CellRenderer, expand: boolean): void; /** * Packs the `cell` into the beginning of `cell_layout`. If `expand` is `false`, * then the `cell` is allocated no more space than it needs. Any unused space * is divided evenly between cells for which `expand` is `true`. * * Note that reusing the same cell renderer is not supported. * @param cell a {@link Gtk.CellRenderer} * @param expand `true` if `cell` is to be given extra space allocated to `cell_layout` * @virtual */ vfunc_pack_start(cell: CellRenderer, expand: boolean): void; /** * Re-inserts `cell` at `position`. * * Note that `cell` has already to be packed into `cell_layout` * for this to function properly. * @param cell a {@link Gtk.CellRenderer} to reorder * @param position new position to insert `cell` at * @virtual */ vfunc_reorder(cell: CellRenderer, position: number): void; /** * Sets the {@link Gtk.CellLayoutDataFunc} to use for `cell_layout`. * * This function is used instead of the standard attributes mapping * for setting the column value, and should set the value of `cell_layout`’s * cell renderer(s) as appropriate. * * `func` may be `null` to remove a previously set function. * @param cell a {@link Gtk.CellRenderer} * @param func the {@link Gtk.CellLayoutDataFunc} to use, or `null` * @virtual */ vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc | null): void; /** * Emits a {@link Gtk.Widget.SignalSignatures.child_notify | Gtk.Widget::child-notify} signal for the * [child property][child-properties] `child_property` * on `widget`. * * This is the analogue of `g_object_notify()` for child properties. * * Also see `gtk_container_child_notify()`. * @param child_property the name of a child property installed on the class of `widget`’s parent */ child_notify(child_property: string): void; /** * @param args */ // Conflicted with Gtk.Container.child_notify child_notify(...args: never[]): any; /** * Returns whether the widget should grab focus when it is clicked with the mouse. * See `gtk_widget_set_focus_on_click()`. * @returns `true` if the widget should grab focus when it is clicked with the mouse. */ get_focus_on_click(): boolean; /** * Sets whether the widget should grab focus when it is clicked with the mouse. * Making mouse clicks not grab focus is useful in places like toolbars where * you don’t want the keyboard focus removed from the main area of the * application. * @param focus_on_click whether the widget should grab focus when clicked with the mouse */ set_focus_on_click(focus_on_click: boolean): void; } namespace AppChooserDialog { // Signal signatures interface SignalSignatures extends Dialog.SignalSignatures { "notify::gfile": (pspec: GObject.ParamSpec) => void; "notify::heading": (pspec: GObject.ParamSpec) => void; "notify::use-header-bar": (pspec: GObject.ParamSpec) => void; "notify::accept-focus": (pspec: GObject.ParamSpec) => void; "notify::application": (pspec: GObject.ParamSpec) => void; "notify::attached-to": (pspec: GObject.ParamSpec) => void; "notify::decorated": (pspec: GObject.ParamSpec) => void; "notify::default-height": (pspec: GObject.ParamSpec) => void; "notify::default-width": (pspec: GObject.ParamSpec) => void; "notify::deletable": (pspec: GObject.ParamSpec) => void; "notify::destroy-with-parent": (pspec: GObject.ParamSpec) => void; "notify::focus-on-map": (pspec: GObject.ParamSpec) => void; "notify::focus-visible": (pspec: GObject.ParamSpec) => void; "notify::gravity": (pspec: GObject.ParamSpec) => void; "notify::has-resize-grip": (pspec: GObject.ParamSpec) => void; "notify::has-toplevel-focus": (pspec: GObject.ParamSpec) => void; "notify::hide-titlebar-when-maximized": (pspec: GObject.ParamSpec) => void; "notify::icon": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-active": (pspec: GObject.ParamSpec) => void; "notify::is-maximized": (pspec: GObject.ParamSpec) => void; "notify::mnemonics-visible": (pspec: GObject.ParamSpec) => void; "notify::modal": (pspec: GObject.ParamSpec) => void; "notify::resizable": (pspec: GObject.ParamSpec) => void; "notify::resize-grip-visible": (pspec: GObject.ParamSpec) => void; "notify::role": (pspec: GObject.ParamSpec) => void; "notify::screen": (pspec: GObject.ParamSpec) => void; "notify::skip-pager-hint": (pspec: GObject.ParamSpec) => void; "notify::skip-taskbar-hint": (pspec: GObject.ParamSpec) => void; "notify::startup-id": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; "notify::transient-for": (pspec: GObject.ParamSpec) => void; "notify::type": (pspec: GObject.ParamSpec) => void; "notify::type-hint": (pspec: GObject.ParamSpec) => void; "notify::urgency-hint": (pspec: GObject.ParamSpec) => void; "notify::window-position": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; "notify::content-type": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Dialog.ConstructorProps, Atk.ImplementorIface.ConstructorProps, AppChooser.ConstructorProps, Buildable.ConstructorProps { gfile: Gio.File; heading: string | null; } } /** * {@link Gtk.AppChooserDialog} shows a {@link Gtk.AppChooserWidget} inside a {@link Gtk.Dialog}. * * Note that {@link Gtk.AppChooserDialog} does not have any interesting methods * of its own. Instead, you should get the embedded {@link Gtk.AppChooserWidget} * using `gtk_app_chooser_dialog_get_widget()` and call its methods if * the generic {@link Gtk.AppChooser} interface is not sufficient for your needs. * * To set the heading that is shown above the {@link Gtk.AppChooserWidget}, * use `gtk_app_chooser_dialog_set_heading()`. * @gir-type Class */ class AppChooserDialog extends Dialog implements Atk.ImplementorIface, AppChooser, Buildable { static $gtype: GObject.GType; // Properties /** * The GFile used by the {@link Gtk.AppChooserDialog}. * The dialog's {@link Gtk.AppChooserWidget} content type will be guessed from the * file, if present. * @construct-only */ get gfile(): Gio.File; /** * The text to show at the top of the dialog. * The string may contain Pango markup. * @default null */ get heading(): string | null; set heading(val: string | null); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: AppChooserDialog.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](parent: Window | null, flags: DialogFlags, file: Gio.File): AppChooserDialog; // Conflicted with Gtk.Dialog.new static ["new"](...args: never[]): any; static new_for_content_type(parent: Window | null, flags: DialogFlags, content_type: string): AppChooserDialog; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Returns the text to display at the top of the dialog. * @returns the text to display at the top of the dialog, or `null`, in which case a default text is displayed */ get_heading(): string | null; /** * Returns the {@link Gtk.AppChooserWidget} of this dialog. * @returns the {@link Gtk.AppChooserWidget} of `self` */ get_widget(): Widget; /** * Sets the text to display at the top of the dialog. * If the heading is not set, the dialog displays a default text. * @param heading a string containing Pango markup */ set_heading(heading: string): void; /** * The content type of the {@link Gtk.AppChooser} object. * * See [GContentType][gio-GContentType] * for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get content_type(): string; /** * The content type of the {@link Gtk.AppChooser} object. * * See [GContentType][gio-GContentType] * for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get contentType(): string; /** * The widget's window if it is realized, `null` otherwise. * @since 2.14 * @read-only * @category Inherited from Gtk.Widget */ // This accessor conflicts with a property or field in a parent class or interface. window: Gdk.Window | null | any; /** * Returns the currently selected application. * @returns a {@link Gio.AppInfo} for the currently selected application, or `null` if none is selected. Free with `g_object_unref()` */ get_app_info(): Gio.AppInfo | null; /** * Returns the current value of the {@link Gtk.AppChooser.content_type} property. * @returns the content type of `self`. Free with `g_free()` */ get_content_type(): string; /** * Reloads the list of applications. */ refresh(): void; /** * Emits a {@link Gtk.Widget.SignalSignatures.child_notify | Gtk.Widget::child-notify} signal for the * [child property][child-properties] `child_property` * on `widget`. * * This is the analogue of `g_object_notify()` for child properties. * * Also see `gtk_container_child_notify()`. * @param child_property the name of a child property installed on the class of `widget`’s parent */ child_notify(child_property: string): void; /** * @param args */ // Conflicted with Gtk.Container.child_notify child_notify(...args: never[]): any; /** * Fetches the requested opacity for this widget. * See `gtk_widget_set_opacity()`. * @returns the requested opacity for this widget. */ get_opacity(): number; /** * Get the {@link Gdk.Screen} from the toplevel window associated with * this widget. This function can only be called after the widget * has been added to a widget hierarchy with a {@link Gtk.Window} * at the top. * * In general, you should only create screen specific * resources when a widget has been realized, and you should * free those resources when the widget is unrealized. * @returns the {@link Gdk.Screen} for the toplevel for this widget. */ get_screen(): Gdk.Screen; /** * Emits the {@link Gtk.Widget.SignalSignatures.mnemonic_activate | Gtk.Widget::mnemonic-activate} signal. * @param group_cycling `true` if there are other widgets with the same mnemonic * @returns `true` if the signal has been handled */ mnemonic_activate(group_cycling: boolean): boolean; /** * @param args */ // Conflicted with Gtk.Window.mnemonic_activate mnemonic_activate(...args: never[]): any; /** * Request the `widget` to be rendered partially transparent, * with opacity 0 being fully transparent and 1 fully opaque. (Opacity values * are clamped to the [0,1] range.). * This works on both toplevel widget, and child widgets, although there * are some limitations: * * For toplevel widgets this depends on the capabilities of the windowing * system. On X11 this has any effect only on X screens with a compositing manager * running. See `gtk_widget_is_composited()`. On Windows it should work * always, although setting a window’s opacity after the window has been * shown causes it to flicker once on Windows. * * For child widgets it doesn’t work if any affected widget has a native window, or * disables double buffering. * @param opacity desired opacity, between 0 and 1 */ set_opacity(opacity: number): void; } namespace AppChooserWidget { // Signal signatures interface SignalSignatures extends Box.SignalSignatures { /** * Emitted when an application item is activated from the widget's list. * * This usually happens when the user double clicks an item, or an item * is selected and the user presses one of the keys Space, Shift+Space, * Return or Enter. * @signal * @run-first */ "application-activated": (arg0: Gio.AppInfo) => void; /** * Emitted when an application item is selected from the widget's list. * @signal * @run-first */ "application-selected": (arg0: Gio.AppInfo) => void; /** * Emitted when a context menu is about to popup over an application item. * Clients can insert menu items into the provided {@link Gtk.Menu} object in the * callback of this signal; the context menu will be shown over the item * if at least one item has been added to the menu. * @signal * @run-first */ "populate-popup": (arg0: Menu, arg1: Gio.AppInfo) => void; "notify::default-text": (pspec: GObject.ParamSpec) => void; "notify::show-all": (pspec: GObject.ParamSpec) => void; "notify::show-default": (pspec: GObject.ParamSpec) => void; "notify::show-fallback": (pspec: GObject.ParamSpec) => void; "notify::show-other": (pspec: GObject.ParamSpec) => void; "notify::show-recommended": (pspec: GObject.ParamSpec) => void; "notify::baseline-position": (pspec: GObject.ParamSpec) => void; "notify::homogeneous": (pspec: GObject.ParamSpec) => void; "notify::spacing": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; "notify::content-type": (pspec: GObject.ParamSpec) => void; "notify::orientation": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Box.ConstructorProps, Atk.ImplementorIface.ConstructorProps, AppChooser.ConstructorProps, Buildable.ConstructorProps, Orientable.ConstructorProps { default_text: string; defaultText: string; show_all: boolean | any; showAll: boolean; show_default: boolean; showDefault: boolean; show_fallback: boolean; showFallback: boolean; show_other: boolean; showOther: boolean; show_recommended: boolean; showRecommended: boolean; } } /** * {@link Gtk.AppChooserWidget} is a widget for selecting applications. * It is the main building block for {@link Gtk.AppChooserDialog}. Most * applications only need to use the latter; but you can use * this widget as part of a larger widget if you have special needs. * * {@link Gtk.AppChooserWidget} offers detailed control over what applications * are shown, using the * {@link Gtk.AppChooserWidget.show_default}, * {@link Gtk.AppChooserWidget.show_recommended}, * {@link Gtk.AppChooserWidget.show_fallback}, * {@link Gtk.AppChooserWidget.show_other} and * {@link Gtk.AppChooserWidget.show_all} * properties. See the {@link Gtk.AppChooser} documentation for more information * about these groups of applications. * * To keep track of the selected application, use the * {@link Gtk.AppChooserWidget.SignalSignatures.application_selected | Gtk.AppChooserWidget::application-selected} and {@link Gtk.AppChooserWidget.SignalSignatures.application_activated | Gtk.AppChooserWidget::application-activated} signals. * * # CSS nodes * * GtkAppChooserWidget has a single CSS node with name appchooser. * @gir-type Class */ class AppChooserWidget extends Box implements Atk.ImplementorIface, AppChooser, Buildable, Orientable { static $gtype: GObject.GType; // Properties /** * The {@link Gtk.AppChooserWidget.default_text} property determines the text * that appears in the widget when there are no applications for the * given content type. * See also `gtk_app_chooser_widget_set_default_text()`. * @default null */ get default_text(): string; set default_text(val: string); /** * The {@link Gtk.AppChooserWidget.default_text} property determines the text * that appears in the widget when there are no applications for the * given content type. * See also `gtk_app_chooser_widget_set_default_text()`. * @default null */ get defaultText(): string; set defaultText(val: string); /** * If the {@link Gtk.AppChooserWidget.show_all} property is `true`, the app * chooser presents all applications in a single list, without * subsections for default, recommended or related applications. * @default false */ // This accessor conflicts with a field or function name in a parent class or interface. show_all: boolean | any; /** * If the {@link Gtk.AppChooserWidget.show_all} property is `true`, the app * chooser presents all applications in a single list, without * subsections for default, recommended or related applications. * @default false */ get showAll(): boolean; set showAll(val: boolean); /** * The ::show-default property determines whether the app chooser * should show the default handler for the content type in a * separate section. If `false`, the default handler is listed * among the recommended applications. * @default false */ get show_default(): boolean; set show_default(val: boolean); /** * The ::show-default property determines whether the app chooser * should show the default handler for the content type in a * separate section. If `false`, the default handler is listed * among the recommended applications. * @default false */ get showDefault(): boolean; set showDefault(val: boolean); /** * The {@link Gtk.AppChooserWidget.show_fallback} property determines whether * the app chooser should show a section for fallback applications. * If `false`, the fallback applications are listed among the other * applications. * @default false */ get show_fallback(): boolean; set show_fallback(val: boolean); /** * The {@link Gtk.AppChooserWidget.show_fallback} property determines whether * the app chooser should show a section for fallback applications. * If `false`, the fallback applications are listed among the other * applications. * @default false */ get showFallback(): boolean; set showFallback(val: boolean); /** * The {@link Gtk.AppChooserWidget.show_other} property determines whether * the app chooser should show a section for other applications. * @default false */ get show_other(): boolean; set show_other(val: boolean); /** * The {@link Gtk.AppChooserWidget.show_other} property determines whether * the app chooser should show a section for other applications. * @default false */ get showOther(): boolean; set showOther(val: boolean); /** * The {@link Gtk.AppChooserWidget.show_recommended} property determines * whether the app chooser should show a section for recommended * applications. If `false`, the recommended applications are listed * among the other applications. * @default true */ get show_recommended(): boolean; set show_recommended(val: boolean); /** * The {@link Gtk.AppChooserWidget.show_recommended} property determines * whether the app chooser should show a section for recommended * applications. If `false`, the recommended applications are listed * among the other applications. * @default true */ get showRecommended(): boolean; set showRecommended(val: boolean); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: AppChooserWidget.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](content_type: string): AppChooserWidget; // Conflicted with Gtk.Box.new static ["new"](...args: never[]): any; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * Signal emitted when an application item is * activated from the widget’s list. * @param app_info * @virtual */ vfunc_application_activated(app_info: Gio.AppInfo): void; /** * Signal emitted when an application item is * selected from the widget’s list. * @param app_info * @virtual */ vfunc_application_selected(app_info: Gio.AppInfo): void; /** * Signal emitted when a context menu is about to * popup over an application item. * @param menu * @param app_info * @virtual */ vfunc_populate_popup(menu: Menu, app_info: Gio.AppInfo): void; // Methods /** * Returns the text that is shown if there are not applications * that can handle the content type. * @returns the value of {@link Gtk.AppChooserWidget.default_text} */ get_default_text(): string; /** * Returns the current value of the {@link Gtk.AppChooserWidget.show_all} * property. * @returns the value of {@link Gtk.AppChooserWidget.show_all} */ get_show_all(): boolean; /** * Returns the current value of the {@link Gtk.AppChooserWidget.show_default} * property. * @returns the value of {@link Gtk.AppChooserWidget.show_default} */ get_show_default(): boolean; /** * Returns the current value of the {@link Gtk.AppChooserWidget.show_fallback} * property. * @returns the value of {@link Gtk.AppChooserWidget.show_fallback} */ get_show_fallback(): boolean; /** * Returns the current value of the {@link Gtk.AppChooserWidget.show_other} * property. * @returns the value of {@link Gtk.AppChooserWidget.show_other} */ get_show_other(): boolean; /** * Returns the current value of the {@link Gtk.AppChooserWidget.show_recommended} * property. * @returns the value of {@link Gtk.AppChooserWidget.show_recommended} */ get_show_recommended(): boolean; /** * Sets the text that is shown if there are not applications * that can handle the content type. * @param text the new value for {@link Gtk.AppChooserWidget.default_text} */ set_default_text(text: string): void; /** * Sets whether the app chooser should show all applications * in a flat list. * @param setting the new value for {@link Gtk.AppChooserWidget.show_all} */ set_show_all(setting: boolean): void; /** * Sets whether the app chooser should show the default handler * for the content type in a separate section. * @param setting the new value for {@link Gtk.AppChooserWidget.show_default} */ set_show_default(setting: boolean): void; /** * Sets whether the app chooser should show related applications * for the content type in a separate section. * @param setting the new value for {@link Gtk.AppChooserWidget.show_fallback} */ set_show_fallback(setting: boolean): void; /** * Sets whether the app chooser should show applications * which are unrelated to the content type. * @param setting the new value for {@link Gtk.AppChooserWidget.show_other} */ set_show_other(setting: boolean): void; /** * Sets whether the app chooser should show recommended applications * for the content type in a separate section. * @param setting the new value for {@link Gtk.AppChooserWidget.show_recommended} */ set_show_recommended(setting: boolean): void; /** * The content type of the {@link Gtk.AppChooser} object. * * See [GContentType][gio-GContentType] * for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get content_type(): string; /** * The content type of the {@link Gtk.AppChooser} object. * * See [GContentType][gio-GContentType] * for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get contentType(): string; /** * The orientation of the orientable. * @since 2.16 * @default Gtk.Orientation.HORIZONTAL * @category Inherited from Gtk.Orientable */ get orientation(): Orientation; set orientation(val: Orientation); /** * Returns the currently selected application. * @returns a {@link Gio.AppInfo} for the currently selected application, or `null` if none is selected. Free with `g_object_unref()` */ get_app_info(): Gio.AppInfo | null; /** * Returns the current value of the {@link Gtk.AppChooser.content_type} property. * @returns the content type of `self`. Free with `g_free()` */ get_content_type(): string; /** * Reloads the list of applications. */ refresh(): void; /** * Retrieves the orientation of the `orientable`. * @returns the orientation of the `orientable`. */ get_orientation(): Orientation; /** * Sets the orientation of the `orientable`. * @param orientation the orientable’s new orientation. */ set_orientation(orientation: Orientation): void; /** * Emits a {@link Gtk.Widget.SignalSignatures.child_notify | Gtk.Widget::child-notify} signal for the * [child property][child-properties] `child_property` * on `widget`. * * This is the analogue of `g_object_notify()` for child properties. * * Also see `gtk_container_child_notify()`. * @param child_property the name of a child property installed on the class of `widget`’s parent */ child_notify(child_property: string): void; /** * @param args */ // Conflicted with Gtk.Container.child_notify child_notify(...args: never[]): any; } namespace Application { // Signal signatures interface SignalSignatures extends Gio.Application.SignalSignatures { /** * Emitted when the session manager is about to end the session, only * if {@link Gtk.Application.SignalSignatures.register_session | Gtk.Application::register-session} is `true`. Applications can * connect to this signal and call `gtk_application_inhibit()` with * {@link Gtk.ApplicationInhibitFlags.LOGOUT} to delay the end of the session * until state has been saved. * @signal * @since 3.24.8 * @run-first */ "query-end": () => void; /** * Emitted when a {@link Gtk.Window} is added to `application` through * `gtk_application_add_window()`. * @signal * @since 3.2 * @run-first */ "window-added": (arg0: Window) => void; /** * Emitted when a {@link Gtk.Window} is removed from `application`, * either as a side-effect of being destroyed or explicitly * through `gtk_application_remove_window()`. * @signal * @since 3.2 * @run-first */ "window-removed": (arg0: Window) => void; "notify::active-window": (pspec: GObject.ParamSpec) => void; "notify::app-menu": (pspec: GObject.ParamSpec) => void; "notify::menubar": (pspec: GObject.ParamSpec) => void; "notify::register-session": (pspec: GObject.ParamSpec) => void; "notify::screensaver-active": (pspec: GObject.ParamSpec) => void; "notify::action-group": (pspec: GObject.ParamSpec) => void; "notify::application-id": (pspec: GObject.ParamSpec) => void; "notify::flags": (pspec: GObject.ParamSpec) => void; "notify::inactivity-timeout": (pspec: GObject.ParamSpec) => void; "notify::is-busy": (pspec: GObject.ParamSpec) => void; "notify::is-registered": (pspec: GObject.ParamSpec) => void; "notify::is-remote": (pspec: GObject.ParamSpec) => void; "notify::resource-base-path": (pspec: GObject.ParamSpec) => void; "notify::version": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Gio.Application.ConstructorProps, Gio.ActionGroup.ConstructorProps, Gio.ActionMap.ConstructorProps { active_window: Window | null; activeWindow: Window | null; app_menu: Gio.MenuModel | null; appMenu: Gio.MenuModel | null; menubar: Gio.MenuModel; register_session: boolean; registerSession: boolean; screensaver_active: boolean; screensaverActive: boolean; } } /** * {@link Gtk.Application} is a class that handles many important aspects * of a GTK+ application in a convenient fashion, without enforcing * a one-size-fits-all application model. * * Currently, GtkApplication handles GTK+ initialization, application * uniqueness, session management, provides some basic scriptability and * desktop shell integration by exporting actions and menus and manages a * list of toplevel windows whose life-cycle is automatically tied to the * life-cycle of your application. * * While GtkApplication works fine with plain `GtkWindows`, it is recommended * to use it together with {@link Gtk.ApplicationWindow}. * * When GDK threads are enabled, GtkApplication will acquire the GDK * lock when invoking actions that arrive from other processes. The GDK * lock is not touched for local action invocations. In order to have * actions invoked in a predictable context it is therefore recommended * that the GDK lock be held while invoking actions locally with * `g_action_group_activate_action()`. The same applies to actions * associated with {@link Gtk.ApplicationWindow} and to the “activate” and * “open” {@link Gio.Application} methods. * * ## Automatic resources ## {#automatic-resources} * * {@link Gtk.Application} will automatically load menus from the {@link Gtk.Builder} * resource located at "gtk/menus.ui", relative to the application's * resource base path (see `g_application_set_resource_base_path()`). The * menu with the ID "app-menu" is taken as the application's app menu * and the menu with the ID "menubar" is taken as the application's * menubar. Additional menus (most interesting submenus) can be named * and accessed via `gtk_application_get_menu_by_id()` which allows for * dynamic population of a part of the menu structure. * * If the resources "gtk/menus-appmenu.ui" or "gtk/menus-traditional.ui" are * present then these files will be used in preference, depending on the value * of `gtk_application_prefers_app_menu()`. If the resource "gtk/menus-common.ui" * is present it will be loaded as well. This is useful for storing items that * are referenced from both "gtk/menus-appmenu.ui" and * "gtk/menus-traditional.ui". * * It is also possible to provide the menus manually using * `gtk_application_set_app_menu()` and `gtk_application_set_menubar()`. * * {@link Gtk.Application} will also automatically setup an icon search path for * the default icon theme by appending "icons" to the resource base * path. This allows your application to easily store its icons as * resources. See `gtk_icon_theme_add_resource_path()` for more * information. * * If there is a resource located at "gtk/help-overlay.ui" which * defines a {@link Gtk.ShortcutsWindow} with ID "help_overlay" then GtkApplication * associates an instance of this shortcuts window with each * {@link Gtk.ApplicationWindow} and sets up keyboard accelerators (Control-F1 * and Control-?) to open it. To create a menu item that displays the * shortcuts window, associate the item with the action win.show-help-overlay. * * ## A simple application ## {#gtkapplication} * * [A simple example](https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/examples/bp/bloatpad.c) * * GtkApplication optionally registers with a session manager * of the users session (if you set the {@link Gtk.Application.register_session} * property) and offers various functionality related to the session * life-cycle. * * An application can block various ways to end the session with * the `gtk_application_inhibit()` function. Typical use cases for * this kind of inhibiting are long-running, uninterruptible operations, * such as burning a CD or performing a disk backup. The session * manager may not honor the inhibitor, but it can be expected to * inform the user about the negative consequences of ending the * session while inhibitors are present. * * ## See Also ## {#seealso} * [HowDoI: Using GtkApplication](https://wiki.gnome.org/HowDoI/GtkApplication), * [Getting Started with GTK+: Basics](https://developer.gnome.org/gtk3/stable/gtk-getting-started.html#id-1.2.3.3) * @gir-type Class */ class Application extends Gio.Application implements Gio.ActionGroup, Gio.ActionMap { static $gtype: GObject.GType; // Properties /** * @read-only */ get active_window(): Window | null; /** * @read-only */ get activeWindow(): Window | null; get app_menu(): Gio.MenuModel | null; set app_menu(val: Gio.MenuModel | null); get appMenu(): Gio.MenuModel | null; set appMenu(val: Gio.MenuModel | null); get menubar(): Gio.MenuModel; set menubar(val: Gio.MenuModel); /** * Set this property to `true` to register with the session manager. * @since 3.4 * @default false */ get register_session(): boolean; set register_session(val: boolean); /** * Set this property to `true` to register with the session manager. * @since 3.4 * @default false */ get registerSession(): boolean; set registerSession(val: boolean); /** * This property is `true` if GTK+ believes that the screensaver is * currently active. GTK+ only tracks session state (including this) * when {@link Gtk.Application.SignalSignatures.register_session | Gtk.Application::register-session} is set to `true`. * * Tracking the screensaver state is supported on Linux. * @since 3.24 * @read-only * @default false */ get screensaver_active(): boolean; /** * This property is `true` if GTK+ believes that the screensaver is * currently active. GTK+ only tracks session state (including this) * when {@link Gtk.Application.SignalSignatures.register_session | Gtk.Application::register-session} is set to `true`. * * Tracking the screensaver state is supported on Linux. * @since 3.24 * @read-only * @default false */ get screensaverActive(): boolean; /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Application.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](application_id: string | null, flags: Gio.ApplicationFlags): Application; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * Signal emitted when a {@link Gtk.Window} is added to * application through `gtk_application_add_window()`. * @param window * @virtual */ vfunc_window_added(window: Window): void; /** * Signal emitted when a {@link Gtk.Window} is removed from * application, either as a side-effect of being destroyed or * explicitly through `gtk_application_remove_window()`. * @param window * @virtual */ vfunc_window_removed(window: Window): void; // Methods /** * Installs an accelerator that will cause the named action * to be activated when the key combination specificed by `accelerator` * is pressed. * * `accelerator` must be a string that can be parsed by `gtk_accelerator_parse()`, * e.g. "q" or “p”. * * `action_name` must be the name of an action as it would be used * in the app menu, i.e. actions that have been added to the application * are referred to with an “app.” prefix, and window-specific actions * with a “win.” prefix. * * GtkApplication also extracts accelerators out of “accel” attributes * in the `GMenuModels` passed to `gtk_application_set_app_menu()` and * `gtk_application_set_menubar()`, which is usually more convenient * than calling this function for each accelerator. * @param accelerator accelerator string * @param action_name the name of the action to activate * @param parameter parameter to pass when activating the action, or `null` if the action does not accept an activation parameter */ add_accelerator(accelerator: string, action_name: string, parameter: GLib.Variant | null): void; /** * Adds a window to `application`. * * This call can only happen after the `application` has started; * typically, you should add new application windows in response * to the emission of the {@link Gio.Application.SignalSignatures.activate | Gio.Application::activate} signal. * * This call is equivalent to setting the {@link Gtk.Window.application} * property of `window` to `application`. * * Normally, the connection between the application and the window * will remain until the window is destroyed, but you can explicitly * remove it with `gtk_application_remove_window()`. * * GTK+ will keep the `application` running as long as it has * any windows. * @param window a {@link Gtk.Window} */ add_window(window: Window): void; /** * Gets the accelerators that are currently associated with * the given action. * @param detailed_action_name a detailed action name, specifying an action and target to obtain accelerators for * @returns accelerators for `detailed_action_name`, as a `null`-terminated array. Free with `g_strfreev()` when no longer needed */ get_accels_for_action(detailed_action_name: string): string[]; /** * Returns the list of actions (possibly empty) that `accel` maps to. * Each item in the list is a detailed action name in the usual form. * * This might be useful to discover if an accel already exists in * order to prevent installation of a conflicting accelerator (from * an accelerator editor or a plugin system, for example). Note that * having more than one action per accelerator may not be a bad thing * and might make sense in cases where the actions never appear in the * same context. * * In case there are no actions for a given accelerator, an empty array * is returned. `null` is never returned. * * It is a programmer error to pass an invalid accelerator string. * If you are unsure, check it with `gtk_accelerator_parse()` first. * @param accel an accelerator that can be parsed by `gtk_accelerator_parse()` * @returns a `null`-terminated array of actions for `accel` */ get_actions_for_accel(accel: string): string[]; /** * Gets the “active” window for the application. * * The active window is the one that was most recently focused (within * the application). This window may not have the focus at the moment * if another application has it — this is just the most * recently-focused window within this application. * @returns the active window, or `null` if there isn't one. */ get_active_window(): Window | null; /** * Returns the menu model that has been set with * `gtk_application_set_app_menu()`. * @returns the application menu of `application` or `null` if no application menu has been set. */ get_app_menu(): Gio.MenuModel | null; /** * Gets a menu from automatically loaded resources. * See [Automatic resources][automatic-resources] * for more information. * @param id the id of the menu to look up * @returns Gets the menu with the given id from the automatically loaded resources */ get_menu_by_id(id: string): Gio.Menu; /** * Returns the menu model that has been set with * `gtk_application_set_menubar()`. * @returns the menubar for windows of `application` */ get_menubar(): Gio.MenuModel; /** * Returns the {@link Gtk.ApplicationWindow} with the given ID. * * The ID of a {@link Gtk.ApplicationWindow} can be retrieved with * `gtk_application_window_get_id()`. * @param id an identifier number * @returns the window with ID `id`, or `null` if there is no window with this ID */ get_window_by_id(id: number): Window | null; /** * Gets a list of the `GtkWindows` associated with `application`. * * The list is sorted by most recently focused window, such that the first * element is the currently focused window. (Useful for choosing a parent * for a transient window.) * * The list that is returned should not be modified in any way. It will * only remain valid until the next focus change or window creation or * deletion. * @returns a {@link GLib.List} of {@link Gtk.Window} */ get_windows(): Window[]; /** * Inform the session manager that certain types of actions should be * inhibited. This is not guaranteed to work on all platforms and for * all types of actions. * * Applications should invoke this method when they begin an operation * that should not be interrupted, such as creating a CD or DVD. The * types of actions that may be blocked are specified by the `flags` * parameter. When the application completes the operation it should * call `gtk_application_uninhibit()` to remove the inhibitor. Note that * an application can have multiple inhibitors, and all of them must * be individually removed. Inhibitors are also cleared when the * application exits. * * Applications should not expect that they will always be able to block * the action. In most cases, users will be given the option to force * the action to take place. * * Reasons should be short and to the point. * * If `window` is given, the session manager may point the user to * this window to find out more about why the action is inhibited. * @param window a {@link Gtk.Window}, or `null` * @param flags what types of actions should be inhibited * @param reason a short, human-readable string that explains why these operations are inhibited * @returns A non-zero cookie that is used to uniquely identify this request. It should be used as an argument to `gtk_application_uninhibit()` in order to remove the request. If the platform does not support inhibiting or the request failed for some reason, 0 is returned. */ inhibit(window: Window | null, flags: ApplicationInhibitFlags, reason: string | null): number; /** * Determines if any of the actions specified in `flags` are * currently inhibited (possibly by another application). * * Note that this information may not be available (for example * when the application is running in a sandbox). * @param flags what types of actions should be queried * @returns `true` if any of the actions specified in `flags` are inhibited */ is_inhibited(flags: ApplicationInhibitFlags): boolean; /** * Lists the detailed action names which have associated accelerators. * See `gtk_application_set_accels_for_action()`. * @returns a `null`-terminated array of strings, free with `g_strfreev()` when done */ list_action_descriptions(): string[]; /** * Determines if the desktop environment in which the application is * running would prefer an application menu be shown. * * If this function returns `true` then the application should call * `gtk_application_set_app_menu()` with the contents of an application * menu, which will be shown by the desktop environment. If it returns * `false` then you should consider using an alternate approach, such as * a menubar. * * The value returned by this function is purely advisory and you are * free to ignore it. If you call `gtk_application_set_app_menu()` even * if the desktop environment doesn't support app menus, then a fallback * will be provided. * * Applications are similarly free not to set an app menu even if the * desktop environment wants to show one. In that case, a fallback will * also be created by the desktop environment (GNOME, for example, uses * a menu with only a "Quit" item in it). * * The value returned by this function never changes. Once it returns a * particular value, it is guaranteed to always return the same value. * * You may only call this function after the application has been * registered and after the base startup handler has run. You're most * likely to want to use this from your own startup handler. It may * also make sense to consult this function while constructing UI (in * activate, open or an action activation handler) in order to determine * if you should show a gear menu or not. * * This function will return `false` on Mac OS and a default app menu * will be created automatically with the "usual" contents of that menu * typical to most Mac OS applications. If you call * `gtk_application_set_app_menu()` anyway, then this menu will be * replaced with your own. * @returns `true` if you should set an app menu */ prefers_app_menu(): boolean; /** * Removes an accelerator that has been previously added * with `gtk_application_add_accelerator()`. * @param action_name the name of the action to activate * @param parameter parameter to pass when activating the action, or `null` if the action does not accept an activation parameter */ remove_accelerator(action_name: string, parameter: GLib.Variant | null): void; /** * Remove a window from `application`. * * If `window` belongs to `application` then this call is equivalent to * setting the {@link Gtk.Window.application} property of `window` to * `null`. * * The application may stop running as a result of a call to this * function. * @param window a {@link Gtk.Window} */ remove_window(window: Window): void; /** * Sets zero or more keyboard accelerators that will trigger the * given action. The first item in `accels` will be the primary * accelerator, which may be displayed in the UI. * * To remove all accelerators for an action, use an empty, zero-terminated * array for `accels`. * * For the `detailed_action_name`, see `g_action_parse_detailed_name()` and * `g_action_print_detailed_name()`. * @param detailed_action_name a detailed action name, specifying an action and target to associate accelerators with * @param accels a list of accelerators in the format understood by `gtk_accelerator_parse()` */ set_accels_for_action(detailed_action_name: string, accels: string[]): void; /** * Sets or unsets the application menu for `application`. * * This can only be done in the primary instance of the application, * after it has been registered. {@link Gio.Application.SignalSignatures.startup | Gio.Application::startup} is a good place * to call this. * * The application menu is a single menu containing items that typically * impact the application as a whole, rather than acting on a specific * window or document. For example, you would expect to see * “Preferences” or “Quit” in an application menu, but not “Save” or * “Print”. * * If supported, the application menu will be rendered by the desktop * environment. * * Use the base {@link Gio.ActionMap} interface to add actions, to respond to the user * selecting these menu items. * @param app_menu a {@link Gio.MenuModel}, or `null` */ set_app_menu(app_menu: Gio.MenuModel | null): void; /** * Sets or unsets the menubar for windows of `application`. * * This is a menubar in the traditional sense. * * This can only be done in the primary instance of the application, * after it has been registered. {@link Gio.Application.SignalSignatures.startup | Gio.Application::startup} is a good place * to call this. * * Depending on the desktop environment, this may appear at the top of * each window, or at the top of the screen. In some environments, if * both the application menu and the menubar are set, the application * menu will be presented as if it were the first item of the menubar. * Other environments treat the two as completely separate — for example, * the application menu may be rendered by the desktop shell while the * menubar (if set) remains in each individual window. * * Use the base {@link Gio.ActionMap} interface to add actions, to respond to the * user selecting these menu items. * @param menubar a {@link Gio.MenuModel}, or `null` */ set_menubar(menubar: Gio.MenuModel | null): void; /** * Removes an inhibitor that has been established with `gtk_application_inhibit()`. * Inhibitors are also cleared when the application exits. * @param cookie a cookie that was returned by `gtk_application_inhibit()` */ uninhibit(cookie: number): void; /** * Emits the `Gio.ActionGroup::action-added` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group */ action_added(action_name: string): void; /** * Emits the `Gio.ActionGroup::action-enabled-changed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @param enabled whether the action is now enabled */ action_enabled_changed(action_name: string, enabled: boolean): void; /** * Emits the `Gio.ActionGroup::action-removed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group */ action_removed(action_name: string): void; /** * Emits the `Gio.ActionGroup::action-state-changed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @param state the new state of the named action */ action_state_changed(action_name: string, state: GLib.Variant): void; /** * Activate the named action within `action_group`. * * If the action is expecting a parameter, then the correct type of * parameter must be given as `parameter`. If the action is expecting no * parameters then `parameter` must be `NULL`. See * {@link Gio.ActionGroup.get_action_parameter_type}. * * If the {@link Gio.ActionGroup} implementation supports asynchronous remote * activation over D-Bus, this call may return before the relevant * D-Bus traffic has been sent, or any replies have been received. In * order to block on such asynchronous activation calls, * {@link Gio.DBusConnection.flush} should be called prior to the code, which * depends on the result of the action activation. Without flushing * the D-Bus connection, there is no guarantee that the action would * have been activated. * * The following code which runs in a remote app instance, shows an * example of a ‘quit’ action being activated on the primary app * instance over D-Bus. Here {@link Gio.DBusConnection.flush} is called * before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action * may fail to be activated on the primary instance. * * ```c * // call ‘quit’ action on primary instance * g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); * * // make sure the action is activated now * g_dbus_connection_flush (…); * * g_debug ("Application has been terminated. Exiting."); * * exit (0); * ``` * @param action_name the name of the action to activate * @param parameter parameters to the activation */ activate_action(action_name: string, parameter: GLib.Variant | null): void; /** * Request for the state of the named action within `action_group` to be * changed to `value`. * * The action must be stateful and `value` must be of the correct type. * See {@link Gio.ActionGroup.get_action_state_type}. * * This call merely requests a change. The action may refuse to change * its state or may change its state to something other than `value`. * See {@link Gio.ActionGroup.get_action_state_hint}. * * If the `value` GVariant is floating, it is consumed. * @param action_name the name of the action to request the change on * @param value the new state */ change_action_state(action_name: string, value: GLib.Variant): void; /** * Checks if the named action within `action_group` is currently enabled. * * An action must be enabled in order to be activated or in order to * have its state changed from outside callers. * @param action_name the name of the action to query * @returns whether the action is currently enabled */ get_action_enabled(action_name: string): boolean; /** * Queries the type of the parameter that must be given when activating * the named action within `action_group`. * * When activating the action using {@link Gio.ActionGroup.activate_action}, * the {@link GLib.Variant} given to that function must be of the type returned * by this function. * * In the case that this function returns `NULL`, you must not give any * {@link GLib.Variant}, but `NULL` instead. * * The parameter type of a particular action will never change but it is * possible for an action to be removed and for a new action to be added * with the same name but a different parameter type. * @param action_name the name of the action to query * @returns the parameter type */ get_action_parameter_type(action_name: string): GLib.VariantType | null; /** * Queries the current state of the named action within `action_group`. * * If the action is not stateful then `NULL` will be returned. If the * action is stateful then the type of the return value is the type * given by {@link Gio.ActionGroup.get_action_state_type}. * * The return value (if non-`NULL`) should be freed with * {@link GLib.Variant.unref} when it is no longer required. * @param action_name the name of the action to query * @returns the current state of the action */ get_action_state(action_name: string): GLib.Variant | null; /** * Requests a hint about the valid range of values for the state of the * named action within `action_group`. * * If `NULL` is returned it either means that the action is not stateful * or that there is no hint about the valid range of values for the * state of the action. * * If a {@link GLib.Variant} array is returned then each item in the array is a * possible value for the state. If a {@link GLib.Variant} pair (ie: two-tuple) is * returned then the tuple specifies the inclusive lower and upper bound * of valid values for the state. * * In any case, the information is merely a hint. It may be possible to * have a state value outside of the hinted range and setting a value * within the range may fail. * * The return value (if non-`NULL`) should be freed with * {@link GLib.Variant.unref} when it is no longer required. * @param action_name the name of the action to query * @returns the state range hint */ get_action_state_hint(action_name: string): GLib.Variant | null; /** * Queries the type of the state of the named action within * `action_group`. * * If the action is stateful then this function returns the * {@link GLib.VariantType} of the state. All calls to * {@link Gio.ActionGroup.change_action_state} must give a {@link GLib.Variant} of this * type and {@link Gio.ActionGroup.get_action_state} will return a {@link GLib.Variant} * of the same type. * * If the action is not stateful then this function will return `NULL`. * In that case, {@link Gio.ActionGroup.get_action_state} will return `NULL` * and you must not call {@link Gio.ActionGroup.change_action_state}. * * The state type of a particular action will never change but it is * possible for an action to be removed and for a new action to be added * with the same name but a different state type. * @param action_name the name of the action to query * @returns the state type, if the action is stateful */ get_action_state_type(action_name: string): GLib.VariantType | null; /** * Checks if the named action exists within `action_group`. * @param action_name the name of the action to check for * @returns whether the named action exists */ has_action(action_name: string): boolean; /** * Lists the actions contained within `action_group`. * * The caller is responsible for freeing the list with {@link GLib.strfreev} when * it is no longer required. * @returns a `NULL`-terminated array of the names of the actions in the group */ list_actions(): string[]; /** * Queries all aspects of the named action within an `action_group`. * * This function acquires the information available from * {@link Gio.ActionGroup.has_action}, {@link Gio.ActionGroup.get_action_enabled}, * {@link Gio.ActionGroup.get_action_parameter_type}, * {@link Gio.ActionGroup.get_action_state_type}, * {@link Gio.ActionGroup.get_action_state_hint} and * {@link Gio.ActionGroup.get_action_state} with a single function call. * * This provides two main benefits. * * The first is the improvement in efficiency that comes with not having * to perform repeated lookups of the action in order to discover * different things about it. The second is that implementing * {@link Gio.ActionGroup} can now be done by only overriding this one virtual * function. * * The interface provides a default implementation of this function that * calls the individual functions, as required, to fetch the * information. The interface also provides default implementations of * those functions that call this function. All implementations, * therefore, must override either this function or all of the others. * * If the action exists, `TRUE` is returned and any of the requested * fields (as indicated by having a non-`NULL` reference passed in) are * filled. If the action doesn’t exist, `FALSE` is returned and the * fields may or may not have been modified. * @param action_name the name of an action in the group * @returns `TRUE` if the action exists, else `FALSE` */ query_action(action_name: string): [boolean, boolean, GLib.VariantType | null, GLib.VariantType | null, GLib.Variant | null, GLib.Variant | null]; /** * Emits the `Gio.ActionGroup::action-added` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @virtual */ vfunc_action_added(action_name: string): void; /** * Emits the `Gio.ActionGroup::action-enabled-changed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @param enabled whether the action is now enabled * @virtual */ vfunc_action_enabled_changed(action_name: string, enabled: boolean): void; /** * Emits the `Gio.ActionGroup::action-removed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @virtual */ vfunc_action_removed(action_name: string): void; /** * Emits the `Gio.ActionGroup::action-state-changed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @param state the new state of the named action * @virtual */ vfunc_action_state_changed(action_name: string, state: GLib.Variant): void; /** * Activate the named action within `action_group`. * * If the action is expecting a parameter, then the correct type of * parameter must be given as `parameter`. If the action is expecting no * parameters then `parameter` must be `NULL`. See * {@link Gio.ActionGroup.get_action_parameter_type}. * * If the {@link Gio.ActionGroup} implementation supports asynchronous remote * activation over D-Bus, this call may return before the relevant * D-Bus traffic has been sent, or any replies have been received. In * order to block on such asynchronous activation calls, * {@link Gio.DBusConnection.flush} should be called prior to the code, which * depends on the result of the action activation. Without flushing * the D-Bus connection, there is no guarantee that the action would * have been activated. * * The following code which runs in a remote app instance, shows an * example of a ‘quit’ action being activated on the primary app * instance over D-Bus. Here {@link Gio.DBusConnection.flush} is called * before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action * may fail to be activated on the primary instance. * * ```c * // call ‘quit’ action on primary instance * g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); * * // make sure the action is activated now * g_dbus_connection_flush (…); * * g_debug ("Application has been terminated. Exiting."); * * exit (0); * ``` * @param action_name the name of the action to activate * @param parameter parameters to the activation * @virtual */ vfunc_activate_action(action_name: string, parameter: GLib.Variant | null): void; /** * Request for the state of the named action within `action_group` to be * changed to `value`. * * The action must be stateful and `value` must be of the correct type. * See {@link Gio.ActionGroup.get_action_state_type}. * * This call merely requests a change. The action may refuse to change * its state or may change its state to something other than `value`. * See {@link Gio.ActionGroup.get_action_state_hint}. * * If the `value` GVariant is floating, it is consumed. * @param action_name the name of the action to request the change on * @param value the new state * @virtual */ vfunc_change_action_state(action_name: string, value: GLib.Variant): void; /** * Checks if the named action within `action_group` is currently enabled. * * An action must be enabled in order to be activated or in order to * have its state changed from outside callers. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_enabled(action_name: string): boolean; /** * Queries the type of the parameter that must be given when activating * the named action within `action_group`. * * When activating the action using {@link Gio.ActionGroup.activate_action}, * the {@link GLib.Variant} given to that function must be of the type returned * by this function. * * In the case that this function returns `NULL`, you must not give any * {@link GLib.Variant}, but `NULL` instead. * * The parameter type of a particular action will never change but it is * possible for an action to be removed and for a new action to be added * with the same name but a different parameter type. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_parameter_type(action_name: string): GLib.VariantType | null; /** * Queries the current state of the named action within `action_group`. * * If the action is not stateful then `NULL` will be returned. If the * action is stateful then the type of the return value is the type * given by {@link Gio.ActionGroup.get_action_state_type}. * * The return value (if non-`NULL`) should be freed with * {@link GLib.Variant.unref} when it is no longer required. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_state(action_name: string): GLib.Variant | null; /** * Requests a hint about the valid range of values for the state of the * named action within `action_group`. * * If `NULL` is returned it either means that the action is not stateful * or that there is no hint about the valid range of values for the * state of the action. * * If a {@link GLib.Variant} array is returned then each item in the array is a * possible value for the state. If a {@link GLib.Variant} pair (ie: two-tuple) is * returned then the tuple specifies the inclusive lower and upper bound * of valid values for the state. * * In any case, the information is merely a hint. It may be possible to * have a state value outside of the hinted range and setting a value * within the range may fail. * * The return value (if non-`NULL`) should be freed with * {@link GLib.Variant.unref} when it is no longer required. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_state_hint(action_name: string): GLib.Variant | null; /** * Queries the type of the state of the named action within * `action_group`. * * If the action is stateful then this function returns the * {@link GLib.VariantType} of the state. All calls to * {@link Gio.ActionGroup.change_action_state} must give a {@link GLib.Variant} of this * type and {@link Gio.ActionGroup.get_action_state} will return a {@link GLib.Variant} * of the same type. * * If the action is not stateful then this function will return `NULL`. * In that case, {@link Gio.ActionGroup.get_action_state} will return `NULL` * and you must not call {@link Gio.ActionGroup.change_action_state}. * * The state type of a particular action will never change but it is * possible for an action to be removed and for a new action to be added * with the same name but a different state type. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_state_type(action_name: string): GLib.VariantType | null; /** * Checks if the named action exists within `action_group`. * @param action_name the name of the action to check for * @virtual */ vfunc_has_action(action_name: string): boolean; /** * Lists the actions contained within `action_group`. * * The caller is responsible for freeing the list with {@link GLib.strfreev} when * it is no longer required. * @virtual */ vfunc_list_actions(): string[]; /** * Queries all aspects of the named action within an `action_group`. * * This function acquires the information available from * {@link Gio.ActionGroup.has_action}, {@link Gio.ActionGroup.get_action_enabled}, * {@link Gio.ActionGroup.get_action_parameter_type}, * {@link Gio.ActionGroup.get_action_state_type}, * {@link Gio.ActionGroup.get_action_state_hint} and * {@link Gio.ActionGroup.get_action_state} with a single function call. * * This provides two main benefits. * * The first is the improvement in efficiency that comes with not having * to perform repeated lookups of the action in order to discover * different things about it. The second is that implementing * {@link Gio.ActionGroup} can now be done by only overriding this one virtual * function. * * The interface provides a default implementation of this function that * calls the individual functions, as required, to fetch the * information. The interface also provides default implementations of * those functions that call this function. All implementations, * therefore, must override either this function or all of the others. * * If the action exists, `TRUE` is returned and any of the requested * fields (as indicated by having a non-`NULL` reference passed in) are * filled. If the action doesn’t exist, `FALSE` is returned and the * fields may or may not have been modified. * @param action_name the name of an action in the group * @virtual */ vfunc_query_action(action_name: string): [boolean, boolean, GLib.VariantType | null, GLib.VariantType | null, GLib.Variant | null, GLib.Variant | null]; /** * Adds an action to the `action_map`. * * If the action map already contains an action with the same name * as `action` then the old action is dropped from the action map. * * The action map takes its own reference on `action`. * @param action a {@link Gio.Action} */ add_action(action: Gio.Action): void; /** * A convenience function for creating multiple simple actions. * See Gio.ActionEntryObj for the structure of the action entry. * @param entries Array of action entries to add */ add_action_entries(entries: Gio.ActionEntryObj[]): void; /** * Looks up the action with the name `action_name` in `action_map`. * * If no such action exists, returns `NULL`. * @param action_name the name of an action * @returns a {@link Gio.Action} */ lookup_action(action_name: string): Gio.Action | null; /** * Removes the named action from the action map. * * If no action of this name is in the map then nothing happens. * @param action_name the name of the action */ remove_action(action_name: string): void; /** * Remove actions from a {@link Gio.ActionMap}. This is meant as the reverse of * {@link Gio.ActionMap.add_action_entries}. * * * ```c * static const GActionEntry entries[] = { * { "quit", activate_quit }, * { "print-string", activate_print_string, "s" } * }; * * void * add_actions (GActionMap *map) * { * g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL); * } * * void * remove_actions (GActionMap *map) * { * g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries)); * } * ``` * @param entries a pointer to the first item in an array of {@link Gio.ActionEntry} structs */ remove_action_entries(entries: Gio.ActionEntry[]): void; /** * Adds an action to the `action_map`. * * If the action map already contains an action with the same name * as `action` then the old action is dropped from the action map. * * The action map takes its own reference on `action`. * @param action a {@link Gio.Action} * @virtual */ vfunc_add_action(action: Gio.Action): void; /** * Looks up the action with the name `action_name` in `action_map`. * * If no such action exists, returns `NULL`. * @param action_name the name of an action * @virtual */ vfunc_lookup_action(action_name: string): Gio.Action | null; /** * Removes the named action from the action map. * * If no action of this name is in the map then nothing happens. * @param action_name the name of the action * @virtual */ vfunc_remove_action(action_name: string): void; } namespace ApplicationWindow { // Signal signatures interface SignalSignatures extends Window.SignalSignatures { "notify::show-menubar": (pspec: GObject.ParamSpec) => void; "notify::accept-focus": (pspec: GObject.ParamSpec) => void; "notify::application": (pspec: GObject.ParamSpec) => void; "notify::attached-to": (pspec: GObject.ParamSpec) => void; "notify::decorated": (pspec: GObject.ParamSpec) => void; "notify::default-height": (pspec: GObject.ParamSpec) => void; "notify::default-width": (pspec: GObject.ParamSpec) => void; "notify::deletable": (pspec: GObject.ParamSpec) => void; "notify::destroy-with-parent": (pspec: GObject.ParamSpec) => void; "notify::focus-on-map": (pspec: GObject.ParamSpec) => void; "notify::focus-visible": (pspec: GObject.ParamSpec) => void; "notify::gravity": (pspec: GObject.ParamSpec) => void; "notify::has-resize-grip": (pspec: GObject.ParamSpec) => void; "notify::has-toplevel-focus": (pspec: GObject.ParamSpec) => void; "notify::hide-titlebar-when-maximized": (pspec: GObject.ParamSpec) => void; "notify::icon": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-active": (pspec: GObject.ParamSpec) => void; "notify::is-maximized": (pspec: GObject.ParamSpec) => void; "notify::mnemonics-visible": (pspec: GObject.ParamSpec) => void; "notify::modal": (pspec: GObject.ParamSpec) => void; "notify::resizable": (pspec: GObject.ParamSpec) => void; "notify::resize-grip-visible": (pspec: GObject.ParamSpec) => void; "notify::role": (pspec: GObject.ParamSpec) => void; "notify::screen": (pspec: GObject.ParamSpec) => void; "notify::skip-pager-hint": (pspec: GObject.ParamSpec) => void; "notify::skip-taskbar-hint": (pspec: GObject.ParamSpec) => void; "notify::startup-id": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; "notify::transient-for": (pspec: GObject.ParamSpec) => void; "notify::type": (pspec: GObject.ParamSpec) => void; "notify::type-hint": (pspec: GObject.ParamSpec) => void; "notify::urgency-hint": (pspec: GObject.ParamSpec) => void; "notify::window-position": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Window.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Gio.ActionGroup.ConstructorProps, Gio.ActionMap.ConstructorProps, Buildable.ConstructorProps { show_menubar: boolean; showMenubar: boolean; } } /** * {@link Gtk.ApplicationWindow} is a {@link Gtk.Window} subclass that offers some * extra functionality for better integration with {@link Gtk.Application} * features. Notably, it can handle both the application menu as well * as the menubar. See `gtk_application_set_app_menu()` and * `gtk_application_set_menubar()`. * * This class implements the {@link Gio.ActionGroup} and {@link Gio.ActionMap} interfaces, * to let you add window-specific actions that will be exported by the * associated {@link Gtk.Application}, together with its application-wide * actions. Window-specific actions are prefixed with the “win.” * prefix and application-wide actions are prefixed with the “app.” * prefix. Actions must be addressed with the prefixed name when * referring to them from a {@link Gio.MenuModel}. * * Note that widgets that are placed inside a {@link Gtk.ApplicationWindow} * can also activate these actions, if they implement the * {@link Gtk.Actionable} interface. * * As with {@link Gtk.Application}, the GDK lock will be acquired when * processing actions arriving from other processes and should therefore * be held when activating actions locally (if GDK threads are enabled). * * The settings {@link Gtk.Settings.gtk_shell_shows_app_menu} and * {@link Gtk.Settings.gtk_shell_shows_menubar} tell GTK+ whether the * desktop environment is showing the application menu and menubar * models outside the application as part of the desktop shell. * For instance, on OS X, both menus will be displayed remotely; * on Windows neither will be. gnome-shell (starting with version 3.4) * will display the application menu, but not the menubar. * * If the desktop environment does not display the menubar, then * {@link Gtk.ApplicationWindow} will automatically show a {@link Gtk.MenuBar} for it. * This behaviour can be overridden with the {@link Gtk.ApplicationWindow.show_menubar} * property. If the desktop environment does not display the application * menu, then it will automatically be included in the menubar or in the * windows client-side decorations. * * ## A GtkApplicationWindow with a menubar * * * ```c * GtkApplication *app = gtk_application_new ("org.gtk.test", 0); * * GtkBuilder *builder = gtk_builder_new_from_string ( * "" * " " * " " * " " * " " * " " * " " * "", * -1); * * GMenuModel *menubar = G_MENU_MODEL (gtk_builder_get_object (builder, * "menubar")); * gtk_application_set_menubar (GTK_APPLICATION (app), menubar); * g_object_unref (builder); * * // ... * * GtkWidget *window = gtk_application_window_new (app); * ``` * * * ## Handling fallback yourself * * [A simple example](https://git.gnome.org/browse/gtk+/tree/examples/sunny.c) * * The XML format understood by {@link Gtk.Builder} for {@link Gio.MenuModel} consists * of a toplevel `` element, which contains one or more `` * elements. Each `` element contains `` and `` * elements with a mandatory name attribute. `` elements have the * same content model as ``. Instead of ``, you can use `` or `
` * elements. * * Attribute values can be translated using gettext, like other {@link Gtk.Builder} * content. `` elements can be marked for translation with a * `translatable="yes"` attribute. It is also possible to specify message * context and translator comments, using the context and comments attributes. * To make use of this, the {@link Gtk.Builder} must have been given the gettext * domain to use. * * The following attributes are used when constructing menu items: * - "label": a user-visible string to display * - "action": the prefixed name of the action to trigger * - "target": the parameter to use when activating the action * - "icon" and "verb-icon": names of icons that may be displayed * - "submenu-action": name of an action that may be used to determine * if a submenu can be opened * - "hidden-when": a string used to determine when the item will be hidden. * Possible values include "action-disabled", "action-missing", "macos-menubar". * * The following attributes are used when constructing sections: * - "label": a user-visible string to use as section heading * - "display-hint": a string used to determine special formatting for the section. * Possible values include "horizontal-buttons". * - "text-direction": a string used to determine the {@link Gtk.TextDirection} to use * when "display-hint" is set to "horizontal-buttons". Possible values * include "rtl", "ltr", and "none". * * The following attributes are used when constructing submenus: * - "label": a user-visible string to display * - "icon": icon name to display * @gir-type Class */ class ApplicationWindow extends Window implements Atk.ImplementorIface, Gio.ActionGroup, Gio.ActionMap, Buildable { static $gtype: GObject.GType; // Properties /** * If this property is `true`, the window will display a menubar * that includes the app menu and menubar, unless these are * shown by the desktop shell. See `gtk_application_set_app_menu()` * and `gtk_application_set_menubar()`. * * If `false`, the window will not display a menubar, regardless * of whether the desktop shell is showing the menus or not. * @default true */ get show_menubar(): boolean; set show_menubar(val: boolean); /** * If this property is `true`, the window will display a menubar * that includes the app menu and menubar, unless these are * shown by the desktop shell. See `gtk_application_set_app_menu()` * and `gtk_application_set_menubar()`. * * If `false`, the window will not display a menubar, regardless * of whether the desktop shell is showing the menus or not. * @default true */ get showMenubar(): boolean; set showMenubar(val: boolean); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: ApplicationWindow.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](application: Application): ApplicationWindow; // Conflicted with Gtk.Window.new static ["new"](...args: never[]): any; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Gets the {@link Gtk.ShortcutsWindow} that has been set up with * a prior call to `gtk_application_window_set_help_overlay()`. * @returns the help overlay associated with `window`, or `null` */ get_help_overlay(): ShortcutsWindow | null; /** * Returns the unique ID of the window. If the window has not yet been added to * a {@link Gtk.Application}, returns `0`. * @returns the unique ID for `window`, or `0` if the window has not yet been added to a {@link Gtk.Application} */ get_id(): number; /** * Returns whether the window will display a menubar for the app menu * and menubar as needed. * @returns `true` if `window` will display a menubar when needed */ get_show_menubar(): boolean; /** * Associates a shortcuts window with the application window, and * sets up an action with the name win.show-help-overlay to present * it. * * `window` takes resposibility for destroying `help_overlay`. * @param help_overlay a {@link Gtk.ShortcutsWindow} */ set_help_overlay(help_overlay: ShortcutsWindow | null): void; /** * Sets whether the window will display a menubar for the app menu * and menubar as needed. * @param show_menubar whether to show a menubar when needed */ set_show_menubar(show_menubar: boolean): void; /** * Emits the `Gio.ActionGroup::action-added` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group */ action_added(action_name: string): void; /** * Emits the `Gio.ActionGroup::action-enabled-changed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @param enabled whether the action is now enabled */ action_enabled_changed(action_name: string, enabled: boolean): void; /** * Emits the `Gio.ActionGroup::action-removed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group */ action_removed(action_name: string): void; /** * Emits the `Gio.ActionGroup::action-state-changed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @param state the new state of the named action */ action_state_changed(action_name: string, state: GLib.Variant): void; /** * Activate the named action within `action_group`. * * If the action is expecting a parameter, then the correct type of * parameter must be given as `parameter`. If the action is expecting no * parameters then `parameter` must be `NULL`. See * {@link Gio.ActionGroup.get_action_parameter_type}. * * If the {@link Gio.ActionGroup} implementation supports asynchronous remote * activation over D-Bus, this call may return before the relevant * D-Bus traffic has been sent, or any replies have been received. In * order to block on such asynchronous activation calls, * {@link Gio.DBusConnection.flush} should be called prior to the code, which * depends on the result of the action activation. Without flushing * the D-Bus connection, there is no guarantee that the action would * have been activated. * * The following code which runs in a remote app instance, shows an * example of a ‘quit’ action being activated on the primary app * instance over D-Bus. Here {@link Gio.DBusConnection.flush} is called * before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action * may fail to be activated on the primary instance. * * ```c * // call ‘quit’ action on primary instance * g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); * * // make sure the action is activated now * g_dbus_connection_flush (…); * * g_debug ("Application has been terminated. Exiting."); * * exit (0); * ``` * @param action_name the name of the action to activate * @param parameter parameters to the activation */ activate_action(action_name: string, parameter: GLib.Variant | null): void; /** * Request for the state of the named action within `action_group` to be * changed to `value`. * * The action must be stateful and `value` must be of the correct type. * See {@link Gio.ActionGroup.get_action_state_type}. * * This call merely requests a change. The action may refuse to change * its state or may change its state to something other than `value`. * See {@link Gio.ActionGroup.get_action_state_hint}. * * If the `value` GVariant is floating, it is consumed. * @param action_name the name of the action to request the change on * @param value the new state */ change_action_state(action_name: string, value: GLib.Variant): void; /** * Checks if the named action within `action_group` is currently enabled. * * An action must be enabled in order to be activated or in order to * have its state changed from outside callers. * @param action_name the name of the action to query * @returns whether the action is currently enabled */ get_action_enabled(action_name: string): boolean; /** * Queries the type of the parameter that must be given when activating * the named action within `action_group`. * * When activating the action using {@link Gio.ActionGroup.activate_action}, * the {@link GLib.Variant} given to that function must be of the type returned * by this function. * * In the case that this function returns `NULL`, you must not give any * {@link GLib.Variant}, but `NULL` instead. * * The parameter type of a particular action will never change but it is * possible for an action to be removed and for a new action to be added * with the same name but a different parameter type. * @param action_name the name of the action to query * @returns the parameter type */ get_action_parameter_type(action_name: string): GLib.VariantType | null; /** * Queries the current state of the named action within `action_group`. * * If the action is not stateful then `NULL` will be returned. If the * action is stateful then the type of the return value is the type * given by {@link Gio.ActionGroup.get_action_state_type}. * * The return value (if non-`NULL`) should be freed with * {@link GLib.Variant.unref} when it is no longer required. * @param action_name the name of the action to query * @returns the current state of the action */ get_action_state(action_name: string): GLib.Variant | null; /** * Requests a hint about the valid range of values for the state of the * named action within `action_group`. * * If `NULL` is returned it either means that the action is not stateful * or that there is no hint about the valid range of values for the * state of the action. * * If a {@link GLib.Variant} array is returned then each item in the array is a * possible value for the state. If a {@link GLib.Variant} pair (ie: two-tuple) is * returned then the tuple specifies the inclusive lower and upper bound * of valid values for the state. * * In any case, the information is merely a hint. It may be possible to * have a state value outside of the hinted range and setting a value * within the range may fail. * * The return value (if non-`NULL`) should be freed with * {@link GLib.Variant.unref} when it is no longer required. * @param action_name the name of the action to query * @returns the state range hint */ get_action_state_hint(action_name: string): GLib.Variant | null; /** * Queries the type of the state of the named action within * `action_group`. * * If the action is stateful then this function returns the * {@link GLib.VariantType} of the state. All calls to * {@link Gio.ActionGroup.change_action_state} must give a {@link GLib.Variant} of this * type and {@link Gio.ActionGroup.get_action_state} will return a {@link GLib.Variant} * of the same type. * * If the action is not stateful then this function will return `NULL`. * In that case, {@link Gio.ActionGroup.get_action_state} will return `NULL` * and you must not call {@link Gio.ActionGroup.change_action_state}. * * The state type of a particular action will never change but it is * possible for an action to be removed and for a new action to be added * with the same name but a different state type. * @param action_name the name of the action to query * @returns the state type, if the action is stateful */ get_action_state_type(action_name: string): GLib.VariantType | null; /** * Checks if the named action exists within `action_group`. * @param action_name the name of the action to check for * @returns whether the named action exists */ has_action(action_name: string): boolean; /** * Lists the actions contained within `action_group`. * * The caller is responsible for freeing the list with {@link GLib.strfreev} when * it is no longer required. * @returns a `NULL`-terminated array of the names of the actions in the group */ list_actions(): string[]; /** * Queries all aspects of the named action within an `action_group`. * * This function acquires the information available from * {@link Gio.ActionGroup.has_action}, {@link Gio.ActionGroup.get_action_enabled}, * {@link Gio.ActionGroup.get_action_parameter_type}, * {@link Gio.ActionGroup.get_action_state_type}, * {@link Gio.ActionGroup.get_action_state_hint} and * {@link Gio.ActionGroup.get_action_state} with a single function call. * * This provides two main benefits. * * The first is the improvement in efficiency that comes with not having * to perform repeated lookups of the action in order to discover * different things about it. The second is that implementing * {@link Gio.ActionGroup} can now be done by only overriding this one virtual * function. * * The interface provides a default implementation of this function that * calls the individual functions, as required, to fetch the * information. The interface also provides default implementations of * those functions that call this function. All implementations, * therefore, must override either this function or all of the others. * * If the action exists, `TRUE` is returned and any of the requested * fields (as indicated by having a non-`NULL` reference passed in) are * filled. If the action doesn’t exist, `FALSE` is returned and the * fields may or may not have been modified. * @param action_name the name of an action in the group * @returns `TRUE` if the action exists, else `FALSE` */ query_action(action_name: string): [boolean, boolean, GLib.VariantType | null, GLib.VariantType | null, GLib.Variant | null, GLib.Variant | null]; /** * Emits the `Gio.ActionGroup::action-added` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @virtual */ vfunc_action_added(action_name: string): void; /** * Emits the `Gio.ActionGroup::action-enabled-changed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @param enabled whether the action is now enabled * @virtual */ vfunc_action_enabled_changed(action_name: string, enabled: boolean): void; /** * Emits the `Gio.ActionGroup::action-removed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @virtual */ vfunc_action_removed(action_name: string): void; /** * Emits the `Gio.ActionGroup::action-state-changed` signal on `action_group`. * * This function should only be called by {@link Gio.ActionGroup} implementations. * @param action_name the name of an action in the group * @param state the new state of the named action * @virtual */ vfunc_action_state_changed(action_name: string, state: GLib.Variant): void; /** * Activate the named action within `action_group`. * * If the action is expecting a parameter, then the correct type of * parameter must be given as `parameter`. If the action is expecting no * parameters then `parameter` must be `NULL`. See * {@link Gio.ActionGroup.get_action_parameter_type}. * * If the {@link Gio.ActionGroup} implementation supports asynchronous remote * activation over D-Bus, this call may return before the relevant * D-Bus traffic has been sent, or any replies have been received. In * order to block on such asynchronous activation calls, * {@link Gio.DBusConnection.flush} should be called prior to the code, which * depends on the result of the action activation. Without flushing * the D-Bus connection, there is no guarantee that the action would * have been activated. * * The following code which runs in a remote app instance, shows an * example of a ‘quit’ action being activated on the primary app * instance over D-Bus. Here {@link Gio.DBusConnection.flush} is called * before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action * may fail to be activated on the primary instance. * * ```c * // call ‘quit’ action on primary instance * g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); * * // make sure the action is activated now * g_dbus_connection_flush (…); * * g_debug ("Application has been terminated. Exiting."); * * exit (0); * ``` * @param action_name the name of the action to activate * @param parameter parameters to the activation * @virtual */ vfunc_activate_action(action_name: string, parameter: GLib.Variant | null): void; /** * Request for the state of the named action within `action_group` to be * changed to `value`. * * The action must be stateful and `value` must be of the correct type. * See {@link Gio.ActionGroup.get_action_state_type}. * * This call merely requests a change. The action may refuse to change * its state or may change its state to something other than `value`. * See {@link Gio.ActionGroup.get_action_state_hint}. * * If the `value` GVariant is floating, it is consumed. * @param action_name the name of the action to request the change on * @param value the new state * @virtual */ vfunc_change_action_state(action_name: string, value: GLib.Variant): void; /** * Checks if the named action within `action_group` is currently enabled. * * An action must be enabled in order to be activated or in order to * have its state changed from outside callers. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_enabled(action_name: string): boolean; /** * Queries the type of the parameter that must be given when activating * the named action within `action_group`. * * When activating the action using {@link Gio.ActionGroup.activate_action}, * the {@link GLib.Variant} given to that function must be of the type returned * by this function. * * In the case that this function returns `NULL`, you must not give any * {@link GLib.Variant}, but `NULL` instead. * * The parameter type of a particular action will never change but it is * possible for an action to be removed and for a new action to be added * with the same name but a different parameter type. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_parameter_type(action_name: string): GLib.VariantType | null; /** * Queries the current state of the named action within `action_group`. * * If the action is not stateful then `NULL` will be returned. If the * action is stateful then the type of the return value is the type * given by {@link Gio.ActionGroup.get_action_state_type}. * * The return value (if non-`NULL`) should be freed with * {@link GLib.Variant.unref} when it is no longer required. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_state(action_name: string): GLib.Variant | null; /** * Requests a hint about the valid range of values for the state of the * named action within `action_group`. * * If `NULL` is returned it either means that the action is not stateful * or that there is no hint about the valid range of values for the * state of the action. * * If a {@link GLib.Variant} array is returned then each item in the array is a * possible value for the state. If a {@link GLib.Variant} pair (ie: two-tuple) is * returned then the tuple specifies the inclusive lower and upper bound * of valid values for the state. * * In any case, the information is merely a hint. It may be possible to * have a state value outside of the hinted range and setting a value * within the range may fail. * * The return value (if non-`NULL`) should be freed with * {@link GLib.Variant.unref} when it is no longer required. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_state_hint(action_name: string): GLib.Variant | null; /** * Queries the type of the state of the named action within * `action_group`. * * If the action is stateful then this function returns the * {@link GLib.VariantType} of the state. All calls to * {@link Gio.ActionGroup.change_action_state} must give a {@link GLib.Variant} of this * type and {@link Gio.ActionGroup.get_action_state} will return a {@link GLib.Variant} * of the same type. * * If the action is not stateful then this function will return `NULL`. * In that case, {@link Gio.ActionGroup.get_action_state} will return `NULL` * and you must not call {@link Gio.ActionGroup.change_action_state}. * * The state type of a particular action will never change but it is * possible for an action to be removed and for a new action to be added * with the same name but a different state type. * @param action_name the name of the action to query * @virtual */ vfunc_get_action_state_type(action_name: string): GLib.VariantType | null; /** * Checks if the named action exists within `action_group`. * @param action_name the name of the action to check for * @virtual */ vfunc_has_action(action_name: string): boolean; /** * Lists the actions contained within `action_group`. * * The caller is responsible for freeing the list with {@link GLib.strfreev} when * it is no longer required. * @virtual */ vfunc_list_actions(): string[]; /** * Queries all aspects of the named action within an `action_group`. * * This function acquires the information available from * {@link Gio.ActionGroup.has_action}, {@link Gio.ActionGroup.get_action_enabled}, * {@link Gio.ActionGroup.get_action_parameter_type}, * {@link Gio.ActionGroup.get_action_state_type}, * {@link Gio.ActionGroup.get_action_state_hint} and * {@link Gio.ActionGroup.get_action_state} with a single function call. * * This provides two main benefits. * * The first is the improvement in efficiency that comes with not having * to perform repeated lookups of the action in order to discover * different things about it. The second is that implementing * {@link Gio.ActionGroup} can now be done by only overriding this one virtual * function. * * The interface provides a default implementation of this function that * calls the individual functions, as required, to fetch the * information. The interface also provides default implementations of * those functions that call this function. All implementations, * therefore, must override either this function or all of the others. * * If the action exists, `TRUE` is returned and any of the requested * fields (as indicated by having a non-`NULL` reference passed in) are * filled. If the action doesn’t exist, `FALSE` is returned and the * fields may or may not have been modified. * @param action_name the name of an action in the group * @virtual */ vfunc_query_action(action_name: string): [boolean, boolean, GLib.VariantType | null, GLib.VariantType | null, GLib.Variant | null, GLib.Variant | null]; /** * Adds an action to the `action_map`. * * If the action map already contains an action with the same name * as `action` then the old action is dropped from the action map. * * The action map takes its own reference on `action`. * @param action a {@link Gio.Action} */ add_action(action: Gio.Action): void; /** * A convenience function for creating multiple simple actions. * See Gio.ActionEntryObj for the structure of the action entry. * @param entries Array of action entries to add */ add_action_entries(entries: Gio.ActionEntryObj[]): void; /** * Looks up the action with the name `action_name` in `action_map`. * * If no such action exists, returns `NULL`. * @param action_name the name of an action * @returns a {@link Gio.Action} */ lookup_action(action_name: string): Gio.Action | null; /** * Removes the named action from the action map. * * If no action of this name is in the map then nothing happens. * @param action_name the name of the action */ remove_action(action_name: string): void; /** * Remove actions from a {@link Gio.ActionMap}. This is meant as the reverse of * {@link Gio.ActionMap.add_action_entries}. * * * ```c * static const GActionEntry entries[] = { * { "quit", activate_quit }, * { "print-string", activate_print_string, "s" } * }; * * void * add_actions (GActionMap *map) * { * g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL); * } * * void * remove_actions (GActionMap *map) * { * g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries)); * } * ``` * @param entries a pointer to the first item in an array of {@link Gio.ActionEntry} structs */ remove_action_entries(entries: Gio.ActionEntry[]): void; /** * Adds an action to the `action_map`. * * If the action map already contains an action with the same name * as `action` then the old action is dropped from the action map. * * The action map takes its own reference on `action`. * @param action a {@link Gio.Action} * @virtual */ vfunc_add_action(action: Gio.Action): void; /** * Looks up the action with the name `action_name` in `action_map`. * * If no such action exists, returns `NULL`. * @param action_name the name of an action * @virtual */ vfunc_lookup_action(action_name: string): Gio.Action | null; /** * Removes the named action from the action map. * * If no action of this name is in the map then nothing happens. * @param action_name the name of the action * @virtual */ vfunc_remove_action(action_name: string): void; } namespace Arrow { // Signal signatures interface SignalSignatures extends Misc.SignalSignatures { "notify::arrow-type": (pspec: GObject.ParamSpec) => void; "notify::shadow-type": (pspec: GObject.ParamSpec) => void; "notify::xalign": (pspec: GObject.ParamSpec) => void; "notify::xpad": (pspec: GObject.ParamSpec) => void; "notify::yalign": (pspec: GObject.ParamSpec) => void; "notify::ypad": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Misc.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { arrow_type: ArrowType; arrowType: ArrowType; shadow_type: ShadowType; shadowType: ShadowType; } } /** * GtkArrow should be used to draw simple arrows that need to point in * one of the four cardinal directions (up, down, left, or right). The * style of the arrow can be one of shadow in, shadow out, etched in, or * etched out. Note that these directions and style types may be * amended in versions of GTK+ to come. * * GtkArrow will fill any space alloted to it, but since it is inherited * from {@link Gtk.Misc}, it can be padded and/or aligned, to fill exactly the * space the programmer desires. * * Arrows are created with a call to `gtk_arrow_new()`. The direction or * style of an arrow can be changed after creation by using `gtk_arrow_set()`. * * GtkArrow has been deprecated; you can simply use a {@link Gtk.Image} with a * suitable icon name, such as “pan-down-symbolic“. When replacing * GtkArrow by an image, pay attention to the fact that GtkArrow is * doing automatic flipping between #GTK_ARROW_LEFT and #GTK_ARROW_RIGHT, * depending on the text direction. To get the same effect with an image, * use the icon names “pan-start-symbolic“ and “pan-end-symbolic“, which * react to the text direction. * @gir-type Class */ class Arrow extends Misc implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties /** * @default Gtk.ArrowType.RIGHT */ get arrow_type(): ArrowType; set arrow_type(val: ArrowType); /** * @default Gtk.ArrowType.RIGHT */ get arrowType(): ArrowType; set arrowType(val: ArrowType); /** * @default Gtk.ShadowType.OUT */ get shadow_type(): ShadowType; set shadow_type(val: ShadowType); /** * @default Gtk.ShadowType.OUT */ get shadowType(): ShadowType; set shadowType(val: ShadowType); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Arrow.SignalSignatures; // Fields misc: Misc; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](arrow_type: ArrowType, shadow_type: ShadowType): Arrow; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Sets the direction and style of the {@link Gtk.Arrow}, `arrow`. * @param arrow_type a valid {@link Gtk.ArrowType}. * @param shadow_type a valid {@link Gtk.ShadowType}. */ set(arrow_type: ArrowType, shadow_type: ShadowType): void; /** * @param args */ // Conflicted with GObject.Object.set set(...args: never[]): any; } namespace ArrowAccessible { // Signal signatures interface SignalSignatures extends WidgetAccessible.SignalSignatures { "notify::widget": (pspec: GObject.ParamSpec) => void; "notify::accessible-component-layer": (pspec: GObject.ParamSpec) => void; "notify::accessible-component-mdi-zorder": (pspec: GObject.ParamSpec) => void; "notify::accessible-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-help-text": (pspec: GObject.ParamSpec) => void; "notify::accessible-hypertext-nlinks": (pspec: GObject.ParamSpec) => void; "notify::accessible-id": (pspec: GObject.ParamSpec) => void; "notify::accessible-name": (pspec: GObject.ParamSpec) => void; "notify::accessible-parent": (pspec: GObject.ParamSpec) => void; "notify::accessible-role": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-caption": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-caption-object": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-column-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-column-header": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-row-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-row-header": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-summary": (pspec: GObject.ParamSpec) => void; "notify::accessible-value": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends WidgetAccessible.ConstructorProps, Atk.Component.ConstructorProps, Atk.Image.ConstructorProps {} } /** * @gir-type Class */ class ArrowAccessible extends WidgetAccessible implements Atk.Component, Atk.Image { static $gtype: GObject.GType; /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: ArrowAccessible.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; /** * Checks whether the specified point is within the extent of the `component`. * * Toolkit implementor note: ATK provides a default implementation for * this virtual method. In general there are little reason to * re-implement it. * @param x x coordinate * @param y y coordinate * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @returns `true` or `false` indicating whether the specified point is within the extent of the `component` or not */ contains(x: number, y: number, coord_type: Atk.CoordType): boolean; /** * Returns the alpha value (i.e. the opacity) for this * `component`, on a scale from 0 (fully transparent) to 1.0 * (fully opaque). * @returns An alpha value from 0 to 1.0, inclusive. */ get_alpha(): number; /** * Gets the rectangle which gives the extent of the `component`. * * If the extent can not be obtained (e.g. a non-embedded plug or missing * support), all of x, y, width, height are set to -1. * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window */ get_extents(coord_type: Atk.CoordType): [number, number, number, number]; /** * Gets the layer of the component. * @returns an {@link Atk.Layer} which is the layer of the component */ get_layer(): Atk.Layer; /** * Gets the zorder of the component. The value G_MININT will be returned * if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW. * @returns a gint which is the zorder of the component, i.e. the depth at which the component is shown in relation to other components in the same container. */ get_mdi_zorder(): number; /** * Gets the position of `component` in the form of * a point specifying `component`'s top-left corner. * * If the position can not be obtained (e.g. a non-embedded plug or missing * support), x and y are set to -1. * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window */ get_position(coord_type: Atk.CoordType): [number, number]; /** * Gets the size of the `component` in terms of width and height. * * If the size can not be obtained (e.g. a non-embedded plug or missing * support), width and height are set to -1. */ get_size(): [number, number]; /** * Grabs focus for this `component`. * @returns `true` if successful, `false` otherwise. */ grab_focus(): boolean; /** * Gets a reference to the accessible child, if one exists, at the * coordinate point specified by `x` and `y`. * @param x x coordinate * @param y y coordinate * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @returns a reference to the accessible child, if one exists */ ref_accessible_at_point(x: number, y: number, coord_type: Atk.CoordType): Atk.Object | null; /** * Remove the handler specified by `handler_id` from the list of * functions to be executed when this object receives focus events * (in or out). * @param handler_id the handler id of the focus handler to be removed from `component` */ remove_focus_handler(handler_id: number): void; /** * Makes `component` visible on the screen by scrolling all necessary parents. * * Contrary to atk_component_set_position, this does not actually move * `component` in its parent, this only makes the parents scroll so that the * object shows up on the screen, given its current position within the parents. * @param type specify where the object should be made visible. * @returns whether scrolling was successful. */ scroll_to(type: Atk.ScrollType): boolean; /** * Move the top-left of `component` to a given position of the screen by * scrolling all necessary parents. * @param coords specify whether coordinates are relative to the screen or to the parent object. * @param x x-position where to scroll to * @param y y-position where to scroll to * @returns whether scrolling was successful. */ scroll_to_point(coords: Atk.CoordType, x: number, y: number): boolean; /** * Sets the extents of `component`. * @param x x coordinate * @param y y coordinate * @param width width to set for `component` * @param height height to set for `component` * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @returns `true` or `false` whether the extents were set or not */ set_extents(x: number, y: number, width: number, height: number, coord_type: Atk.CoordType): boolean; /** * Sets the position of `component`. * * Contrary to atk_component_scroll_to, this does not trigger any scrolling, * this just moves `component` in its parent. * @param x x coordinate * @param y y coordinate * @param coord_type specifies whether the coordinates are relative to the screen or to the component's top level window * @returns `true` or `false` whether or not the position was set or not */ set_position(x: number, y: number, coord_type: Atk.CoordType): boolean; /** * Set the size of the `component` in terms of width and height. * @param width width to set for `component` * @param height height to set for `component` * @returns `true` or `false` whether the size was set or not */ set_size(width: number, height: number): boolean; /** * @param bounds * @virtual */ vfunc_bounds_changed(bounds: Atk.Rectangle): void; /** * Checks whether the specified point is within the extent of the `component`. * * Toolkit implementor note: ATK provides a default implementation for * this virtual method. In general there are little reason to * re-implement it. * @param x x coordinate * @param y y coordinate * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @virtual */ vfunc_contains(x: number, y: number, coord_type: Atk.CoordType): boolean; /** * Returns the alpha value (i.e. the opacity) for this * `component`, on a scale from 0 (fully transparent) to 1.0 * (fully opaque). * @virtual */ vfunc_get_alpha(): number; /** * Gets the rectangle which gives the extent of the `component`. * * If the extent can not be obtained (e.g. a non-embedded plug or missing * support), all of x, y, width, height are set to -1. * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @virtual */ vfunc_get_extents(coord_type: Atk.CoordType): [number, number, number, number]; /** * Gets the layer of the component. * @virtual */ vfunc_get_layer(): Atk.Layer; /** * Gets the zorder of the component. The value G_MININT will be returned * if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW. * @virtual */ vfunc_get_mdi_zorder(): number; /** * Gets the position of `component` in the form of * a point specifying `component`'s top-left corner. * * If the position can not be obtained (e.g. a non-embedded plug or missing * support), x and y are set to -1. * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @virtual */ vfunc_get_position(coord_type: Atk.CoordType): [number, number]; /** * Gets the size of the `component` in terms of width and height. * * If the size can not be obtained (e.g. a non-embedded plug or missing * support), width and height are set to -1. * @virtual */ vfunc_get_size(): [number, number]; /** * Grabs focus for this `component`. * @virtual */ vfunc_grab_focus(): boolean; /** * Gets a reference to the accessible child, if one exists, at the * coordinate point specified by `x` and `y`. * @param x x coordinate * @param y y coordinate * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @virtual */ vfunc_ref_accessible_at_point(x: number, y: number, coord_type: Atk.CoordType): Atk.Object | null; /** * Remove the handler specified by `handler_id` from the list of * functions to be executed when this object receives focus events * (in or out). * @param handler_id the handler id of the focus handler to be removed from `component` * @virtual */ vfunc_remove_focus_handler(handler_id: number): void; /** * Makes `component` visible on the screen by scrolling all necessary parents. * * Contrary to atk_component_set_position, this does not actually move * `component` in its parent, this only makes the parents scroll so that the * object shows up on the screen, given its current position within the parents. * @param type specify where the object should be made visible. * @virtual */ vfunc_scroll_to(type: Atk.ScrollType): boolean; /** * Move the top-left of `component` to a given position of the screen by * scrolling all necessary parents. * @param coords specify whether coordinates are relative to the screen or to the parent object. * @param x x-position where to scroll to * @param y y-position where to scroll to * @virtual */ vfunc_scroll_to_point(coords: Atk.CoordType, x: number, y: number): boolean; /** * Sets the extents of `component`. * @param x x coordinate * @param y y coordinate * @param width width to set for `component` * @param height height to set for `component` * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @virtual */ vfunc_set_extents(x: number, y: number, width: number, height: number, coord_type: Atk.CoordType): boolean; /** * Sets the position of `component`. * * Contrary to atk_component_scroll_to, this does not trigger any scrolling, * this just moves `component` in its parent. * @param x x coordinate * @param y y coordinate * @param coord_type specifies whether the coordinates are relative to the screen or to the component's top level window * @virtual */ vfunc_set_position(x: number, y: number, coord_type: Atk.CoordType): boolean; /** * Set the size of the `component` in terms of width and height. * @param width width to set for `component` * @param height height to set for `component` * @virtual */ vfunc_set_size(width: number, height: number): boolean; /** * Get a textual description of this image. * @returns a string representing the image description */ get_image_description(): string; /** * Retrieves the locale identifier associated to the {@link Atk.Image}. * @returns a string corresponding to the POSIX `LC_MESSAGES` locale used by the image description, or `null` if the image does not specify a locale. */ get_image_locale(): string | null; /** * Gets the position of the image in the form of a point specifying the * images top-left corner. * * If the position can not be obtained (e.g. missing support), x and y are set * to -1. * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window */ get_image_position(coord_type: Atk.CoordType): [number, number]; /** * Get the width and height in pixels for the specified image. * The values of `width` and `height` are returned as -1 if the * values cannot be obtained (for instance, if the object is not onscreen). * * If the size can not be obtained (e.g. missing support), x and y are set * to -1. */ get_image_size(): [number, number]; /** * Sets the textual description for this image. * @param description a string description to set for `image` * @returns boolean TRUE, or FALSE if operation could not be completed. */ set_image_description(description: string): boolean; /** * Get a textual description of this image. * @virtual */ vfunc_get_image_description(): string; /** * Retrieves the locale identifier associated to the {@link Atk.Image}. * @virtual */ vfunc_get_image_locale(): string | null; /** * Gets the position of the image in the form of a point specifying the * images top-left corner. * * If the position can not be obtained (e.g. missing support), x and y are set * to -1. * @param coord_type specifies whether the coordinates are relative to the screen or to the components top level window * @virtual */ vfunc_get_image_position(coord_type: Atk.CoordType): [number, number]; /** * Get the width and height in pixels for the specified image. * The values of `width` and `height` are returned as -1 if the * values cannot be obtained (for instance, if the object is not onscreen). * * If the size can not be obtained (e.g. missing support), x and y are set * to -1. * @virtual */ vfunc_get_image_size(): [number, number]; /** * Sets the textual description for this image. * @param description a string description to set for `image` * @virtual */ vfunc_set_image_description(description: string): boolean; } namespace AspectFrame { // Signal signatures interface SignalSignatures extends Frame.SignalSignatures { "notify::obey-child": (pspec: GObject.ParamSpec) => void; "notify::ratio": (pspec: GObject.ParamSpec) => void; "notify::xalign": (pspec: GObject.ParamSpec) => void; "notify::yalign": (pspec: GObject.ParamSpec) => void; "notify::label": (pspec: GObject.ParamSpec) => void; "notify::label-widget": (pspec: GObject.ParamSpec) => void; "notify::label-xalign": (pspec: GObject.ParamSpec) => void; "notify::label-yalign": (pspec: GObject.ParamSpec) => void; "notify::shadow-type": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Frame.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { obey_child: boolean; obeyChild: boolean; ratio: number; xalign: number; yalign: number; } } /** * The {@link Gtk.AspectFrame} is useful when you want * pack a widget so that it can resize but always retains * the same aspect ratio. For instance, one might be * drawing a small preview of a larger image. {@link Gtk.AspectFrame} * derives from {@link Gtk.Frame}, so it can draw a label and * a frame around the child. The frame will be * “shrink-wrapped” to the size of the child. * * # CSS nodes * * GtkAspectFrame uses a CSS node with name frame. * @gir-type Class */ class AspectFrame extends Frame implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties /** * @default true */ get obey_child(): boolean; set obey_child(val: boolean); /** * @default true */ get obeyChild(): boolean; set obeyChild(val: boolean); /** * @default 1 */ get ratio(): number; set ratio(val: number); /** * @default 0.5 */ get xalign(): number; set xalign(val: number); /** * @default 0.5 */ get yalign(): number; set yalign(val: number); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: AspectFrame.SignalSignatures; // Fields frame: Frame; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](label: string | null, xalign: number, yalign: number, ratio: number, obey_child: boolean): AspectFrame; // Conflicted with Gtk.Frame.new static ["new"](...args: never[]): any; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Set parameters for an existing {@link Gtk.AspectFrame}. * @param xalign Horizontal alignment of the child within the allocation of the {@link Gtk.AspectFrame}. This ranges from 0.0 (left aligned) to 1.0 (right aligned) * @param yalign Vertical alignment of the child within the allocation of the {@link Gtk.AspectFrame}. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned) * @param ratio The desired aspect ratio. * @param obey_child If `true`, `ratio` is ignored, and the aspect ratio is taken from the requistion of the child. */ set(xalign: number, yalign: number, ratio: number, obey_child: boolean): void; /** * @param args */ // Conflicted with GObject.Object.set set(...args: never[]): any; } namespace Assistant { // Signal signatures interface SignalSignatures extends Window.SignalSignatures { /** * The ::apply signal is emitted when the apply button is clicked. * * The default behavior of the {@link Gtk.Assistant} is to switch to the page * after the current page, unless the current page is the last one. * * A handler for the ::apply signal should carry out the actions for * which the wizard has collected data. If the action takes a long time * to complete, you might consider putting a page of type * {@link Gtk.AssistantPageType.PROGRESS} after the confirmation page and handle * this operation within the {@link Gtk.Assistant.SignalSignatures.prepare | Gtk.Assistant::prepare} signal of the progress * page. * @signal * @since 2.10 * @run-last */ apply: () => void; /** * The ::cancel signal is emitted when then the cancel button is clicked. * @signal * @since 2.10 * @run-last */ cancel: () => void; /** * The ::close signal is emitted either when the close button of * a summary page is clicked, or when the apply button in the last * page in the flow (of type {@link Gtk.AssistantPageType.CONFIRM}) is clicked. * @signal * @since 2.10 * @run-last */ close: () => void; /** * @signal * @action * @run-first */ escape: () => void; /** * The ::prepare signal is emitted when a new page is set as the * assistant's current page, before making the new page visible. * * A handler for this signal can do any preparations which are * necessary before showing `page`. * @signal * @since 2.10 * @run-last */ prepare: (arg0: Widget) => void; "notify::use-header-bar": (pspec: GObject.ParamSpec) => void; "notify::accept-focus": (pspec: GObject.ParamSpec) => void; "notify::application": (pspec: GObject.ParamSpec) => void; "notify::attached-to": (pspec: GObject.ParamSpec) => void; "notify::decorated": (pspec: GObject.ParamSpec) => void; "notify::default-height": (pspec: GObject.ParamSpec) => void; "notify::default-width": (pspec: GObject.ParamSpec) => void; "notify::deletable": (pspec: GObject.ParamSpec) => void; "notify::destroy-with-parent": (pspec: GObject.ParamSpec) => void; "notify::focus-on-map": (pspec: GObject.ParamSpec) => void; "notify::focus-visible": (pspec: GObject.ParamSpec) => void; "notify::gravity": (pspec: GObject.ParamSpec) => void; "notify::has-resize-grip": (pspec: GObject.ParamSpec) => void; "notify::has-toplevel-focus": (pspec: GObject.ParamSpec) => void; "notify::hide-titlebar-when-maximized": (pspec: GObject.ParamSpec) => void; "notify::icon": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-active": (pspec: GObject.ParamSpec) => void; "notify::is-maximized": (pspec: GObject.ParamSpec) => void; "notify::mnemonics-visible": (pspec: GObject.ParamSpec) => void; "notify::modal": (pspec: GObject.ParamSpec) => void; "notify::resizable": (pspec: GObject.ParamSpec) => void; "notify::resize-grip-visible": (pspec: GObject.ParamSpec) => void; "notify::role": (pspec: GObject.ParamSpec) => void; "notify::screen": (pspec: GObject.ParamSpec) => void; "notify::skip-pager-hint": (pspec: GObject.ParamSpec) => void; "notify::skip-taskbar-hint": (pspec: GObject.ParamSpec) => void; "notify::startup-id": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; "notify::transient-for": (pspec: GObject.ParamSpec) => void; "notify::type": (pspec: GObject.ParamSpec) => void; "notify::type-hint": (pspec: GObject.ParamSpec) => void; "notify::urgency-hint": (pspec: GObject.ParamSpec) => void; "notify::window-position": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Window.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { use_header_bar: number; useHeaderBar: number; } } /** * A {@link Gtk.Assistant} is a widget used to represent a generally complex * operation splitted in several steps, guiding the user through its * pages and controlling the page flow to collect the necessary data. * * The design of GtkAssistant is that it controls what buttons to show * and to make sensitive, based on what it knows about the page sequence * and the [type][GtkAssistantPageType] of each page, * in addition to state information like the page * [completion][gtk-assistant-set-page-complete] * and [committed][gtk-assistant-commit] status. * * If you have a case that doesn’t quite fit in `GtkAssistants` way of * handling buttons, you can use the #GTK_ASSISTANT_PAGE_CUSTOM page * type and handle buttons yourself. * * # GtkAssistant as GtkBuildable * * The GtkAssistant implementation of the {@link Gtk.Buildable} interface * exposes the `action_area` as internal children with the name * “action_area”. * * To add pages to an assistant in {@link Gtk.Builder}, simply add it as a * child to the GtkAssistant object, and set its child properties * as necessary. * * # CSS nodes * * GtkAssistant has a single CSS node with the name assistant. * @gir-type Class */ class Assistant extends Window implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties /** * `true` if the assistant uses a {@link Gtk.HeaderBar} for action buttons * instead of the action-area. * * For technical reasons, this property is declared as an integer * property, but you should only set it to `true` or `false`. * @since 3.12 * @construct-only * @default -1 */ get use_header_bar(): number; /** * `true` if the assistant uses a {@link Gtk.HeaderBar} for action buttons * instead of the action-area. * * For technical reasons, this property is declared as an integer * property, but you should only set it to `true` or `false`. * @since 3.12 * @construct-only * @default -1 */ get useHeaderBar(): number; /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Assistant.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](): Assistant; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Virtual methods /** * Signal emitted when the apply button is clicked. * @virtual */ vfunc_apply(): void; /** * Signal emitted when the cancel button is clicked. * @virtual */ vfunc_cancel(): void; /** * Signal emitted either when the close button or last page apply button is clicked. * @virtual */ vfunc_close(): void; /** * Signal emitted when a new page is set as the assistant’s current page, before making the new page visible. * @param page * @virtual */ vfunc_prepare(page: Widget): void; // Methods /** * Adds a widget to the action area of a {@link Gtk.Assistant}. * @param child a {@link Gtk.Widget} */ add_action_widget(child: Widget): void; /** * Appends a page to the `assistant`. * @param page a {@link Gtk.Widget} * @returns the index (starting at 0) of the inserted page */ append_page(page: Widget): number; /** * Erases the visited page history so the back button is not * shown on the current page, and removes the cancel button * from subsequent pages. * * Use this when the information provided up to the current * page is hereafter deemed permanent and cannot be modified * or undone. For example, showing a progress page to track * a long-running, unreversible operation after the user has * clicked apply on a confirmation page. */ commit(): void; /** * Returns the page number of the current page. * @returns The index (starting from 0) of the current page in the `assistant`, or -1 if the `assistant` has no pages, or no current page. */ get_current_page(): number; /** * Returns the number of pages in the `assistant` * @returns the number of pages in the `assistant` */ get_n_pages(): number; /** * Returns the child widget contained in page number `page_num`. * @param page_num the index of a page in the `assistant`, or -1 to get the last page * @returns the child widget, or `null` if `page_num` is out of bounds */ get_nth_page(page_num: number): Widget | null; /** * Gets whether `page` is complete. * @param page a page of `assistant` * @returns `true` if `page` is complete. */ get_page_complete(page: Widget): boolean; /** * Gets whether page has padding. * @param page a page of `assistant` * @returns `true` if `page` has padding */ get_page_has_padding(page: Widget): boolean; /** * Gets the header image for `page`. * @param page a page of `assistant` * @returns the header image for `page`, or `null` if there’s no header image for the page */ get_page_header_image(page: Widget): GdkPixbuf.Pixbuf; /** * Gets the side image for `page`. * @param page a page of `assistant` * @returns the side image for `page`, or `null` if there’s no side image for the page */ get_page_side_image(page: Widget): GdkPixbuf.Pixbuf; /** * Gets the title for `page`. * @param page a page of `assistant` * @returns the title for `page` */ get_page_title(page: Widget): string; /** * Gets the page type of `page`. * @param page a page of `assistant` * @returns the page type of `page` */ get_page_type(page: Widget): AssistantPageType; /** * Inserts a page in the `assistant` at a given position. * @param page a {@link Gtk.Widget} * @param position the index (starting at 0) at which to insert the page, or -1 to append the page to the `assistant` * @returns the index (starting from 0) of the inserted page */ insert_page(page: Widget, position: number): number; /** * Navigate to the next page. * * It is a programming error to call this function when * there is no next page. * * This function is for use when creating pages of the * #GTK_ASSISTANT_PAGE_CUSTOM type. */ next_page(): void; /** * Prepends a page to the `assistant`. * @param page a {@link Gtk.Widget} * @returns the index (starting at 0) of the inserted page */ prepend_page(page: Widget): number; /** * Navigate to the previous visited page. * * It is a programming error to call this function when * no previous page is available. * * This function is for use when creating pages of the * #GTK_ASSISTANT_PAGE_CUSTOM type. */ previous_page(): void; /** * Removes a widget from the action area of a {@link Gtk.Assistant}. * @param child a {@link Gtk.Widget} */ remove_action_widget(child: Widget): void; /** * Removes the `page_num`’s page from `assistant`. * @param page_num the index of a page in the `assistant`, or -1 to remove the last page */ remove_page(page_num: number): void; /** * Switches the page to `page_num`. * * Note that this will only be necessary in custom buttons, * as the `assistant` flow can be set with * `gtk_assistant_set_forward_page_func()`. * @param page_num index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the `assistant`, nothing will be done. */ set_current_page(page_num: number): void; /** * Sets the page forwarding function to be `page_func`. * * This function will be used to determine what will be * the next page when the user presses the forward button. * Setting `page_func` to `null` will make the assistant to * use the default forward function, which just goes to the * next visible page. * @param page_func the {@link Gtk.AssistantPageFunc}, or `null` to use the default one */ set_forward_page_func(page_func: AssistantPageFunc | null): void; /** * Sets whether `page` contents are complete. * * This will make `assistant` update the buttons state * to be able to continue the task. * @param page a page of `assistant` * @param complete the completeness status of the page */ set_page_complete(page: Widget, complete: boolean): void; /** * Sets whether the assistant is adding padding around * the page. * @param page a page of `assistant` * @param has_padding whether this page has padding */ set_page_has_padding(page: Widget, has_padding: boolean): void; /** * Sets a header image for `page`. * @param page a page of `assistant` * @param pixbuf the new header image `page` */ set_page_header_image(page: Widget, pixbuf: GdkPixbuf.Pixbuf | null): void; /** * Sets a side image for `page`. * * This image used to be displayed in the side area of the assistant * when `page` is the current page. * @param page a page of `assistant` * @param pixbuf the new side image `page` */ set_page_side_image(page: Widget, pixbuf: GdkPixbuf.Pixbuf | null): void; /** * Sets a title for `page`. * * The title is displayed in the header area of the assistant * when `page` is the current page. * @param page a page of `assistant` * @param title the new title for `page` */ set_page_title(page: Widget, title: string): void; /** * Sets the page type for `page`. * * The page type determines the page behavior in the `assistant`. * @param page a page of `assistant` * @param type the new type for `page` */ set_page_type(page: Widget, type: AssistantPageType): void; /** * Forces `assistant` to recompute the buttons state. * * GTK+ automatically takes care of this in most situations, * e.g. when the user goes to a different page, or when the * visibility or completeness of a page changes. * * One situation where it can be necessary to call this * function is when changing a value on the current page * affects the future page flow of the assistant. */ update_buttons_state(): void; } namespace Bin { // Signal signatures interface SignalSignatures extends Container.SignalSignatures { "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Container.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps {} } /** * The {@link Gtk.Bin} widget is a container with just one child. * It is not very useful itself, but it is useful for deriving subclasses, * since it provides common code needed for handling a single child widget. * * Many GTK+ widgets are subclasses of {@link Gtk.Bin}, including {@link Gtk.Window}, * {@link Gtk.Button}, {@link Gtk.Frame}, {@link Gtk.HandleBox} or {@link Gtk.ScrolledWindow}. * @gir-type Class */ abstract class Bin extends Container implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Bin.SignalSignatures; // Fields container: Container; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Gets the child of the {@link Gtk.Bin}, or `null` if the bin contains * no child widget. The returned widget does not have a reference * added, so you do not need to unref it. * @returns the child of `bin`, or `null` if it does not have a child. */ get_child(): Widget | null; } namespace BooleanCellAccessible { // Signal signatures interface SignalSignatures extends RendererCellAccessible.SignalSignatures { "notify::renderer": (pspec: GObject.ParamSpec) => void; "notify::widget": (pspec: GObject.ParamSpec) => void; "notify::accessible-component-layer": (pspec: GObject.ParamSpec) => void; "notify::accessible-component-mdi-zorder": (pspec: GObject.ParamSpec) => void; "notify::accessible-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-help-text": (pspec: GObject.ParamSpec) => void; "notify::accessible-hypertext-nlinks": (pspec: GObject.ParamSpec) => void; "notify::accessible-id": (pspec: GObject.ParamSpec) => void; "notify::accessible-name": (pspec: GObject.ParamSpec) => void; "notify::accessible-parent": (pspec: GObject.ParamSpec) => void; "notify::accessible-role": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-caption": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-caption-object": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-column-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-column-header": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-row-description": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-row-header": (pspec: GObject.ParamSpec) => void; "notify::accessible-table-summary": (pspec: GObject.ParamSpec) => void; "notify::accessible-value": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends RendererCellAccessible.ConstructorProps, Atk.Action.ConstructorProps, Atk.Component.ConstructorProps, Atk.TableCell.ConstructorProps {} } /** * @gir-type Class */ class BooleanCellAccessible extends RendererCellAccessible implements Atk.Action, Atk.Component, Atk.TableCell { static $gtype: GObject.GType; /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: BooleanCellAccessible.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; } namespace Box { // Signal signatures interface SignalSignatures extends Container.SignalSignatures { "notify::baseline-position": (pspec: GObject.ParamSpec) => void; "notify::homogeneous": (pspec: GObject.ParamSpec) => void; "notify::spacing": (pspec: GObject.ParamSpec) => void; "notify::border-width": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::resize-mode": (pspec: GObject.ParamSpec) => void; "notify::app-paintable": (pspec: GObject.ParamSpec) => void; "notify::can-default": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::composite-child": (pspec: GObject.ParamSpec) => void; "notify::double-buffered": (pspec: GObject.ParamSpec) => void; "notify::events": (pspec: GObject.ParamSpec) => void; "notify::expand": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::halign": (pspec: GObject.ParamSpec) => void; "notify::has-default": (pspec: GObject.ParamSpec) => void; "notify::has-focus": (pspec: GObject.ParamSpec) => void; "notify::has-tooltip": (pspec: GObject.ParamSpec) => void; "notify::height-request": (pspec: GObject.ParamSpec) => void; "notify::hexpand": (pspec: GObject.ParamSpec) => void; "notify::hexpand-set": (pspec: GObject.ParamSpec) => void; "notify::is-focus": (pspec: GObject.ParamSpec) => void; "notify::margin": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (pspec: GObject.ParamSpec) => void; "notify::margin-left": (pspec: GObject.ParamSpec) => void; "notify::margin-right": (pspec: GObject.ParamSpec) => void; "notify::margin-start": (pspec: GObject.ParamSpec) => void; "notify::margin-top": (pspec: GObject.ParamSpec) => void; "notify::name": (pspec: GObject.ParamSpec) => void; "notify::no-show-all": (pspec: GObject.ParamSpec) => void; "notify::opacity": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (pspec: GObject.ParamSpec) => void; "notify::style": (pspec: GObject.ParamSpec) => void; "notify::tooltip-markup": (pspec: GObject.ParamSpec) => void; "notify::tooltip-text": (pspec: GObject.ParamSpec) => void; "notify::valign": (pspec: GObject.ParamSpec) => void; "notify::vexpand": (pspec: GObject.ParamSpec) => void; "notify::vexpand-set": (pspec: GObject.ParamSpec) => void; "notify::visible": (pspec: GObject.ParamSpec) => void; "notify::width-request": (pspec: GObject.ParamSpec) => void; "notify::window": (pspec: GObject.ParamSpec) => void; "notify::orientation": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Container.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps, Orientable.ConstructorProps { baseline_position: BaselinePosition; baselinePosition: BaselinePosition; homogeneous: boolean; spacing: number; } } /** * The GtkBox widget arranges child widgets into a single row or column, * depending upon the value of its {@link Gtk.Orientable.orientation} property. Within * the other dimension, all children are allocated the same size. Of course, * the {@link Gtk.Widget.halign} and {@link Gtk.Widget.valign} properties can be used on * the children to influence their allocation. * * GtkBox uses a notion of packing. Packing refers * to adding widgets with reference to a particular position in a * {@link Gtk.Container}. For a GtkBox, there are two reference positions: the * start and the end of the box. * For a vertical {@link Gtk.Box}, the start is defined as the top of the box and * the end is defined as the bottom. For a horizontal {@link Gtk.Box} the start * is defined as the left side and the end is defined as the right side. * * Use repeated calls to `gtk_box_pack_start()` to pack widgets into a * GtkBox from start to end. Use `gtk_box_pack_end()` to add widgets from * end to start. You may intersperse these calls and add widgets from * both ends of the same GtkBox. * * Because GtkBox is a {@link Gtk.Container}, you may also use `gtk_container_add()` * to insert widgets into the box, and they will be packed with the default * values for expand and fill child properties. Use `gtk_container_remove()` * to remove widgets from the GtkBox. * * Use `gtk_box_set_homogeneous()` to specify whether or not all children * of the GtkBox are forced to get the same amount of space. * * Use `gtk_box_set_spacing()` to determine how much space will be * minimally placed between all children in the GtkBox. Note that * spacing is added between the children, while * padding added by `gtk_box_pack_start()` or `gtk_box_pack_end()` is added * on either side of the widget it belongs to. * * Use `gtk_box_reorder_child()` to move a GtkBox child to a different * place in the box. * * Use `gtk_box_set_child_packing()` to reset the expand, * fill and padding child properties. * Use `gtk_box_query_child_packing()` to query these fields. * * # CSS nodes * * GtkBox uses a single CSS node with name box. * * In horizontal orientation, the nodes of the children are always arranged * from left to right. So :first-child will always select the leftmost child, * regardless of text direction. * @gir-type Class */ class Box extends Container implements Atk.ImplementorIface, Buildable, Orientable { static $gtype: GObject.GType; // Properties /** * @default Gtk.BaselinePosition.CENTER */ get baseline_position(): BaselinePosition; set baseline_position(val: BaselinePosition); /** * @default Gtk.BaselinePosition.CENTER */ get baselinePosition(): BaselinePosition; set baselinePosition(val: BaselinePosition); /** * @default false */ get homogeneous(): boolean; set homogeneous(val: boolean); /** * @default 0 */ get spacing(): number; set spacing(val: number); /** * Compile-time signal type information. * * This instance property is generated only for TypeScript type checking. * It is not defined at runtime and should not be accessed in JS code. * @internal */ $signals: Box.SignalSignatures; // Fields container: Container; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](orientation: Orientation, spacing: number): Box; // Signals /** @signal */ connect(signal: K, callback: GObject.SignalCallback): number; connect(signal: string, callback: (...args: any[]) => any): number; /** @signal */ connect_after(signal: K, callback: GObject.SignalCallback): number; connect_after(signal: string, callback: (...args: any[]) => any): number; /** @signal */ emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void; emit(signal: string, ...args: any[]): void; // Methods /** * Gets the value set by `gtk_box_set_baseline_position()`. * @returns the baseline position */ get_baseline_position(): BaselinePosition; /** * Retrieves the center widget of the box. * @returns the center widget or `null` in case no center widget is set. */ get_center_widget(): Widget | null; /** * Returns whether the box is homogeneous (all children are the * same size). See `gtk_box_set_homogeneous()`. * @returns `true` if the box is homogeneous. */ get_homogeneous(): boolean; /** * Gets the value set by `gtk_box_set_spacing()`. * @returns spacing between children */ get_spacing(): number; /** * Adds `child` to `box`, packed with reference to the end of `box`. * The `child` is packed after (away from end of) any other child * packed with reference to the end of `box`. * @param child the {@link Gtk.Widget} to be added to `box` * @param expand `true` if the new child is to be given extra space allocated to `box`. The extra space will be divided evenly between all children of `box` that use this option * @param fill `true` if space given to `child` by the `expand` option is actually allocated to `child`, rather than just padding it. This parameter has no effect if `expand` is set to `false`. A child is always allocated the full height of a horizontal {@link Gtk.Box} and the full width of a vertical {@link Gtk.Box}. This option affects the other dimension * @param padding extra space in pixels to put between this child and its neighbors, over and above the global amount specified by {@link Gtk.Box.spacing} property. If `child` is a widget at one of the reference ends of `box`, then `padding` pixels are also put between `child` and the reference edge of `box` */ pack_end(child: Widget, expand: boolean, fill: boolean, padding: number): void; /** * Adds `child` to `box`, packed with reference to the start of `box`. * The `child` is packed after any other child packed with reference * to the start of `box`. * @param child the {@link Gtk.Widget} to be added to `box` * @param expand `true` if the new child is to be given extra space allocated to `box`. The extra space will be divided evenly between all children that use this option * @param fill `true` if space given to `child` by the `expand` option is actually allocated to `child`, rather than just padding it. This parameter has no effect if `expand` is set to `false`. A child is always allocated the full height of a horizontal {@link Gtk.Box} and the full width of a vertical {@link Gtk.Box}. This option affects the other dimension * @param padding extra space in pixels to put between this child and its neighbors, over and above the global amount specified by {@link Gtk.Box.spacing} property. If `child` is a widget at one of the reference ends of `box`, then `padding` pixels are also put between `child` and the reference edge of `box` */ pack_start(child: Widget, expand: boolean, fill: boolean, padding: number): void; /** * Obtains information about how `child` is packed into `box`. * @param child the {@link Gtk.Widget} of the child to query */ query_child_packing(child: Widget): [boolean, boolean, number, PackType]; /** * Moves `child` to a new `position` in the list of `box` children. * The list contains widgets packed #GTK_PACK_START * as well as widgets packed #GTK_PACK_END, in the order that these * widgets were added to `box`. * * A widget’s position in the `box` children list determines where * the widget is packed into `box`. A child widget at some position * in the list will be packed just after all other widgets of the * same packing type that appear earlier in the list. * @param child the {@link Gtk.Widget} to move * @param position the new position for `child` in the list of children of `box`, starting from 0. If negative, indicates the end of the list */ reorder_child(child: Widget, position: number): void; /** * Sets the baseline position of a box. This affects * only horizontal boxes with at least one baseline aligned * child. If there is more vertical space available than requested, * and the baseline is not allocated by the parent then * `position` is used to allocate the baseline wrt the * extra space available. * @param position a {@link Gtk.BaselinePosition} */ set_baseline_position(position: BaselinePosition): void; /** * Sets a center widget; that is a child widget that will be * centered with respect to the full width of the box, even * if the children at either side take up different amounts * of space. * @param widget the widget to center */ set_center_widget(widget: Widget | null): void; /** * Sets the way `child` is packed into `box`. * @param child the {@link Gtk.Widget} of the child to set * @param expand the new value of the expand child property * @param fill the new value of the fill child property * @param padding the new value of the padding child property * @param pack_type the new value of the pack-type child property */ set_child_packing(child: Widget, expand: boolean, fill: boolean, padding: number, pack_type: PackType): void; /** * Sets the {@link Gtk.Box.homogeneous} property of `box`, controlling * whether or not all children of `box` are given equal space * in the box. * @param homogeneous a boolean value, `true` to create equal allotments, `false` for variable allotments */ set_homogeneous(homogeneous: boolean): void; /** * Sets the {@link Gtk.Box.spacing} property of `box`, which is the * number of pixels to place between children of `box`. * @param spacing the number of pixels to put between children */ set_spacing(spacing: number): void; /** * The orientation of the orientable. * @since 2.16 * @default Gtk.Orientation.HORIZONTAL * @category Inherited from Gtk.Orientable */ get orientation(): Orientation; set orientation(val: Orientation); /** * Retrieves the orientation of the `orientable`. * @returns the orientation of the `orientable`. */ get_orientation(): Orientation; /** * Sets the orientation of the `orientable`. * @param orientation the orientable’s new orientation. */ set_orientation(orientation: Orientation): void; } namespace Builder { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { "notify::translation-domain": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { translation_domain: string; translationDomain: string; } } /** * A GtkBuilder is an auxiliary object that reads textual descriptions * of a user interface and instantiates the described objects. To create * a GtkBuilder from a user interface description, call * `gtk_builder_new_from_file()`, `gtk_builder_new_from_resource()` or * `gtk_builder_new_from_string()`. * * In the (unusual) case that you want to add user interface * descriptions from multiple sources to the same GtkBuilder you can * call `gtk_builder_new()` to get an empty builder and populate it by * (multiple) calls to `gtk_builder_add_from_file()`, * `gtk_builder_add_from_resource()` or `gtk_builder_add_from_string()`. * * A GtkBuilder holds a reference to all objects that it has constructed * and drops these references when it is finalized. This finalization can * cause the destruction of non-widget objects or widgets which are not * contained in a toplevel window. For toplevel windows constructed by a * builder, it is the responsibility of the user to call `gtk_widget_destroy()` * to get rid of them and all the widgets they contain. * * The functions `gtk_builder_get_object()` and `gtk_builder_get_objects()` * can be used to access the widgets in the interface by the names assigned * to them inside the UI description. Toplevel windows returned by these * functions will stay around until the user explicitly destroys them * with `gtk_widget_destroy()`. Other widgets will either be part of a * larger hierarchy constructed by the builder (in which case you should * not have to worry about their lifecycle), or without a parent, in which * case they have to be added to some container to make use of them. * Non-widget objects need to be reffed with `g_object_ref()` to keep them * beyond the lifespan of the builder. * * The function `gtk_builder_connect_signals()` and variants thereof can be * used to connect handlers to the named signals in the description. * * # GtkBuilder UI Definitions # {`BUILDER`-UI} * * GtkBuilder parses textual descriptions of user interfaces which are * specified in an XML format which can be roughly described by the * RELAX NG schema below. We refer to these descriptions as “GtkBuilder * UI definitions” or just “UI definitions” if the context is clear. * Do not confuse GtkBuilder UI Definitions with * [GtkUIManager UI Definitions][XML-UI], which are more limited in scope. * It is common to use `.ui` as the filename extension for files containing * GtkBuilder UI definitions. * * [RELAX NG Compact Syntax](https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkbuilder.rnc) * * The toplevel element is ``. It optionally takes a “domain” * attribute, which will make the builder look for translated strings * using `dgettext()` in the domain specified. This can also be done by * calling `gtk_builder_set_translation_domain()` on the builder. * Objects are described by `` elements, which can contain * `` elements to set properties, `` elements which * connect signals to handlers, and `` elements, which describe * child objects (most often widgets inside a container, but also e.g. * actions in an action group, or columns in a tree model). A `` * element contains an `` element which describes the child object. * The target toolkit version(s) are described by `` elements, * the “lib” attribute specifies the widget library in question (currently * the only supported value is “gtk+”) and the “version” attribute specifies * the target version in the form `.`. The builder will error * out if the version requirements are not met. * * Typically, the specific kind of object represented by an `` * element is specified by the “class” attribute. If the type has not * been loaded yet, GTK+ tries to find the `get_type()` function from the * class name by applying heuristics. This works in most cases, but if * necessary, it is possible to specify the name of the `get_type()` function * explictly with the "type-func" attribute. As a special case, GtkBuilder * allows to use an object that has been constructed by a {@link Gtk.UIManager} in * another part of the UI definition by specifying the id of the {@link Gtk.UIManager} * in the “constructor” attribute and the name of the object in the “id” * attribute. * * Objects may be given a name with the “id” attribute, which allows the * application to retrieve them from the builder with `gtk_builder_get_object()`. * An id is also necessary to use the object as property value in other * parts of the UI definition. GTK+ reserves ids starting and ending * with `___` (3 underscores) for its own purposes. * * Setting properties of objects is pretty straightforward with the * `` element: the “name” attribute specifies the name of the * property, and the content of the element specifies the value. * If the “translatable” attribute is set to a true value, GTK+ uses * `gettext()` (or `dgettext()` if the builder has a translation domain set) * to find a translation for the value. This happens before the value * is parsed, so it can be used for properties of any type, but it is * probably most useful for string properties. It is also possible to * specify a context to disambiguate short strings, and comments which * may help the translators. * * GtkBuilder can parse textual representations for the most common * property types: characters, strings, integers, floating-point numbers, * booleans (strings like “TRUE”, “t”, “yes”, “y”, “1” are interpreted * as `true`, strings like “FALSE”, “f”, “no”, “n”, “0” are interpreted * as `false`), enumerations (can be specified by their name, nick or * integer value), flags (can be specified by their name, nick, integer * value, optionally combined with “|”, e.g. “GTK_VISIBLE|GTK_REALIZED”) * and colors (in a format understood by `gdk_rgba_parse()`). * * GVariants can be specified in the format understood by `g_variant_parse()`, * and pixbufs can be specified as a filename of an image file to load. * * Objects can be referred to by their name and by default refer to * objects declared in the local xml fragment and objects exposed via * `gtk_builder_expose_object()`. In general, GtkBuilder allows forward * references to objects — declared in the local xml; an object doesn’t * have to be constructed before it can be referred to. The exception * to this rule is that an object has to be constructed before it can * be used as the value of a construct-only property. * * It is also possible to bind a property value to another object's * property value using the attributes * "bind-source" to specify the source object of the binding, * "bind-property" to specify the source property and optionally * "bind-flags" to specify the binding flags. * Internally builder implements this using GBinding objects. * For more information see `g_object_bind_property()` * * Signal handlers are set up with the `` element. The “name” * attribute specifies the name of the signal, and the “handler” attribute * specifies the function to connect to the signal. By default, GTK+ tries * to find the handler using `g_module_symbol()`, but this can be changed by * passing a custom {@link Gtk.BuilderConnectFunc} to * `gtk_builder_connect_signals_full()`. The remaining attributes, “after”, * “swapped” and “object”, have the same meaning as the corresponding * parameters of the `g_signal_connect_object()` or * `g_signal_connect_data()` functions. A “last_modification_time” * attribute is also allowed, but it does not have a meaning to the * builder. * * Sometimes it is necessary to refer to widgets which have implicitly * been constructed by GTK+ as part of a composite widget, to set * properties on them or to add further children (e.g. the `vbox` of * a {@link Gtk.Dialog}). This can be achieved by setting the “internal-child” * property of the `` element to a true value. Note that GtkBuilder * still requires an `` element for the internal child, even if it * has already been constructed. * * A number of widgets have different places where a child can be added * (e.g. tabs vs. page content in notebooks). This can be reflected in * a UI definition by specifying the “type” attribute on a `` * The possible values for the “type” attribute are described in the * sections describing the widget-specific portions of UI definitions. * * # A GtkBuilder UI Definition * * * ```xml * * * * * 10 * * * 20 * * * gtk-ok * TRUE * * * * * * * * * * ``` * * * Beyond this general structure, several object classes define their * own XML DTD fragments for filling in the ANY placeholders in the DTD * above. Note that a custom element in a `` element gets parsed by * the custom tag handler of the parent object, while a custom element in * an `` element gets parsed by the custom tag handler of the object. * * These XML fragments are explained in the documentation of the * respective objects. * * Additionally, since 3.10 a special `