/** * 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 Gsk from '@girs/gsk-4.0'; import type Graphene from '@girs/graphene-1.0'; import type GObject from '@girs/gobject-2.0'; import type GLib from '@girs/glib-2.0'; import type Gdk from '@girs/gdk-4.0'; import type cairo from 'cairo'; import type PangoCairo from '@girs/pangocairo-1.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'; export namespace Gtk { /** * GJS replaces `Gtk.Builder` with a JS subclass (`GtkJSBuilder`) whose constructor * accepts five additional, JS-only properties on top of the GIR-derived ones: * `data`, `filename`, `resource`, `callbacks`, and `objects`. They are consumed at * construction time (used to call `add_from_string` / `add_from_file` / * `add_from_resource`, set up a callback scope, and register named objects), so * they appear only in the constructor signature, not as instance accessors. * * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/core/overrides/Gtk.js * @example * ```ts * const builder = new Gtk.Builder({ * filename: "window.ui", * callbacks: { on_clicked: () => print("clicked") }, * objects: { existing: someExistingWidget }, * }); * ``` */ export namespace Builder { interface ConstructorProps { /** Inline XML interface description. Calls `add_from_string` on construction. */ data?: string | Uint8Array; /** Path to a UI file. Calls `add_from_file` on construction. */ filename?: string; /** Resource path to a UI file. Calls `add_from_resource` on construction. */ resource?: string; /** Named signal callbacks resolved against `` `handler` attributes. */ callbacks?: Record any>; /** Pre-existing objects exposed to the UI via {@link Builder.exposeObjects}. */ objects?: Record; } } /** * GJS-only convenience method on {@link Builder}: registers every entry of * `objects` so the UI XML can reference them by name. * * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/core/overrides/Gtk.js */ export interface Builder { exposeObjects(objects: Record): void; } /** * Gtk-4.0 */ /** * @gir-type Enum */ export namespace AccessibleAnnouncementPriority { export const $gtype: GObject.GType; } /** * The priority of an accessibility announcement. * @gir-type Enum * @since 4.14 */ enum AccessibleAnnouncementPriority { /** * The announcement is low priority, * and might be read only on the user's request. */ LOW, /** * The announcement is of medium * priority, and is usually spoken at the next opportunity, such as at the * end of speaking the current sentence or when the user pauses typing. */ MEDIUM, /** * The announcement is of high * priority, and is usually spoken immediately. Because an interruption * might disorient users or cause them to not complete their current task, * authors SHOULD NOT use high priority announcements unless the * interruption is imperative. An example would be a notification about a * critical battery power level. */ HIGH, } /** * @gir-type Enum */ export namespace AccessibleAutocomplete { export const $gtype: GObject.GType; } /** * The possible values for the {@link Gtk.AccessibleProperty.AUTOCOMPLETE} * accessible property. * @gir-type Enum */ enum AccessibleAutocomplete { /** * Automatic suggestions are not displayed. */ NONE, /** * When a user is providing input, text * suggesting one way to complete the provided input may be dynamically * inserted after the caret. */ INLINE, /** * When a user is providing input, an element * containing a collection of values that could complete the provided input * may be displayed. */ LIST, /** * When a user is providing input, an element * containing a collection of values that could complete the provided input * may be displayed. If displayed, one value in the collection is automatically * selected, and the text needed to complete the automatically selected value * appears after the caret in the input. */ BOTH, } /** * @gir-type Enum */ export namespace AccessibleInvalidState { export const $gtype: GObject.GType; } /** * The possible values for the {@link Gtk.AccessibleState.INVALID} * accessible state. * * Note that the {@link Gtk.AccessibleInvalidState.FALSE} and * {@link Gtk.AccessibleInvalidState.TRUE} have the same values * as `false` and `true`. * @gir-type Enum */ enum AccessibleInvalidState { /** * There are no detected errors in the value */ FALSE, /** * The value entered by the user has failed validation */ TRUE, /** * A grammatical error was detected */ GRAMMAR, /** * A spelling error was detected */ SPELLING, } /** * @gir-type Enum */ export namespace AccessiblePlatformState { export const $gtype: GObject.GType; } /** * The various platform states which can be queried * using {@link Gtk.Accessible.get_platform_state}. * @gir-type Enum * @since 4.10 */ enum AccessiblePlatformState { /** * whether the accessible can be focused */ FOCUSABLE, /** * whether the accessible has focus */ FOCUSED, /** * whether the accessible is active */ ACTIVE, } /** * @gir-type Enum */ export namespace AccessibleProperty { export const $gtype: GObject.GType; } /** * The possible accessible properties of a {@link Accessible}. * @gir-type Enum */ enum AccessibleProperty { /** * Indicates whether inputting text * could trigger display of one or more predictions of the user's intended * value for a combobox, searchbox, or textbox and specifies how predictions * would be presented if they were made. Value type: {@link AccessibleAutocomplete} */ AUTOCOMPLETE, /** * Defines a string value that describes * or annotates the current element. Value type: string */ DESCRIPTION, /** * Indicates the availability of interactive * popup element, such as menu or popover, that can be triggered by an * element. Contrary to “aria-haspopup”, it doesn't indicate the type of the * element, as such it cannot be used to indicate the availability of more * complex elements such as dialog. Value type: boolean */ HAS_POPUP, /** * Indicates keyboard shortcuts that an * author has implemented to activate or give focus to an element. Value type: * string. The format of the value is a space-separated list of shortcuts, with * each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), * followed by a non-modifier key, all separated by `+`. The * [WAI-ARIA](https://www.w3.org/TR/wai-aria/#aria-keyshortcuts) reference * specifies how to build keyboard shortcuts strings, with specific values * for each key which are the same regardless of the language, so these * strings can't be built from localized key names. You can convert an * accelerator into the matching key shortcuts label with * {@link Gtk.accelerator_get_accessible_label}. * Examples: `F2`, `Alt+F`, `Control+Shift+N` */ KEY_SHORTCUTS, /** * Defines a string value that labels the current * element. Value type: string */ LABEL, /** * Defines the hierarchical level of an element * within a structure. Value type: integer */ LEVEL, /** * Indicates whether an element is modal when * displayed. Value type: boolean */ MODAL, /** * Indicates whether a text box accepts * multiple lines of input or only a single line. Value type: boolean */ MULTI_LINE, /** * Indicates that the user may select * more than one item from the current selectable descendants. Value type: * boolean */ MULTI_SELECTABLE, /** * Indicates whether the element's * orientation is horizontal, vertical, or unknown/ambiguous. Value type: * {@link Orientation} */ ORIENTATION, /** * Defines a short hint (a word or short * phrase) intended to aid the user with data entry when the control has no * value. A hint could be a sample value or a brief description of the expected * format. Value type: string */ PLACEHOLDER, /** * Indicates that the element is not editable, * but is otherwise operable. Value type: boolean */ READ_ONLY, /** * Indicates that user input is required on * the element before a form may be submitted. Value type: boolean */ REQUIRED, /** * Defines a human-readable, * author-localized description for the role of an element. Value type: string */ ROLE_DESCRIPTION, /** * Indicates if items in a table or grid are * sorted in ascending or descending order. Value type: {@link AccessibleSort} */ SORT, /** * Defines the maximum allowed value for a * range widget. Value type: double */ VALUE_MAX, /** * Defines the minimum allowed value for a * range widget. Value type: double */ VALUE_MIN, /** * Defines the current value for a range widget. * Value type: double */ VALUE_NOW, /** * Defines the human readable text alternative * of {@link Gtk.AccessibleProperty.VALUE_NOW} for a range widget. Value type: string */ VALUE_TEXT, /** * Defines a string value that provides a description of non-standard keyboard * interactions of the current element. Value type: string */ HELP_TEXT, } /** * @gir-type Enum */ export namespace AccessibleRelation { export const $gtype: GObject.GType; } /** * The possible accessible relations of a {@link Accessible}. * * Accessible relations can be references to other widgets, * integers or strings. * @gir-type Enum */ enum AccessibleRelation { /** * Identifies the currently active * element when focus is on a composite widget, combobox, textbox, group, * or application. Value type: reference */ ACTIVE_DESCENDANT, /** * Defines the total number of columns * in a table, grid, or treegrid. Value type: integer */ COL_COUNT, /** * Defines an element's column index or * position with respect to the total number of columns within a table, * grid, or treegrid. Value type: integer */ COL_INDEX, /** * Defines a human readable text * alternative of {@link Gtk.AccessibleRelation.COL_INDEX}. Value type: string */ COL_INDEX_TEXT, /** * Defines the number of columns spanned * by a cell or gridcell within a table, grid, or treegrid. Value type: integer */ COL_SPAN, /** * Identifies the element (or elements) whose * contents or presence are controlled by the current element. Value type: reference */ CONTROLS, /** * Identifies the element (or elements) * that describes the object. Value type: reference */ DESCRIBED_BY, /** * Identifies the element (or elements) that * provide additional information related to the object. Value type: reference */ DETAILS, /** * Identifies the element (or elements) that * provide an error message for an object. Value type: reference */ ERROR_MESSAGE, /** * Identifies the next element (or elements) * in an alternate reading order of content which, at the user's discretion, * allows assistive technology to override the general default of reading in * document source order. Value type: reference */ FLOW_TO, /** * Identifies the element (or elements) * that labels the current element. Value type: reference */ LABELLED_BY, /** * Identifies an element (or elements) in order * to define a visual, functional, or contextual parent/child relationship * between elements where the widget hierarchy cannot be used to represent * the relationship. Value type: reference */ OWNS, /** * Defines an element's number or position * in the current set of listitems or treeitems. Value type: integer */ POS_IN_SET, /** * Defines the total number of rows in a table, * grid, or treegrid. Value type: integer */ ROW_COUNT, /** * Defines an element's row index or position * with respect to the total number of rows within a table, grid, or treegrid. * Value type: integer */ ROW_INDEX, /** * Defines a human readable text * alternative of {@link Gtk.AccessibleRelation.ROW_INDEX}. Value type: string */ ROW_INDEX_TEXT, /** * Defines the number of rows spanned by a * cell or gridcell within a table, grid, or treegrid. Value type: integer */ ROW_SPAN, /** * Defines the number of items in the current * set of listitems or treeitems. Value type: integer */ SET_SIZE, /** * Identifies the element (or elements) that are labeled by the * current element. Value type: reference * * This relation is managed by GTK and should not be set from application code. */ LABEL_FOR, /** * Identifies the element (or elements) that are described by * the current element. Value type: reference * * This relation is managed by GTK and should not be set from application code. */ DESCRIPTION_FOR, /** * Identifies the element (or elements) that the current * element is controlled by. Value type: reference * * This relation is managed by GTK and should not be set from application code. */ CONTROLLED_BY, /** * Identifies the element (or elements) for which the current * element provides additional information. Value type: reference * * This relation is managed by GTK and should not be set from application code. */ DETAILS_FOR, /** * Identifies the element (or elements) for which the current * element provides an error message. Value type: reference * * This relation is managed by GTK and should not be set from application code. */ ERROR_MESSAGE_FOR, /** * Identifies the previous element (or elements) in an alternate * reading order of content which, at the user's discretion, allows * assistive technology to override the general default of reading in * document source order. Value type: reference * * This relation is managed by GTK and should not be set from application code. */ FLOW_FROM, } /** * @gir-type Enum */ export namespace AccessibleRole { export const $gtype: GObject.GType; } /** * The accessible role for a {@link Accessible} implementation. * * Abstract roles are only used as part of the ontology; application * developers must not use abstract roles in their code. * @gir-type Enum */ enum AccessibleRole { /** * An element with important, and usually * time-sensitive, information */ ALERT, /** * A type of dialog that contains an * alert message */ ALERT_DIALOG, /** * Unused */ BANNER, /** * An input element that allows for * user-triggered actions when clicked or pressed */ BUTTON, /** * Unused */ CAPTION, /** * Unused */ CELL, /** * A checkable input element that has * three possible values: `true`, `false`, or `mixed` */ CHECKBOX, /** * A header in a columned list. */ COLUMN_HEADER, /** * An input that controls another element, * such as a list or a grid, that can dynamically pop up to help the user * set the value of the input */ COMBO_BOX, /** * Abstract role. */ COMMAND, /** * Abstract role. */ COMPOSITE, /** * A dialog is a window that is designed to interrupt * the current processing of an application in order to prompt the user to enter * information or require a response. */ DIALOG, /** * Content that assistive technology users may want to * browse in a reading mode. */ DOCUMENT, /** * Unused */ FEED, /** * Unused */ FORM, /** * A nameless container that has no semantic meaning * of its own. This is the role that GTK uses by default for widgets. */ GENERIC, /** * A grid of items. */ GRID, /** * An item in a grid or tree grid. */ GRID_CELL, /** * An element that groups multiple related widgets. GTK uses * this role for various containers, like {@link Gtk.HeaderBar} or {@link Gtk.Notebook}. */ GROUP, /** * Unused */ HEADING, /** * An image. */ IMG, /** * Abstract role. */ INPUT, /** * A visible name or caption for a user interface component. */ LABEL, /** * Abstract role. */ LANDMARK, /** * Unused */ LEGEND, /** * A clickable link. */ LINK, /** * A list of items. */ LIST, /** * Unused. */ LIST_BOX, /** * An item in a list. */ LIST_ITEM, /** * Unused */ LOG, /** * Unused */ MAIN, /** * Unused */ MARQUEE, /** * Unused */ MATH, /** * An element that represents a value within a known range. */ METER, /** * A menu. */ MENU, /** * A menubar. */ MENU_BAR, /** * An item in a menu. */ MENU_ITEM, /** * A check item in a menu. */ MENU_ITEM_CHECKBOX, /** * A radio item in a menu. */ MENU_ITEM_RADIO, /** * Unused */ NAVIGATION, /** * An element that is not represented to accessibility technologies. * This role is synonymous to `GTK_ACCESSIBLE_ROLE_PRESENTATION`. */ NONE, /** * Unused */ NOTE, /** * Unused */ OPTION, /** * An element that is not represented to accessibility technologies. * This role is synonymous to `GTK_ACCESSIBLE_ROLE_NONE`. */ PRESENTATION, /** * An element that displays the progress * status for tasks that take a long time. */ PROGRESS_BAR, /** * A checkable input in a group of radio roles, * only one of which can be checked at a time. */ RADIO, /** * Unused */ RADIO_GROUP, /** * Abstract role. */ RANGE, /** * Unused */ REGION, /** * A row in a columned list. */ ROW, /** * Unused */ ROW_GROUP, /** * Unused */ ROW_HEADER, /** * A graphical object that controls the scrolling * of content within a viewing area, regardless of whether the content is fully * displayed within the viewing area. */ SCROLLBAR, /** * Unused */ SEARCH, /** * A type of textbox intended for specifying * search criteria. */ SEARCH_BOX, /** * Abstract role. */ SECTION, /** * Abstract role. */ SECTION_HEAD, /** * Abstract role. */ SELECT, /** * A divider that separates and distinguishes * sections of content or groups of menuitems. */ SEPARATOR, /** * A user input where the user selects a value * from within a given range. */ SLIDER, /** * A form of range that expects the user to * select from among discrete choices. */ SPIN_BUTTON, /** * Unused */ STATUS, /** * Abstract role. */ STRUCTURE, /** * A type of checkbox that represents on/off values, * as opposed to checked/unchecked values. */ SWITCH, /** * An item in a list of tab used for switching pages. */ TAB, /** * Unused */ TABLE, /** * A list of tabs for switching pages. */ TAB_LIST, /** * A page in a notebook or stack. */ TAB_PANEL, /** * A type of input that allows free-form text * as its value. */ TEXT_BOX, /** * Unused */ TIME, /** * Unused */ TIMER, /** * Unused */ TOOLBAR, /** * Unused */ TOOLTIP, /** * Unused */ TREE, /** * A treeview-like, columned list. */ TREE_GRID, /** * Unused */ TREE_ITEM, /** * Abstract role for interactive components of a * graphical user interface */ WIDGET, /** * Abstract role for windows. */ WINDOW, /** * A type of push button which stays pressed until depressed by a second * activation. */ TOGGLE_BUTTON, /** * A toplevel element of a graphical user interface. * * This is the role that GTK uses by default for windows. */ APPLICATION, /** * A paragraph of content. */ PARAGRAPH, /** * A section of content that is quoted from another source. */ BLOCK_QUOTE, /** * A section of a page that consists of a composition that forms an independent * part of a document, page, or site. */ ARTICLE, /** * A comment contains content expressing reaction to other content. */ COMMENT, /** * A virtual terminal. */ TERMINAL, } /** * @gir-type Enum */ export namespace AccessibleSort { export const $gtype: GObject.GType; } /** * The possible values for the {@link Gtk.AccessibleProperty.SORT} * accessible property. * @gir-type Enum */ enum AccessibleSort { /** * There is no defined sort applied to the column. */ NONE, /** * Items are sorted in ascending order by this column. */ ASCENDING, /** * Items are sorted in descending order by this column. */ DESCENDING, /** * A sort algorithm other than ascending or * descending has been applied. */ OTHER, } /** * @gir-type Enum */ export namespace AccessibleState { export const $gtype: GObject.GType; } /** * The possible accessible states of a {@link Accessible}. * @gir-type Enum */ enum AccessibleState { /** * A “busy” state. This state has boolean values */ BUSY, /** * A “checked” state; indicates the current * state of a {@link CheckButton}. Value type: {@link AccessibleTristate} */ CHECKED, /** * A “disabled” state; corresponds to the * {@link Widget.sensitive} property. It indicates a UI element * that is perceivable, but not editable or operable. Value type: boolean */ DISABLED, /** * An “expanded” state; corresponds to the * {@link Expander.expanded} property. Value type: boolean * or undefined */ EXPANDED, /** * A “hidden” state; corresponds to the * {@link Widget.visible} property. You can use this state * explicitly on UI elements that should not be exposed to an assistive * technology. Value type: boolean * See also: {@link Gtk.AccessibleState.DISABLED} */ HIDDEN, /** * An “invalid” state; set when a widget * is showing an error. Value type: {@link AccessibleInvalidState} */ INVALID, /** * A “pressed” state; indicates the current * state of a {@link ToggleButton}. Value type: {@link AccessibleTristate} * enumeration */ PRESSED, /** * A “selected” state; set when a widget * is selected. Value type: boolean or undefined */ SELECTED, /** * Indicates that a widget with the GTK_ACCESSIBLE_ROLE_LINK has been visited. * Value type: boolean. */ VISITED, } /** * @gir-type Enum */ export namespace AccessibleTextContentChange { export const $gtype: GObject.GType; } /** * The type of contents change operation. * @gir-type Enum * @since 4.14 */ enum AccessibleTextContentChange { /** * contents change as the result of * an insert operation */ INSERT, /** * contents change as the result of * a remove operation */ REMOVE, } /** * @gir-type Enum */ export namespace AccessibleTextGranularity { export const $gtype: GObject.GType; } /** * The granularity for queries about the text contents of a {@link Gtk.AccessibleText} * implementation. * @gir-type Enum * @since 4.14 */ enum AccessibleTextGranularity { /** * Use the boundary between * characters (including non-printing characters) */ CHARACTER, /** * Use the boundary between words, * starting from the beginning of the current word and ending at the * beginning of the next word */ WORD, /** * Use the boundary between * sentences, starting from the beginning of the current sentence and * ending at the beginning of the next sentence */ SENTENCE, /** * Use the boundary between lines, * starting from the beginning of the current line and ending at the * beginning of the next line */ LINE, /** * Use the boundary between * paragraphs, starting from the beginning of the current paragraph and * ending at the beginning of the next paragraph */ PARAGRAPH, } /** * @gir-type Enum */ export namespace AccessibleTristate { export const $gtype: GObject.GType; } /** * The possible values for the {@link Gtk.AccessibleState.PRESSED} * accessible state. * * Note that the {@link Gtk.AccessibleTristate.FALSE} and * {@link Gtk.AccessibleTristate.TRUE} have the same values * as `false` and `true`. * @gir-type Enum */ enum AccessibleTristate { /** * The state is `false` */ FALSE, /** * The state is `true` */ TRUE, /** * The state is `mixed` */ MIXED, } /** * @gir-type Enum */ export namespace Align { export const $gtype: GObject.GType; } /** * Controls how a widget deals with extra space in a single dimension. * * Alignment only matters if the widget receives a “too large” allocation, * for example if you packed the widget with the {@link Gtk.Widget.hexpand} * property inside a {@link 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. * * Baseline support is optional for containers and widgets, and is only available * for vertical alignment. `GTK_ALIGN_BASELINE_CENTER` and `GTK_ALIGN_BASELINE_FILL` * are treated similar to `GTK_ALIGN_CENTER` and `GTK_ALIGN_FILL`, except that it * positions the widget to line up the baselines, where that is supported. * @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, /** * a different name for `GTK_ALIGN_BASELINE`. */ BASELINE_FILL, /** * align the widget according to the baseline. */ BASELINE, /** * stretch to fill all space, but align the baseline. */ BASELINE_CENTER, } /** * @gir-type Enum */ export namespace ArrowType { export const $gtype: GObject.GType; } /** * Indicates 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. */ NONE, } /** * @gir-type Enum */ export namespace AssistantPageType { export const $gtype: GObject.GType; } /** * Determines the role of a page inside a {@link Gtk.Assistant}. * * The role is 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 * @deprecated since 4.10: {@link Gtk.Assistant} will be removed in GTK 5 */ 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; } /** * Baseline position in a row of widgets. * * 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 vertical 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 available space. * @gir-type Enum */ 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, /** * Same as {@link Gtk.BorderStyle.NONE} */ HIDDEN, /** * 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, /** * 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; /** * A function could not be found. This often happens * when symbols are set to be kept private. Compiling code with -rdynamic or using the * `gmodule-export-2.0` pkgconfig module can fix this problem. */ static INVALID_FUNCTION: number; // Constructors constructor(options: { message: string; code: number }); // Static methods /** * Registers an error quark for {@link Gtk.Builder} errors. */ static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace ButtonsType { export const $gtype: GObject.GType; } /** * Prebuilt sets of buttons for {@link Gtk.Dialog}. * * If none of these choices are appropriate, simply use * {@link Gtk.ButtonsType.NONE} and call {@link 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](https://developer.gnome.org/hig/). * @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; } /** * The available modes for {@link Gtk.CellRendererAccel.accel_mode}. * @gir-type Enum * @deprecated since 4.20: There is no replacement */ 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 * @deprecated since 4.20: There is no replacement. */ 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 Collation { export const $gtype: GObject.GType; } /** * Describes how a {@link Gtk.StringSorter} turns strings into sort keys to * compare them. * * Note that the result of sorting will in general depend on the current locale * unless the mode is `GTK_COLLATION_NONE`. * @gir-type Enum * @since 4.10 */ enum Collation { /** * Don't do any collation */ NONE, /** * Use {@link GLib.utf8_collate_key} */ UNICODE, /** * Use {@link GLib.utf8_collate_key_for_filename} */ FILENAME, } /** * @gir-type Enum */ export namespace ConstraintAttribute { export const $gtype: GObject.GType; } /** * The widget attributes that can be used when creating a {@link Constraint}. * @gir-type Enum */ enum ConstraintAttribute { /** * No attribute, used for constant * relations */ NONE, /** * The left edge of a widget, regardless of * text direction */ LEFT, /** * The right edge of a widget, regardless * of text direction */ RIGHT, /** * The top edge of a widget */ TOP, /** * The bottom edge of a widget */ BOTTOM, /** * The leading edge of a widget, depending * on text direction; equivalent to {@link Gtk.ConstraintAttribute.LEFT} for LTR * languages, and {@link Gtk.ConstraintAttribute.RIGHT} for RTL ones */ START, /** * The trailing edge of a widget, depending * on text direction; equivalent to {@link Gtk.ConstraintAttribute.RIGHT} for LTR * languages, and {@link Gtk.ConstraintAttribute.LEFT} for RTL ones */ END, /** * The width of a widget */ WIDTH, /** * The height of a widget */ HEIGHT, /** * The center of a widget, on the * horizontal axis */ CENTER_X, /** * The center of a widget, on the * vertical axis */ CENTER_Y, /** * The baseline of a widget */ BASELINE, } /** * @gir-type Enum */ export namespace ConstraintRelation { export const $gtype: GObject.GType; } /** * The relation between two terms of a constraint. * @gir-type Enum */ enum ConstraintRelation { /** * Less than, or equal */ LE, /** * Equal */ EQ, /** * Greater than, or equal */ GE, } /** * @gir-type Enum */ export namespace ConstraintStrength { export const $gtype: GObject.GType; } /** * The strength of a constraint, expressed as a symbolic constant. * * The strength of a {@link Constraint} can be expressed with any positive * integer; the values of this enumeration can be used for readability. * @gir-type Enum */ enum ConstraintStrength { /** * The constraint is required towards solving the layout */ REQUIRED, /** * A strong constraint */ STRONG, /** * A medium constraint */ MEDIUM, /** * A weak constraint */ WEAK, } /** * Domain for VFL parsing errors. * @gir-type Struct */ class ConstraintVflParserError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * Invalid or unknown symbol */ static INVALID_SYMBOL: number; /** * Invalid or unknown attribute */ static INVALID_ATTRIBUTE: number; /** * Invalid or unknown view */ static INVALID_VIEW: number; /** * Invalid or unknown metric */ static INVALID_METRIC: number; /** * Invalid or unknown priority */ static INVALID_PRIORITY: number; /** * Invalid or unknown relation */ static INVALID_RELATION: number; // Constructors constructor(options: { message: string; code: number }); // Static methods /** * Registers an error quark for VFL error parsing. */ static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace ContentFit { export const $gtype: GObject.GType; } /** * Controls how a content should be made to fit inside an allocation. * @gir-type Enum * @since 4.8 */ enum ContentFit { /** * Make the content fill the entire allocation, * without taking its aspect ratio in consideration. The resulting * content will appear as stretched if its aspect ratio is different * from the allocation aspect ratio. */ FILL, /** * Scale the content to fit the allocation, * while taking its aspect ratio in consideration. The resulting * content will appear as letterboxed if its aspect ratio is different * from the allocation aspect ratio. */ CONTAIN, /** * Cover the entire allocation, while taking * the content aspect ratio in consideration. The resulting content * will appear as clipped if its aspect ratio is different from the * allocation aspect ratio. */ COVER, /** * The content is scaled down to fit the * allocation, if needed, otherwise its original size is used. */ SCALE_DOWN, } /** * @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 `GtkScrolledWindow.` * * 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, } /** * Errors that can occur while parsing CSS. * * These errors are unexpected and will cause parts of the given CSS * to be ignored. * @gir-type Struct */ class CssParserError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * Unknown failure. */ static FAILED: number; /** * The given text does not form valid syntax */ static SYNTAX: number; /** * Failed to import a resource */ static IMPORT: number; /** * The given name has not been defined */ static NAME: number; /** * The given value is not correct */ static UNKNOWN_VALUE: number; // Constructors constructor(options: { message: string; code: number }); } /** * Warnings that can occur while parsing CSS. * * Unlike {@link Gtk.CssParserError}s, warnings do not cause the parser to * skip any input, but they indicate issues that should be fixed. * @gir-type Enum */ enum CssParserWarning { /** * The given construct is * deprecated and will be removed in a future version */ DEPRECATED, /** * A syntax construct was used * that should be avoided */ SYNTAX, /** * A feature is not implemented */ UNIMPLEMENTED, } /** * @gir-type Enum */ export namespace DeleteType { export const $gtype: GObject.GType; } /** * Passed to various keybinding signals for deleting text. * @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 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, } /** * Error codes in the `GTK_DIALOG_ERROR` domain that can be returned * by async dialog functions. * @gir-type Struct */ class DialogError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * Generic error condition for when * an operation fails and no more specific code is applicable */ static FAILED: number; /** * The async function call was cancelled * via its {@link Gio.Cancellable} */ static CANCELLED: number; /** * The operation was cancelled * by the user (via a Cancel or Close button) */ static DISMISSED: number; // Constructors constructor(options: { message: string; code: number }); // Static methods /** * Registers an error quark for an operation that requires a dialog if * necessary. */ static quark(): GLib.Quark; } /** * @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 EditableProperties { export const $gtype: GObject.GType; } /** * The identifiers for {@link Gtk.Editable} properties. * * See {@link Gtk.Editable.install_properties} for details on how to * implement the {@link Gtk.Editable} interface. * @gir-type Enum */ enum EditableProperties { /** * the property id for {@link Gtk.Editable.text} */ PROP_TEXT, /** * the property id for {@link Gtk.Editable.cursor_position} */ PROP_CURSOR_POSITION, /** * the property id for {@link Gtk.Editable.selection_bound} */ PROP_SELECTION_BOUND, /** * the property id for {@link Gtk.Editable.editable} */ PROP_EDITABLE, /** * the property id for {@link Gtk.Editable.width_chars} */ PROP_WIDTH_CHARS, /** * the property id for {@link Gtk.Editable.max_width_chars} */ PROP_MAX_WIDTH_CHARS, /** * the property id for {@link Gtk.Editable.xalign} */ PROP_XALIGN, /** * the property id for {@link Gtk.Editable.enable_undo} */ PROP_ENABLE_UNDO, /** * the number of properties */ NUM_PROPERTIES, } /** * @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 */ 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 Gesture}. * @gir-type Enum */ 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 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, } /** * 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} errors. */ static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace FilterChange { export const $gtype: GObject.GType; } /** * Describes changes in a filter in more detail and allows objects * using the filter to optimize refiltering items. * * If you are writing an implementation and are not sure which * value to pass, `GTK_FILTER_CHANGE_DIFFERENT` is always a correct * choice. * * New values may be added in the future. * @gir-type Enum */ enum FilterChange { /** * The filter change cannot be * described with any of the other enumeration values */ DIFFERENT, /** * The filter is less strict than * it was before: All items that it used to return true * still return true, others now may, too. */ LESS_STRICT, /** * The filter is more strict than * it was before: All items that it used to return false * still return false, others now may, too. */ MORE_STRICT, /** * Similar to {@link Gtk.FilterChange.DIFFERENT}, * but signs that item watches should be recreated. This is used by * {@link Gtk.FilterListModel} to keep the list up-to-date when items * change. */ DIFFERENT_REWATCH, /** * Similar to {@link Gtk.FilterChange.LESS_STRICT}, * but signs that item watches should be recreated. This is used by * {@link Gtk.FilterListModel} to keep the list up-to-date when items * change. */ LESS_STRICT_REWATCH, /** * Similar to {@link Gtk.FilterChange.MORE_STRICT}, * but signs that item watches should be recreated. This is used by * {@link Gtk.FilterListModel} to keep the list up-to-date when items * change. */ MORE_STRICT_REWATCH, } /** * @gir-type Enum */ export namespace FilterMatch { export const $gtype: GObject.GType; } /** * Describes the known strictness of a filter. * * Note that for filters where the strictness is not known, * `GTK_FILTER_MATCH_SOME` is always an acceptable value, * even if a filter does match all or no items. * @gir-type Enum */ enum FilterMatch { /** * The filter matches some items, * {@link Gtk.Filter.match} may return true or false */ SOME, /** * The filter does not match any item, * {@link Gtk.Filter.match} will always return false */ NONE, /** * The filter matches all items, * {@link Gtk.Filter.match} will alays return true */ ALL, } /** * @gir-type Enum */ export namespace FontLevel { export const $gtype: GObject.GType; } /** * The level of granularity for the font selection. * * Depending on this value, the {@link Pango.FontDescription} that * is returned by {@link Gtk.FontDialogButton.get_font_desc} * will have more or less fields set. * @gir-type Enum * @since 4.10 */ enum FontLevel { /** * Select a font family */ FAMILY, /** * Select a font face (i.e. a family and a style) */ FACE, /** * Select a font (i.e. a face with a size, and possibly font variations) */ FONT, /** * Select a font and font features */ FEATURES, } /** * @gir-type Enum */ export namespace FontRendering { export const $gtype: GObject.GType; } /** * Values for the {@link Gtk.Settings.gtk_font_rendering} setting * that influence how GTK renders fonts. * @gir-type Enum * @since 4.16 */ enum FontRendering { /** * Set up font rendering automatically, * taking factors like screen resolution and scale into account */ AUTOMATIC, /** * Follow low-level font-related settings * when configuring font rendering */ MANUAL, } /** * @gir-type Enum */ export namespace GraphicsOffloadEnabled { export const $gtype: GObject.GType; } /** * Represents the state of graphics offloading. * @gir-type Enum * @since 4.14 */ enum GraphicsOffloadEnabled { /** * Graphics offloading is enabled. */ ENABLED, /** * Graphics offloading is disabled. */ DISABLED, } /** * @gir-type Enum */ export namespace IconSize { export const $gtype: GObject.GType; } /** * Built-in icon sizes. * * Icon sizes default to being inherited. Where they cannot be * inherited, text size is the default. * * All widgets which use {@link Gtk.IconSize} set the normal-icons or * large-icons style classes correspondingly, and let themes * determine the actual size to be used with the * `-gtk-icon-size` CSS property. * @gir-type Enum */ enum IconSize { /** * Keep the size of the parent element */ INHERIT, /** * Size similar to text size */ NORMAL, /** * Large size, for example in an icon view */ LARGE, } /** * Error codes for {@link Gtk.IconTheme} 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 /** * Registers an error quark for {@link Gtk.IconTheme} errors. */ 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 * @deprecated since 4.20: There is no replacement. */ enum IconViewDropPosition { /** * no drop possible */ NO_DROP, /** * dropped item replaces the item */ DROP_INTO, /** * dropped 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; for instance, if the `gtk_image_get_storage_type()` * returns {@link Gtk.ImageType.PAINTABLE}, then you can call `gtk_image_get_paintable()`. * * 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 named icon */ ICON_NAME, /** * the widget contains a {@link Gio.Icon} */ GICON, /** * the widget contains a {@link Gdk.Paintable} */ PAINTABLE, } /** * @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 {@link Gtk.InputPurpose.DIGITS} and * {@link Gtk.InputPurpose.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 */ 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 {@link Gtk.InputPurpose.FREE_FORM}, but characters are hidden */ PASSWORD, /** * Like {@link Gtk.InputPurpose.DIGITS}, but characters are hidden */ PIN, /** * Allow any character, in addition to control codes */ TERMINAL, } /** * @gir-type Enum */ export namespace InscriptionOverflow { export const $gtype: GObject.GType; } /** * The different methods to handle text in {@link Gtk.Inscription} when it doesn't * fit the available space. * @gir-type Enum * @since 4.8 */ enum InscriptionOverflow { /** * Clip the remaining text */ CLIP, /** * Omit characters at the start of the text */ ELLIPSIZE_START, /** * Omit characters at the middle of the text */ ELLIPSIZE_MIDDLE, /** * Omit characters at the end of the text */ ELLIPSIZE_END, } /** * @gir-type Enum */ export namespace InterfaceColorScheme { export const $gtype: GObject.GType; } /** * Values for the {@link Gtk.Settings.gtk_interface_color_scheme} * and {@link Gtk.CssProvider.prefers_color_scheme} properties * that indicates what color scheme is used. * * This information can be used inside CSS via media queries. * * More values may be added to this enumeration. Unknown values * should be treated the same as `GTK_INTERFACE_COLOR_SCHEME_DEFAULT`. * @gir-type Enum * @since 4.20 */ enum InterfaceColorScheme { /** * The system doesn't support color schemes */ UNSUPPORTED, /** * The default color scheme is used */ DEFAULT, /** * A dark color scheme is used */ DARK, /** * A light color scheme is used */ LIGHT, } /** * @gir-type Enum */ export namespace InterfaceContrast { export const $gtype: GObject.GType; } /** * Values for the {@link Gtk.Settings.gtk_interface_contrast} * and {@link Gtk.CssProvider.prefers_contrast} properties * that indicates the preferred level of contrast. * * This information can be used inside CSS via media queries. * * More values may be added to this enumeration. Unknown values * should be treated the same as `GTK_INTERFACE_CONTRAST_NO_PREFERENCE`. * @gir-type Enum * @since 4.20 */ enum InterfaceContrast { /** * The system doesn't support contrast levels */ UNSUPPORTED, /** * No particular preference for contrast */ NO_PREFERENCE, /** * More contrast is preferred */ MORE, /** * Less contrast is preferred */ LESS, } /** * @gir-type Enum */ export namespace Justification { export const $gtype: GObject.GType; } /** * Used for justifying the text inside a {@link Label} widget. * @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 LevelBar} contents should be rendered. * * Note that this enumeration could be extended with additional modes * in the future. * @gir-type Enum */ 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 */ 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 */ GPL_2_0_ONLY, /** * The GNU General Public License, version 3.0 only */ GPL_3_0_ONLY, /** * The GNU Lesser General Public License, version 2.1 only */ LGPL_2_1_ONLY, /** * The GNU Lesser General Public License, version 3.0 only */ LGPL_3_0_ONLY, /** * The GNU Affero General Public License, version 3.0 or later */ AGPL_3_0, /** * The GNU Affero General Public License, version 3.0 only */ AGPL_3_0_ONLY, /** * The 3-clause BSD licence */ BSD_3, /** * The Apache License, version 2.0 */ APACHE_2_0, /** * The Mozilla Public License, version 2.0 */ MPL_2_0, /** * Zero-Clause BSD license */ "0BSD", } /** * @gir-type Enum */ export namespace ListTabBehavior { export const $gtype: GObject.GType; } /** * Used to configure the focus behavior in the `GTK_DIR_TAB_FORWARD` * and `GTK_DIR_TAB_BACKWARD` direction, like the Tab key * in a {@link Gtk.ListView}. * @gir-type Enum * @since 4.12 */ enum ListTabBehavior { /** * Cycle through all focusable items of the list */ ALL, /** * Cycle through a single list element, then move * focus out of the list. Moving focus between items needs to be * done with the arrow keys. */ ITEM, /** * Cycle only through a single cell, then * move focus out of the list. Moving focus between cells needs to * be done with the arrow keys. This is only relevant for * cell-based widgets like {@link Gtk.ColumnView}, otherwise it behaves * like `GTK_LIST_TAB_ITEM`. */ CELL, } /** * @gir-type Enum */ export namespace MessageType { export const $gtype: GObject.GType; } /** * The type of message being displayed in a {@link MessageDialog}. * @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; } /** * Passed as argument to various keybinding signals for moving the * cursor position. * @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 NaturalWrapMode { export const $gtype: GObject.GType; } /** * Options for selecting a different wrap mode for natural size * requests. * * See for example the {@link Gtk.Label.natural_wrap_mode} property. * @gir-type Enum * @since 4.6 */ enum NaturalWrapMode { /** * Inherit the minimum size request. * In particular, this should be used with {@link Pango.WrapMode.CHAR}. */ INHERIT, /** * Try not to wrap the text. This mode is the * closest to GTK3's behavior but can lead to a wide label leaving * lots of empty space below the text. */ NONE, /** * Attempt to wrap at word boundaries. This * is useful in particular when using {@link Pango.WrapMode.WORD_CHAR} as the * wrap mode. */ WORD, } /** * @gir-type Enum */ export namespace NotebookTab { export const $gtype: GObject.GType; } /** * The parameter used in the action signals of {@link Gtk.Notebook}. * @gir-type Enum */ enum NotebookTab { /** * the first tab in the notebook */ FIRST, /** * the last tab in the notebook */ 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 Ordering { export const $gtype: GObject.GType; } /** * Describes the way two values can be compared. * * These values can be used with a {@link GLib.CompareFunc}. However, * a {@link GLib.CompareFunc} is allowed to return any integer values. * For converting such a value to a {@link Gtk.Ordering} value, use * {@link Gtk.Ordering.from_cmpfunc}. * @gir-type Enum */ enum Ordering { /** * the first value is smaller than the second */ SMALLER, /** * the two values are equal */ EQUAL, /** * the first value is larger than the second */ LARGER, } /** * @gir-type Enum */ export namespace Orientation { export const $gtype: GObject.GType; } /** * Represents the orientation of widgets and other objects. * * Typical examples are {@link Box} or {@link 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 Overflow { export const $gtype: GObject.GType; } /** * Defines how content overflowing a given area should be handled. * * This is used in {@link Gtk.Widget.set_overflow}. The * {@link Gtk.Widget.overflow} property is modeled after the * CSS overflow property, but implements it only partially. * @gir-type Enum */ enum Overflow { /** * No change is applied. Content is drawn at the specified * position. */ VISIBLE, /** * Content is clipped to the bounds of the area. Content * outside the area is not drawn and cannot be interacted with. */ HIDDEN, } /** * @gir-type Enum */ export namespace PackType { export const $gtype: GObject.GType; } /** * Represents the packing location of a children in its parent. * * See {@link WindowControls} for example. * @gir-type Enum */ enum PackType { /** * The child is packed into the start of the widget */ START, /** * The child is packed into the end of the widget */ 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, /** * Action is triggered by a pad dial */ DIAL, } /** * @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 GesturePan}. * @gir-type Enum */ enum PanDirection { /** * panned towards the left */ LEFT, /** * panned towards the right */ RIGHT, /** * panned upwards */ UP, /** * panned downwards */ DOWN, } /** * @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. */ EXTERNAL, } /** * @gir-type Enum */ export namespace PositionType { export const $gtype: GObject.GType; } /** * Describes which edge of a widget a certain feature is positioned at. * * For examples, see the tabs of a {@link Notebook}, or the label * of a {@link 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; } /** * Determines what action the print operation should perform. * * A parameter of this typs is passed to {@link Gtk.PrintOperation.run}. * @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, if possible. * Depending on the platform, a print dialog might appear anyway. */ 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; } /** * The result of a print operation. * * A value of this type is returned by {@link Gtk.PrintOperation.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 PropagationLimit { export const $gtype: GObject.GType; } /** * Describes limits of a {@link EventController} for handling events * targeting other widgets. * @gir-type Enum */ enum PropagationLimit { /** * Events are handled regardless of what their * target is. */ NONE, /** * Events are only handled if their target is in * the same {@link Native} (or widget with {@link Gtk.Widget.limit_events} * set) as the event controllers widget. * Note that some event types have two targets (origin and destination). */ SAME_NATIVE, } /** * @gir-type Enum */ export namespace PropagationPhase { export const $gtype: GObject.GType; } /** * Describes the stage at which events are fed into a {@link EventController}. * @gir-type Enum */ enum PropagationPhase { /** * Events are not delivered. */ 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, } /** * 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 /** * Registers an error quark for {@link RecentManager} errors. */ static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace ReducedMotion { export const $gtype: GObject.GType; } /** * Values for the {@link Gtk.Settings.gtk_interface_reduced_motion} * and {@link Gtk.CssProvider.prefers_reduced_motion} properties * that indicates the preferred level of motion animations. * * This information can be used inside CSS via media queries. * @gir-type Enum * @since 4.22 */ enum ReducedMotion { /** * The user has made no preference known to the system */ NO_PREFERENCE, /** * The user has notified the system that they * prefer an interface that removes or replaces the types of motion-based * animation that either trigger discomfort for those with vestibular * motion sensitivity, or distraction for those with attention deficits */ REDUCE, } /** * @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 * @deprecated since 4.20: There is no replacement. */ 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 RestoreReason { export const $gtype: GObject.GType; } /** * Enumerates possible reasons for an application to restore saved state. * * See `Gtk.Application::restore-state`. * @gir-type Enum * @since 4.24 */ enum RestoreReason { /** * Don't restore anything */ PRISTINE, /** * This is normal launch. Restore as little as is reasonable */ LAUNCH, /** * The application has crashed before. Try to restore the previous state */ RECOVER, /** * This is a session restore. Restore the previous state as far as possible */ RESTORE, } /** * @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, /** * Floop in from the left */ SWING_RIGHT, /** * Floop in from the right */ SWING_LEFT, /** * Floop in from the bottom */ SWING_UP, /** * Floop in from the top */ SWING_DOWN, /** * Combination of {@link Gtk.RevealerTransitionType.CROSSFADE} * and {@link Gtk.RevealerTransitionType.SLIDE_RIGHT}. */ FADE_SLIDE_RIGHT, /** * Combination of {@link Gtk.RevealerTransitionType.CROSSFADE} * and {@link Gtk.RevealerTransitionType.SLIDE_LEFT}. */ FADE_SLIDE_LEFT, /** * Combination of {@link Gtk.RevealerTransitionType.CROSSFADE} * and {@link Gtk.RevealerTransitionType.SLIDE_UP}. */ FADE_SLIDE_UP, /** * Combination of {@link Gtk.RevealerTransitionType.CROSSFADE} * and {@link Gtk.RevealerTransitionType.SLIDE_DOWN}. */ FADE_SLIDE_DOWN, } /** * @gir-type Enum */ export namespace ScrollStep { export const $gtype: GObject.GType; } /** * Passed as argument to various keybinding signals. * @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 various controls, * such as combo box buttons. * @gir-type Enum */ enum SensitivityType { /** * The control is made insensitive if no * action can be triggered */ AUTO, /** * The control is always sensitive */ ON, /** * The control is always insensitive */ OFF, } /** * @gir-type Enum */ export namespace ShortcutScope { export const $gtype: GObject.GType; } /** * Describes where {@link Shortcut}s added to a * {@link ShortcutController} get handled. * @gir-type Enum */ enum ShortcutScope { /** * Shortcuts are handled inside * the widget the controller belongs to. */ LOCAL, /** * Shortcuts are handled by * the first ancestor that is a {@link ShortcutManager} */ MANAGED, /** * Shortcuts are handled by * the root widget. */ GLOBAL, } /** * @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 */ enum ShortcutType { /** * The shortcut is a keyboard accelerator. The GtkShortcutsShortcut: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 GtkShortcutsShortcut:icon property will be * used. */ GESTURE, /** * The shortcut is a swipe gesture. GTK provides an icon and subtitle. */ GESTURE_SWIPE_LEFT, /** * The shortcut is a swipe gesture. GTK provides an icon and subtitle. */ GESTURE_SWIPE_RIGHT, } /** * @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 SorterChange { export const $gtype: GObject.GType; } /** * Describes changes in a sorter in more detail and allows users * to optimize resorting. * @gir-type Enum */ enum SorterChange { /** * The sorter change cannot be described * by any of the other enumeration values */ DIFFERENT, /** * The sort order was inverted. Comparisons * that returned {@link Gtk.Ordering.SMALLER} now return {@link Gtk.Ordering.LARGER} * and vice versa. Other comparisons return the same values as before. */ INVERTED, /** * The sorter is less strict: Comparisons * may now return {@link Gtk.Ordering.EQUAL} that did not do so before. */ LESS_STRICT, /** * The sorter is more strict: Comparisons * that did return {@link Gtk.Ordering.EQUAL} may not do so anymore. */ MORE_STRICT, } /** * @gir-type Enum */ export namespace SorterOrder { export const $gtype: GObject.GType; } /** * Describes the type of order that a {@link Gtk.Sorter} may produce. * @gir-type Enum */ enum SorterOrder { /** * A partial order. Any {@link Gtk.Ordering} is possible. */ PARTIAL, /** * No order, all elements are considered equal. * `gtk_sorter_compare()` will only return {@link Gtk.Ordering.EQUAL}. */ NONE, /** * A total order. `gtk_sorter_compare()` will only * return {@link Gtk.Ordering.EQUAL} if an item is compared with itself. Two * different items will never cause this value to be returned. */ TOTAL, } /** * @gir-type Enum */ export namespace SpinButtonUpdatePolicy { export const $gtype: GObject.GType; } /** * Determines whether the spin button displays values outside the adjustment * bounds. * * See {@link Gtk.SpinButton.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; } /** * 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 */ OVER_UP, /** * Cover the old page by sliding down */ OVER_DOWN, /** * Cover the old page by sliding to the left */ OVER_LEFT, /** * Cover the old page by sliding to the right */ OVER_RIGHT, /** * Uncover the new page by sliding up */ UNDER_UP, /** * Uncover the new page by sliding down */ UNDER_DOWN, /** * Uncover the new page by sliding to the left */ UNDER_LEFT, /** * Uncover the new page by sliding to the right */ UNDER_RIGHT, /** * Cover the old page sliding up or uncover the new page sliding down, according to order */ OVER_UP_DOWN, /** * Cover the old page sliding down or uncover the new page sliding up, according to order */ OVER_DOWN_UP, /** * Cover the old page sliding left or uncover the new page sliding right, according to order */ OVER_LEFT_RIGHT, /** * Cover the old page sliding right or uncover the new page sliding left, according to order */ OVER_RIGHT_LEFT, /** * Pretend the pages are sides of a cube and rotate that cube to the left */ ROTATE_LEFT, /** * Pretend the pages are sides of a cube and rotate that cube to the right */ ROTATE_RIGHT, /** * Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order */ ROTATE_LEFT_RIGHT, } /** * @gir-type Enum */ export namespace StringFilterMatchMode { export const $gtype: GObject.GType; } /** * Specifies how search strings are matched inside text. * @gir-type Enum */ enum StringFilterMatchMode { /** * The search string and * text must match exactly */ EXACT, /** * The search string * must be contained as a substring inside the text */ SUBSTRING, /** * The text must begin * with the search string */ PREFIX, } /** * Error codes in the `GTK_SVG_ERROR` domain for errors * that happen during parsing or rendering of SVG. * @gir-type Struct */ class SvgError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * The XML syntax is broken * in some way */ static INVALID_SYNTAX: number; /** * An XML element is invalid * (either because it is not part of SVG, or because it is * in the wrong place, or because it not implemented in GTK) */ static INVALID_ELEMENT: number; /** * An attribute is invalid * (either because it is not part of SVG, or because it is * not implemented in GTK, or its value is problematic) */ static INVALID_ATTRIBUTE: number; /** * A required attribute is missing */ static MISSING_ATTRIBUTE: number; /** * A reference does not point to * a suitable element */ static INVALID_REFERENCE: number; /** * An animation could not be updated */ static FAILED_UPDATE: number; /** * Rendering is not according to * expecations */ static FAILED_RENDERING: number; /** * An XML element is ignored, * but it should not affect rendering (this error code is used * for metadata and exension elements) */ static IGNORED_ELEMENT: number; /** * An implementation limit has * been hit, such as the number of loaded shapes. */ static LIMITS_EXCEEDED: number; /** * The SVG uses features that * are not supported by {@link Gtk.Svg}. It may be advisable to use * a different SVG renderer. */ static NOT_IMPLEMENTED: number; static FEATURE_DISABLED: number; // Constructors constructor(options: { message: string; code: number }); // Static methods /** * Returns context information about what XML attribute * the parsing error occurred in. * @param error an error in the {@link Gtk.SvgError} domain */ static get_attribute(error: GLib.Error): string | null; /** * Returns context information about what XML element * the parsing error occurred in. * @param error an error in the {@link Gtk.SvgError} domain */ static get_element(error: GLib.Error): string | null; /** * Returns context information about the end position * in the document where the parsing error occurred. * @param error an error in the {@link Gtk.SvgError} domain */ static get_end(error: GLib.Error): SvgLocation | null; /** * Returns context information about the start position * in the document where the parsing error occurred. * @param error an error in the {@link Gtk.SvgError} domain */ static get_start(error: GLib.Error): SvgLocation | null; static quark(): GLib.Quark; } /** * @gir-type Enum */ export namespace SymbolicColor { export const $gtype: GObject.GType; } /** * The indexes of colors passed to symbolic color rendering, such as * {@link Gtk.SymbolicPaintable.snapshot_symbolic}. * * More values may be added over time. * @gir-type Enum * @since 4.6 */ enum SymbolicColor { /** * The default foreground color */ FOREGROUND, /** * Indication color for errors */ ERROR, /** * Indication color for warnings */ WARNING, /** * Indication color for success */ SUCCESS, /** * The system accent color. */ ACCENT, } /** * @gir-type Enum */ export namespace SystemSetting { export const $gtype: GObject.GType; } /** * Values that can be passed to the {@link Gtk.Widget.system_setting_changed} * vfunc. * * The values indicate which system setting has changed. * Widgets may need to drop caches, or react otherwise. * * Most of the values correspond to {@link Settings} properties. * * More values may be added over time. * @gir-type Enum */ enum SystemSetting { /** * the {@link Gtk.Settings.gtk_xft_dpi} setting has changed */ DPI, /** * The {@link Gtk.Settings.gtk_font_name} setting has changed */ FONT_NAME, /** * The font configuration has changed in a way that * requires text to be redrawn. This can be any of the * {@link Gtk.Settings.gtk_xft_antialias}, * {@link Gtk.Settings.gtk_xft_hinting}, * {@link Gtk.Settings.gtk_xft_hintstyle}, * {@link Gtk.Settings.gtk_xft_rgba} or * {@link Gtk.Settings.gtk_fontconfig_timestamp} settings */ FONT_CONFIG, /** * The display has changed */ DISPLAY, /** * The icon theme has changed in a way that requires * icons to be looked up again */ ICON_THEME, } /** * @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 * `Gtk.TextView::extend-selection` signal to customize the selection. * @gir-type Enum */ 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 ::snapshot_layer vfunc. * @gir-type Enum */ enum TextViewLayer { /** * The layer rendered below the text (but above the background). */ BELOW_TEXT, /** * The layer rendered above the text. */ 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 { /** * 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 TreeViewColumnSizing { export const $gtype: GObject.GType; } /** * The sizing method the column uses to determine its width. Please note * that {@link Gtk.TreeViewColumnSizing.AUTOSIZE} are inefficient for large views, and * can make columns appear choppy. * @gir-type Enum * @deprecated since 4.20: There is no replacement. */ enum TreeViewColumnSizing { /** * Columns only get bigger in reaction to changes in the model */ GROW_ONLY, /** * Columns resize to be the optimal size every time 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 * @deprecated since 4.20: There is no replacement. */ 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 * @deprecated since 4.20: There is no replacement */ 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 WindowGravity { export const $gtype: GObject.GType; } /** * Determines which point or edge of a window is meant to remain fixed * when a window changes size. * @gir-type Enum * @since 4.20 */ enum WindowGravity { /** * The top left corner */ TOP_LEFT, /** * The top edge */ TOP, /** * The top right corner */ TOP_RIGHT, /** * The left edge */ LEFT, /** * The center pointer */ CENTER, /** * The right edge */ RIGHT, /** * The bottom left corner */ BOTTOM_LEFT, /** * the bottom edge */ BOTTOM, /** * The bottom right corner */ BOTTOM_RIGHT, /** * The top left or top right corner, * depending on the text direction */ TOP_START, /** * The top right or top left corner, * depending on the text direction */ TOP_END, /** * The left or right edge, * depending on the text direction */ START, /** * The right or left edge, * depending on the text direction */ END, /** * The bottom left or top right corner, * depending on the text direction */ BOTTOM_START, /** * The bottom right or top left corner, * depending on the text direction */ BOTTOM_END, } /** * @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, } /** * An attribute for the background color, expressed as an RGB value * encoded in a string using the format: `{r8},{g8},{b8}`. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_BACKGROUND: string; /** * An attribute for the font family name. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_FAMILY: string; /** * An attribute for the foreground color, expressed as an RGB value * encoded in a string using the format: `{r8},{g8},{b8}`. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_FOREGROUND: string; /** * An attribute for the overline style. * * Possible values are: * * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE} * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_OVERLINE: string; /** * The "none" overline value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE: string; /** * The "single" overline value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE: string; /** * An attribute for the font size, expressed in points. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_SIZE: string; /** * An attribute for the font stretch type. * * Possible values are: * * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED} * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH: string; /** * The "condensed" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED: string; /** * The "expanded" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_EXPANDED: string; /** * The "extra condensed" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED: string; /** * The "extra expanded" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_EXPANDED: string; /** * The "normal" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_NORMAL: string; /** * The "semi condensed" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED: string; /** * The "semi expanded" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_EXPANDED: string; /** * The "ultra condensed" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED: string; /** * The "ultra expanded" stretch value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_EXPANDED: string; /** * An attribute for strikethrough text. * * Possible values are `true` or `false`. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STRIKETHROUGH: string; /** * An attribute for the font style. * * Possible values are: * * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC} * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STYLE: string; /** * The "italic" style value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STYLE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC: string; /** * The "normal" style value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STYLE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL: string; /** * The "oblique" style value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_STYLE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE: string; /** * An attribute for the underline style. * * Possible values are: * * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR} * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_UNDERLINE: string; /** * The "double" underline value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE: string; /** * The "error" underline value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR: string; /** * The "none" underline value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE: string; /** * The "single" underline value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE: string; /** * An attribute for the font variant. * * Possible values are: * * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE} * - {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS} * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_VARIANT: string; /** * The "all petite caps" variant value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS: string; /** * The "all small caps" variant value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS: string; /** * The "petite caps" variant value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS: string; /** * The "small caps" variant value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS: string; /** * The "title caps" variant value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS: string; /** * The "unicase" variant value for {@link Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT}. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE: string; /** * An attribute for the font weight. * @since 4.14 */ const ACCESSIBLE_ATTRIBUTE_WEIGHT: string; /** * An undefined value. The accessible attribute is either unset, or its * value is undefined. */ const ACCESSIBLE_VALUE_UNDEFINED: number; /** * Like {@link 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; /** * The default name of the extension point. */ const IM_MODULE_EXTENSION_POINT_NAME: string; /** * Constant to return from a signal handler for the ::input * signal in case of conversion failure. * * See `Gtk.SpinButton::input`. */ const INPUT_ERROR: number; /** * Like {@link 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 value used to refer to a guaranteed invalid position * in a {@link Gio.ListModel}. * * This value may be returned from some functions, others may * accept it as input. Its interpretation may differ for different * functions. * * Refer to each function's documentation for if this value is * allowed and what it does. */ const INVALID_LIST_POSITION: number; /** * The name used for the stock full offset included by {@link Gtk.LevelBar}. */ const LEVEL_BAR_OFFSET_FULL: string; /** * The name used for the stock high offset included by {@link Gtk.LevelBar}. */ const LEVEL_BAR_OFFSET_HIGH: string; /** * The name used for the stock low offset included by {@link Gtk.LevelBar}. */ const LEVEL_BAR_OFFSET_LOW: string; /** * Like {@link 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; /** * Evaluates to the maximum length of a compose sequence. * * This macro is longer used by GTK. */ const MAX_COMPOSE_LEN: number; /** * The default extension point name for media file. */ const MEDIA_FILE_EXTENSION_POINT_NAME: string; /** * Like {@link 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 {@link 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; /** * The key used by the “Print to file” printer to store whether to collate the * printed pages. */ const PRINT_SETTINGS_COLLATE: string; /** * The key used by the “Print to file” printer to store the default source. */ const PRINT_SETTINGS_DEFAULT_SOURCE: string; /** * The key used by the “Print to file” printer to store the dither used. */ const PRINT_SETTINGS_DITHER: string; /** * The key used by the “Print to file” printer to store whether to print the * output in duplex. */ const PRINT_SETTINGS_DUPLEX: string; /** * The key used by the “Print to file” printer to store the finishings. */ const PRINT_SETTINGS_FINISHINGS: string; /** * The key used by the “Print to file” printer to store the media type. * * The set of media types is defined in PWG 5101.1-2002 PWG. */ const PRINT_SETTINGS_MEDIA_TYPE: string; /** * The key used by the “Print to file” printer to store the number of pages per * sheet. */ const PRINT_SETTINGS_NUMBER_UP: string; /** * The key used by the “Print to file” printer to store the number of pages per * sheet in number-up mode. */ const PRINT_SETTINGS_NUMBER_UP_LAYOUT: string; /** * The key used by the “Print to file” printer to store the number of copies. */ const PRINT_SETTINGS_N_COPIES: string; /** * The key used by the “Print to file” printer to store the orientation. */ 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. */ const PRINT_SETTINGS_OUTPUT_BASENAME: string; /** * The key used by the “Print to file” printer to store the output bin. */ 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. */ 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; /** * The key used by the “Print to file” printer to store the array of page ranges * to print. */ const PRINT_SETTINGS_PAGE_RANGES: string; /** * The key used by the “Print to file” printer to store the set of pages to print. */ const PRINT_SETTINGS_PAGE_SET: string; /** * The key used by the “Print to file” printer to store the page format. */ const PRINT_SETTINGS_PAPER_FORMAT: string; /** * The key used by the “Print to file” printer to store the page height. */ const PRINT_SETTINGS_PAPER_HEIGHT: string; /** * The key used by the “Print to file” printer to store the paper width. */ const PRINT_SETTINGS_PAPER_WIDTH: string; /** * The key used by the “Print to file” printer to store the printer name. */ const PRINT_SETTINGS_PRINTER: string; /** * The key used by the “Print to file” printer to store the resolution in lines * per inch. */ const PRINT_SETTINGS_PRINTER_LPI: string; /** * The key used by the “Print to file” printer to store which pages to print. */ const PRINT_SETTINGS_PRINT_PAGES: string; /** * The key used by the “Print to file” printer to store the printing quality. */ const PRINT_SETTINGS_QUALITY: string; /** * The key used by the “Print to file” printer to store the resolution in DPI. */ const PRINT_SETTINGS_RESOLUTION: string; /** * The key used by the “Print to file” printer to store the horizontal * resolution in DPI. */ const PRINT_SETTINGS_RESOLUTION_X: string; /** * The key used by the “Print to file” printer to store the vertical resolution * in DPI. */ const PRINT_SETTINGS_RESOLUTION_Y: string; /** * The key used by the “Print to file” printer to store whether to reverse the * order of the printed pages. */ const PRINT_SETTINGS_REVERSE: string; /** * The key used by the “Print to file” printer to store the scale. */ const PRINT_SETTINGS_SCALE: string; /** * The key used by the “Print to file” printer to store whether to print with * colors. */ const PRINT_SETTINGS_USE_COLOR: string; /** * The key used by the “Print to file” printer to store 32-bit Windows extra * driver. */ const PRINT_SETTINGS_WIN32_DRIVER_EXTRA: string; /** * The key used by the “Print to file” printer to store the 32-bit Windows * driver version. */ 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; /** * 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-4.0/gtk.css`. * * You should not use priorities higher than this, to * give the user the last word. */ const STYLE_PROVIDER_PRIORITY_USER: number; /** * The {@link Gtk.SvgFeatures} that are enabled by default. * @since 4.22 */ const SVG_DEFAULT_FEATURES: number; /** * The priority at which the text view validates onscreen lines * in an idle job in the background. */ const TEXT_VIEW_PRIORITY_VALIDATE: number; /** * Uses the default sort function in a {@link Gtk.TreeSortable}. * * See also: {@link Gtk.TreeSortable.set_sort_column_id} * @deprecated since 4.20: There is no replacement */ const TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: number; /** * Disables sorting in a {@link Gtk.TreeSortable}. * * See also: {@link Gtk.TreeSortable.set_sort_column_id} * @deprecated since 4.20: There is no replacement */ const TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: number; /** * Generates an accessible description of an accelerator. * * This function is similar to {@link Gtk.accelerator_get_label} but it is meant * for accessibility layers labels rather than user-facing labels. The output * of this function is fit for {@link Gtk.AccessibleProperty.KEY_SHORTCUTS}. * * For more information, see the [WAI-ARIA](https://www.w3.org/TR/wai-aria/#aria-keyshortcuts) * reference. * @param accelerator_key accelerator keyval * @param accelerator_mods accelerator modifier mask * @returns a newly-allocated string representing the accelerator * @since 4.22 */ function accelerator_get_accessible_label(accelerator_key: number, accelerator_mods: Gdk.ModifierType): string; /** * Gets the modifier mask. * * The modifier mask determines which modifiers are considered significant * for keyboard accelerators. This includes all keyboard modifiers except * for `GDK_LOCK_MASK`. * @returns the modifier mask for accelerators */ 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 */ function accelerator_get_label(accelerator_key: number, accelerator_mods: Gdk.ModifierType): string; /** * Converts an accelerator keyval and modifier mask * into a string that can be displayed to the user. * * The string may be translated. * * This function is similar to {@link Gtk.accelerator_get_label}, * but handling keycodes. This is only useful for system-level * components, applications should use {@link Gtk.accelerator_get_label} * instead. * @param display a {@link Gdk.Display} * @param accelerator_key accelerator keyval * @param keycode accelerator keycode * @param accelerator_mods accelerator modifier mask * @returns a newly-allocated string representing the accelerator */ 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 * that can be parsed by {@link 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 {@link 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 that can be parsed by {@link Gtk.accelerator_parse_with_keycode}. * * This is similar to {@link Gtk.accelerator_name} but handling keycodes. * This is only useful for system-level components, applications * should use {@link Gtk.accelerator_name} instead. * @param display a {@link Gdk.Display} * @param accelerator_key accelerator keyval * @param keycode accelerator keycode * @param accelerator_mods accelerator modifier mask * @returns a newly allocated accelerator name. */ 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`”. * * The parser is fairly liberal and allows lower or upper case, and also * abbreviations such as “``” and “``”. * * Key names are parsed using {@link 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 “`-`”. * * Modifiers are enclosed in angular brackets `<>`, and match the * {@link Gdk.ModifierType} mask: * * - `` for `GDK_SHIFT_MASK` * - `` for `GDK_CONTROL_MASK` * - `` for `GDK_ALT_MASK` * - `` for `GDK_META_MASK` * - `` for `GDK_SUPER_MASK` * - `` for `GDK_HYPER_MASK` * * If the parse operation fails, `accelerator_key` and `accelerator_mods` will * be set to 0 (zero). * @param accelerator string representing an accelerator * @returns whether parsing succeeded */ function accelerator_parse(accelerator: string): [boolean, number, Gdk.ModifierType | null]; /** * Parses a string representing an accelerator. * * This is similar to {@link Gtk.accelerator_parse} but handles keycodes as * well. This is only useful for system-level components, applications should * use {@link 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 * @param display the {@link Gdk.Display} to look up `accelerator_codes` in * @returns true if parsing succeeded */ function accelerator_parse_with_keycode(accelerator: string, display: Gdk.Display | null): [boolean, number, number[] | null, Gdk.ModifierType | null]; /** * Determines whether a given keyval and modifier mask constitute * a valid keyboard accelerator. * * For example, the `GDK_KEY_a` keyval plus `GDK_CONTROL_MASK` mask is valid, * and matches the “Ctrl+a” accelerator. But, you can't, for instance, use * the `GDK_KEY_Control_L` keyval as an accelerator. * @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; /** * Initializes `value` with the appropriate type for the `property`. * * This function is mostly meant for language bindings, in conjunction * with `gtk_accessible_update_property_value()`. * @param property a {@link Gtk.AccessibleProperty} * @param value an uninitialized {@link GObject.Value} */ function accessible_property_init_value(property: AccessibleProperty, value: GObject.Value | any): void; /** * Initializes `value` with the appropriate type for the `relation`. * * This function is mostly meant for language bindings, in conjunction * with `gtk_accessible_update_relation_value()`. * @param relation a {@link Gtk.AccessibleRelation} * @param value an uninitialized {@link GObject.Value} */ function accessible_relation_init_value(relation: AccessibleRelation, value: GObject.Value | any): void; /** * Initializes `value` with the appropriate type for the `state`. * * This function is mostly meant for language bindings, in conjunction * with `gtk_accessible_update_relation_state()`. * @param state a {@link Gtk.AccessibleState} * @param value an uninitialized {@link GObject.Value} */ function accessible_state_init_value(state: AccessibleState, value: GObject.Value | any): void; /** * Initializes `iter` to point to `target`. * * If `target` is not found, finds the next value after it. * If no value >= `target` exists in `set`, this function returns `false`. * @param set a {@link Gtk.Bitset} * @param target target value to start iterating at * @returns `true` if a value was found. */ function bitset_iter_init_at(set: Bitset, target: number): [boolean, BitsetIter, number]; /** * Initializes an iterator for `set` and points it to the first * value in `set`. * * If `set` is empty, `false` is returned and `value` is set to `G_MAXUINT`. * @param set a {@link Gtk.Bitset} * @returns `true` if `set` isn't empty. */ function bitset_iter_init_first(set: Bitset): [boolean, BitsetIter, number]; /** * Initializes an iterator for `set` and points it to the last * value in `set`. * * If `set` is empty, `false` is returned. * @param set a {@link Gtk.Bitset} * @returns `true` if `set` isn't empty. */ function bitset_iter_init_last(set: Bitset): [boolean, BitsetIter, number]; /** * Registers an error quark for {@link Gtk.Builder} errors. * @returns the error quark */ function builder_error_quark(): GLib.Quark; /** * Checks that the GTK library in use is compatible with the * given version. * * Generally you would pass in the constants `GTK_MAJOR_VERSION`, * `GTK_MINOR_VERSION`, `GTK_MICRO_VERSION` as the three arguments * to this function; that produces a check that the library in * use is compatible with the version of GTK the application or * module was compiled against. * * Compatibility is defined by two things: first the version * of the running library is newer than the version * `required_major`.required_minor.`required_micro`. Second * the running library must be binary compatible with the * version `required_major`.required_minor.`required_micro` * (same major version.) * * This function is primarily for GTK modules; the module * can call this function to check that it wasn’t loaded * into an incompatible version of GTK. However, such a * check isn’t completely reliable, since the module may be * linked against an old version of GTK and calling the * old version of `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; /** * Registers an error quark for VFL error parsing. * @returns the error quark */ function constraint_vfl_parser_error_quark(): GLib.Quark; /** * Registers an error quark for CSS parsing errors. * @returns the error quark */ function css_parser_error_quark(): GLib.Quark; /** * Registers an error quark for CSS parsing warnings. * @returns the warning quark */ function css_parser_warning_quark(): GLib.Quark; /** * Registers an error quark for an operation that requires a dialog if * necessary. * @returns the error quark */ function dialog_error_quark(): GLib.Quark; /** * Prevents GTK from using the specified portals. * * This should only be used in portal implementations, apps must not call it. * @param portal_interfaces a `null`-terminated array of portal interface names to disable * @since 4.22 */ function disable_portal_interfaces(portal_interfaces: string[]): void; /** * Prevents GTK from using portals. * * This is equivalent to setting `GDK_DEBUG=no-portals` in the environment. * * This should only be used in portal implementations, apps must not call it. * @since 4.18 */ function disable_portals(): void; /** * Prevents {@link Gtk.init} and {@link Gtk.init_check} from calling `setlocale()`. * * You would want to use this function if you wanted to set the locale for * your program to something other than the user’s locale, or if you wanted * to set different values for different locale categories. * * Most programs should not need to call this function. */ 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 * {@link Gtk.RequestedSize} 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 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, sizes: RequestedSize[]): number; /** * Gets a property of the {@link Gtk.Editable} delegate for `object`. * * This is helper function that should be called in the `get_property` * function of your {@link Gtk.Editable} implementation, before handling your * own properties. * @param object a {@link GObject.Object} * @param prop_id a property ID * @param value value to set * @param pspec the {@link GObject.ParamSpec} for the property * @returns `true` if the property was found */ function editable_delegate_get_property(object: GObject.Object, prop_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): boolean; /** * Sets a property on the {@link Gtk.Editable} delegate for `object`. * * This is a helper function that should be called in the `set_property` * function of your {@link Gtk.Editable} implementation, before handling your * own properties. * @param object a {@link GObject.Object} * @param prop_id a property ID * @param value value to set * @param pspec the {@link GObject.ParamSpec} for the property * @returns `true` if the property was found */ function editable_delegate_set_property(object: GObject.Object, prop_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): boolean; /** * Overrides the {@link Gtk.Editable} properties for `class`. * * This is a helper function that should be called in class_init, * after installing your own properties. * * Note that your class must have "text", "cursor-position", * "selection-bound", "editable", "width-chars", "max-width-chars", * "xalign" and "enable-undo" properties for this function to work. * * To handle the properties in your set_property and get_property * functions, you can either use {@link Gtk.Editable.delegate_set_property} * and {@link Gtk.Editable.delegate_get_property} (if you are using * a delegate), or remember the `first_prop` offset and add it to the * values in the {@link Gtk.EditableProperties} enumeration to get the * property IDs for these properties. * @param object_class a {@link GObject.ObjectClass} * @param first_prop property ID to use for the first property * @returns the number of properties that were installed */ function editable_install_properties(object_class: typeof GObject.Object, first_prop: number): number; /** * Calls a function for all printers that are known to GTK. * * If `func` returns true, the enumeration is stopped. * @param func a function to call for each printer * @param wait if true, wait in a recursive mainloop until all printers are enumerated; otherwise return early */ function enumerate_printers(func: PrinterFunc, wait: boolean): void; /** * Registers an error quark for {@link Gtk.FileChooser} errors. * @returns The error quark used for {@link Gtk.FileChooser} errors. */ function file_chooser_error_quark(): GLib.Quark; /** * Returns the binary age as passed to `libtool`. * * If `libtool` means nothing to you, don't worry about it. * @returns the binary age of the GTK library */ function get_binary_age(): number; /** * Returns the GTK debug flags that are currently active. * * This function is intended for GTK modules that want * to adjust their debug output based on GTK debug flags. * @returns the GTK debug flags. */ function get_debug_flags(): DebugFlags; /** * 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 {@link Pango.Language.get_default}. * See that function for details. * @returns the default language */ function get_default_language(): Pango.Language; /** * Returns the interface age as passed to `libtool`. * * If `libtool` means nothing to you, don't worry about it. * @returns the interface age of the GTK library */ function get_interface_age(): number; /** * Gets the direction of the current locale. * * This is the expected reading direction for text and UI. * * This function depends on the current locale being set with * `setlocale()` and will default to setting the `GTK_TEXT_DIR_LTR` * direction otherwise. `GTK_TEXT_DIR_NONE` will never be returned. * * GTK sets the default text direction according to the locale during * {@link Gtk.init}, and you should normally use {@link Gtk.Widget.get_direction} * or {@link Gtk.Widget.get_default_direction} to obtain the current direction. * * This function is only needed rare cases when the locale is * changed after GTK has already been initialized. In this case, * you can use it to update the default text direction as follows: * * ```c * #include * * static void * update_locale (const char *new_locale) * { * setlocale (LC_ALL, new_locale); * gtk_widget_set_default_direction (gtk_get_locale_direction ()); * } * ``` * @returns the direction of the current locale */ function get_locale_direction(): TextDirection; /** * Returns the major version number of the GTK library. * * For example, in GTK version 3.1.5 this is 3. * * This function is in the library, so it represents the GTK library * your code is running against. Contrast with the `GTK_MAJOR_VERSION` * macro, which represents the major version of the GTK headers you * have included when compiling your code. * @returns the major version number of the GTK library */ function get_major_version(): number; /** * Returns the micro version number of the GTK library. * * For example, in GTK version 3.1.5 this is 5. * * This function is in the library, so it represents the GTK library * your code is are running against. Contrast with the * `GTK_MICRO_VERSION` macro, which represents the micro version of the * GTK headers you have included when compiling your code. * @returns the micro version number of the GTK library */ function get_micro_version(): number; /** * Returns the minor version number of the GTK library. * * For example, in GTK version 3.1.5 this is 1. * * This function is in the library, so it represents the GTK library * your code is are running against. Contrast with the * `GTK_MINOR_VERSION` macro, which represents the minor version of the * GTK headers you have included when compiling your code. * @returns the minor version number of the GTK library */ function get_minor_version(): number; /** * Converts a color from HSV space to RGB. * * Input values must be in the [0.0, 1.0] range; * output values will be in the same range. * @param h Hue * @param s Saturation * @param v Value */ function hsv_to_rgb(h: number, s: number, v: number): [number, number, number]; /** * Registers an error quark for {@link Gtk.IconTheme} errors. * @returns the error quark */ function icon_theme_error_quark(): GLib.Quark; /** * Initializes GTK. * * This function must be called before using any other GTK functions * in your GUI applications. * * It will initialize everything needed to operate the toolkit. In particular, * it will open the default display (see {@link Gdk.Display.get_default}). * * If you are using {@link Gtk.Application}, you usually don't have to call this * function; the {@link Gio.Application.startup} handler does it for you. Though, * if you are using {@link Gio.Application} methods that will be invoked before `startup`, * such as `local_command_line`, you may need to initialize GTK explicitly. * * This function will terminate your program if it was unable to initialize * the windowing system for some reason. If you want your program to fall back * to a textual interface, call {@link Gtk.init_check} instead. * * GTK calls `signal (SIGPIPE, SIG_IGN)` during initialization, to ignore * SIGPIPE signals, since these are almost never wanted in graphical * applications. If you do need to handle SIGPIPE for some reason, reset * the handler after `gtk_init()`, but notice that other libraries (e.g. * libdbus or gvfs) might do similar things. */ function init(): void; /** * Initializes GTK. * * This function does the same work as {@link Gtk.init} with only a * single change: It does not terminate the program if the windowing * system can’t be initialized. Instead it returns false on failure. * * This way the application can fall back to some other means of * communication with the user - for example a curses or command line * interface. * @returns true if the windowing system has been successfully initialized, false otherwise */ function init_check(): boolean; /** * Returns whether GTK has been initialized. * * See {@link Gtk.init}. * @returns the initialization status */ function is_initialized(): boolean; /** * Finds the {@link Gtk.Native} associated with the surface. * @param surface a {@link Gdk.Surface} * @returns the {@link Gtk.Native} that is associated with `surface` */ function native_get_for_surface(surface: Gdk.Surface): Native | null; /** * 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. */ 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 */ function paper_size_get_paper_sizes(include_custom: boolean): PaperSize[]; /** * Creates a new {@link GObject.ParamSpec} instance for a property holding a {@link Gtk.Expression}. * * See `g_param_spec_internal()` for details on the property strings. * @param name canonical name of the property * @param nick a user-readable name for the property * @param blurb a user-readable description of the property * @param flags flags for the property * @returns a newly created property specification */ function param_spec_expression(name: string, nick: string, blurb: string, flags: GObject.ParamFlags): GObject.ParamSpec; /** * Registers an error quark for {@link Gtk.PrintOperation} if necessary. * @returns The error quark used for {@link Gtk.PrintOperation} errors. */ 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 {@link 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} */ 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 {@link 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 * @param page_setup an existing {@link Gtk.PageSetup} * @param settings a {@link Gtk.PrintSettings} * @param done_cb a function to call when the user saves the modified page setup */ function print_run_page_setup_dialog_async(parent: Window | null, page_setup: PageSetup | null, settings: PrintSettings, done_cb: PageSetupDoneFunc): void; /** * Registers an error quark for {@link RecentManager} errors. * @returns the error 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 `cairo_t` * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @deprecated since 4.10 */ 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 `cairo_t` * @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 * @deprecated since 4.10 */ 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 `cairo_t` * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @deprecated since 4.10 */ function render_background(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * 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 `cairo_t` * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @deprecated since 4.10 */ 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 `cairo_t` * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @deprecated since 4.10 */ function render_expander(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): 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 `cairo_t` * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @deprecated since 4.10 */ 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 `cairo_t` * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @deprecated since 4.10 */ function render_frame(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders a handle (as in {@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 `cairo_t` * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @deprecated since 4.10 */ function render_handle(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): void; /** * Renders the icon in `texture` at the specified `x` and `y` coordinates. * * This function will render the icon in `texture` at exactly its size, * regardless of scaling factors, which may not be appropriate when * drawing on displays with high pixel densities. * @param context a {@link Gtk.StyleContext} * @param cr a `cairo_t` * @param texture a {@link Gdk.Texture} containing the icon to draw * @param x X position for the `texture` * @param y Y position for the `texture` * @deprecated since 4.10 */ function render_icon(context: StyleContext, cr: cairo.Context, texture: Gdk.Texture, x: number, y: number): void; /** * Renders `layout` on the coordinates `x`, `y` * @param context a {@link Gtk.StyleContext} * @param cr a `cairo_t` * @param x X origin * @param y Y origin * @param layout the {@link Pango.Layout} to render * @deprecated since 4.10 */ 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 `cairo_t` * @param x0 X coordinate for the origin of the line * @param y0 Y coordinate for the origin of the line * @param x1 X coordinate for the end of the line * @param y1 Y coordinate for the end of the line * @deprecated since 4.10 */ function render_line(context: StyleContext, cr: cairo.Context, x0: number, y0: number, x1: number, y1: number): void; /** * Renders an option mark (as in a radio button), 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 `cairo_t` * @param x X origin of the rectangle * @param y Y origin of the rectangle * @param width rectangle width * @param height rectangle height * @deprecated since 4.10 */ function render_option(context: StyleContext, cr: cairo.Context, x: number, y: number, width: number, height: number): 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 */ function rgb_to_hsv(r: number, g: number, b: number): [number, number, number]; /** * Sets the GTK debug flags. * @param flags the debug flags to set */ function set_debug_flags(flags: DebugFlags): void; /** * This function launches the default application for showing * a given uri, or shows an error dialog if that fails. * @param parent parent window * @param uri the uri to show * @param timestamp timestamp from the event that triggered this call, or `GDK_CURRENT_TIME` * @deprecated since 4.10: Use {@link Gtk.FileLauncher.launch} or {@link Gtk.UriLauncher.launch} instead */ function show_uri(parent: Window | null, uri: string, timestamp: number): void; /** * This function launches the default application for showing * a given uri. * * The `callback` will be called when the launch is completed. * * This is the recommended call to be used as it passes information * necessary for sandbox helpers to parent their dialogs properly. * @param parent parent window * @param uri the uri to show * @param timestamp timestamp from the event that triggered this call, or `GDK_CURRENT_TIME` * @param cancellable a {@link Gio.Cancellable} to cancel the launch * @deprecated since 4.10: Use {@link Gtk.FileLauncher.launch} or {@link Gtk.UriLauncher.launch} instead */ function show_uri_full(parent: Window | null, uri: string, timestamp: number, cancellable: Gio.Cancellable | null): globalThis.Promise; /** * This function launches the default application for showing * a given uri. * * The `callback` will be called when the launch is completed. * * This is the recommended call to be used as it passes information * necessary for sandbox helpers to parent their dialogs properly. * @param parent parent window * @param uri the uri to show * @param timestamp timestamp from the event that triggered this call, or `GDK_CURRENT_TIME` * @param cancellable a {@link Gio.Cancellable} to cancel the launch * @param callback a callback to call when the action is complete * @deprecated since 4.10: Use {@link Gtk.FileLauncher.launch} or {@link Gtk.UriLauncher.launch} instead */ function show_uri_full(parent: Window | null, uri: string, timestamp: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void; /** * This function launches the default application for showing * a given uri. * * The `callback` will be called when the launch is completed. * * This is the recommended call to be used as it passes information * necessary for sandbox helpers to parent their dialogs properly. * @param parent parent window * @param uri the uri to show * @param timestamp timestamp from the event that triggered this call, or `GDK_CURRENT_TIME` * @param cancellable a {@link Gio.Cancellable} to cancel the launch * @param callback a callback to call when the action is complete * @deprecated since 4.10: Use {@link Gtk.FileLauncher.launch} or {@link Gtk.UriLauncher.launch} instead */ function show_uri_full(parent: Window | null, uri: string, timestamp: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): globalThis.Promise | void; /** * Finishes the `gtk_show_uri()` call and returns the result * of the operation. * @param parent the {@link Gtk.Window} passed to `gtk_show_uri()` * @param result {@link Gio.AsyncResult} that was passed to `callback` * @returns `true` if the URI was shown successfully. Otherwise, `false` is returned and `error` is set * @deprecated since 4.10: Use {@link Gtk.FileLauncher.launch} or {@link Gtk.UriLauncher.launch} instead */ function show_uri_full_finish(parent: Window, result: Gio.AsyncResult): boolean; /** * Returns context information about what XML attribute * the parsing error occurred in. * @param error an error in the {@link Gtk.SvgError} domain * @returns the attribute name * @since 4.22 */ function svg_error_get_attribute(error: GLib.Error): string | null; /** * Returns context information about what XML element * the parsing error occurred in. * @param error an error in the {@link Gtk.SvgError} domain * @returns the element name * @since 4.22 */ function svg_error_get_element(error: GLib.Error): string | null; /** * Returns context information about the end position * in the document where the parsing error occurred. * @param error an error in the {@link Gtk.SvgError} domain * @returns the {@link Gtk.SvgLocation} * @since 4.22 */ function svg_error_get_end(error: GLib.Error): SvgLocation | null; /** * Returns context information about the start position * in the document where the parsing error occurred. * @param error an error in the {@link Gtk.SvgError} domain * @returns the {@link Gtk.SvgLocation} * @since 4.22 */ function svg_error_get_start(error: GLib.Error): SvgLocation | null; function svg_error_quark(): GLib.Quark; /** * Prints an assertion message for `gtk_test_accessible_assert_role()`. * @param domain a domain * @param file a file name * @param line the line in `file` * @param func a function name in `file` * @param expr the expression being tested * @param accessible a {@link Gtk.Accessible} * @param expected_role the expected {@link Gtk.AccessibleRole} * @param actual_role the actual {@link Gtk.AccessibleRole} */ function test_accessible_assertion_message_role(domain: string, file: string, line: number, func: string, expr: string, accessible: Accessible, expected_role: AccessibleRole, actual_role: AccessibleRole): void; /** * Checks whether the {@link Gtk.Accessible} has `property` set. * @param accessible a {@link Gtk.Accessible} * @param property a {@link Gtk.AccessibleProperty} * @returns `true` if the `property` is set in the `accessible` */ function test_accessible_has_property(accessible: Accessible, property: AccessibleProperty): boolean; /** * Checks whether the {@link Gtk.Accessible} has `relation` set. * @param accessible a {@link Gtk.Accessible} * @param relation a {@link Gtk.AccessibleRelation} * @returns `true` if the `relation` is set in the `accessible` */ function test_accessible_has_relation(accessible: Accessible, relation: AccessibleRelation): boolean; /** * Checks whether the {@link Gtk.Accessible.accessible_role} of the accessible * is `role`. * @param accessible a {@link Gtk.Accessible} * @param role a {@link Gtk.AccessibleRole} * @returns `true` if the role matches */ function test_accessible_has_role(accessible: Accessible, role: AccessibleRole): boolean; /** * Checks whether the {@link Gtk.Accessible} has `state` set. * @param accessible a {@link Gtk.Accessible} * @param state a {@link Gtk.AccessibleState} * @returns `true` if the `state` is set in the `accessible` */ function test_accessible_has_state(accessible: Accessible, state: AccessibleState): boolean; /** * Return the type ids that have been registered after * calling `gtk_test_register_all_types()`. * @returns 0-terminated array of type ids */ function test_list_all_types(): GObject.GType[]; /** * Force registration of all core GTK object types. * * This allows to refer to any of those object types via * `g_type_from_name()` after calling this function. */ function test_register_all_types(): void; /** * 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 */ function test_widget_wait_for_draw(widget: Widget): void; /** * Creates a content provider for dragging `path` from `tree_model`. * @param tree_model a {@link Gtk.TreeModel} * @param path a row in `tree_model` * @returns a new {@link Gdk.ContentProvider} * @deprecated since 4.10: Use list models instead */ function tree_create_row_drag_content(tree_model: TreeModel, path: TreePath): Gdk.ContentProvider; /** * Obtains a `tree_model` and `path` from value of target type * `GTK_TYPE_TREE_ROW_DATA`. * * The returned path must be freed with `gtk_tree_path_free()`. * @param value a {@link GObject.Value} * @returns `true` if `selection_data` had target type `GTK_TYPE_TREE_ROW_DATA` is otherwise valid * @deprecated since 4.10: Use list models instead */ function tree_get_row_drag_data(value: GObject.Value | any): [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 ::row-deleted signal. * @param proxy a {@link GObject.Object} * @param path the path position that was deleted * @deprecated since 4.10 */ 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 ::row-inserted signal. * @param proxy a {@link GObject.Object} * @param path the row position that was inserted * @deprecated since 4.10 */ function tree_row_reference_inserted(proxy: GObject.Object, path: TreePath): void; /** * Retrieves the {@link Gtk.Expression} stored inside the given `value`, and acquires * a reference to it. * @param value a {@link GObject.Value} initialized with type `GTK_TYPE_EXPRESSION` * @returns a {@link Gtk.Expression} */ function value_dup_expression(value: GObject.Value | any): Expression | null; /** * Retrieves the {@link Gtk.Expression} stored inside the given `value`. * @param value a {@link GObject.Value} initialized with type `GTK_TYPE_EXPRESSION` * @returns a {@link Gtk.Expression} */ function value_get_expression(value: GObject.Value | any): Expression | null; /** * Stores the given {@link Gtk.Expression} inside `value`. * * The {@link GObject.Value} will acquire a reference to the `expression`. * @param value a {@link GObject.Value} initialized with type `GTK_TYPE_EXPRESSION` * @param expression a {@link Gtk.Expression} */ function value_set_expression(value: GObject.Value | any, expression: Expression): void; /** * Stores the given {@link Gtk.Expression} inside `value`. * * This function transfers the ownership of the `expression` to the {@link GObject.Value}. * @param value a {@link GObject.Value} initialized with type `GTK_TYPE_EXPRESSION` * @param expression a {@link Gtk.Expression} */ function value_take_expression(value: GObject.Value | any, expression: Expression | null): void; /** * @gir-type Callback */ interface AssistantPageFunc { (current_page: number): number; } /** * @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 CustomAllocateFunc { (widget: Widget, width: number, height: number, baseline: number): void; } /** * @gir-type Callback */ interface CustomFilterFunc { (item: A): boolean; } /** * @gir-type Callback */ interface CustomMeasureFunc { (widget: Widget, orientation: Orientation, for_size: number): void; } /** * @gir-type Callback */ interface CustomRequestModeFunc { (widget: Widget): SizeRequestMode; } /** * @gir-type Callback */ interface DrawingAreaDrawFunc { (drawing_area: DrawingArea, cr: cairo.Context, width: number, height: number): void; } /** * @gir-type Callback */ interface EntryCompletionMatchFunc { (completion: EntryCompletion, key: string, iter: TreeIter): boolean; } /** * @gir-type Callback */ interface ExpressionNotify { (user_data: null): void; } /** * @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 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 MapListModelMapFunc { (item: A): GObject.Object; } /** * @gir-type Callback */ interface MenuButtonCreatePopupFunc { (menu_button: MenuButton): void; } /** * @gir-type Callback */ interface PageSetupDoneFunc { (page_setup: PageSetup): void; } /** * @gir-type Callback */ interface PrintJobCompleteFunc { (print_job: PrintJob, error: GLib.Error): void; } /** * @gir-type Callback */ interface PrintSettingsFunc { (key: string, value: string): void; } /** * @gir-type Callback */ interface PrinterFunc { (printer: Printer): boolean; } /** * @gir-type Callback */ interface ScaleFormatValueFunc { (scale: Scale, value: number): string; } /** * @gir-type Callback */ interface ShortcutFunc { (widget: Widget, args: GLib.Variant | null): boolean; } /** * @gir-type Callback */ interface TextBufferCommitNotify { (buffer: TextBuffer, flags: TextBufferNotifyFlags, position: number, length: number): void; } /** * @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 TreeCellDataFunc { (tree_column: TreeViewColumn, cell: CellRenderer, tree_model: TreeModel, iter: TreeIter): void; } /** * @gir-type Callback */ interface TreeIterCompareFunc { (model: TreeModel, a: TreeIter, b: TreeIter): number; } /** * @gir-type Callback */ interface TreeListModelCreateModelFunc { (item: A): Gio.ListModel | null; } /** * @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 WidgetActionActivateFunc { (widget: Widget, action_name: string, parameter: GLib.Variant | null): void; } /** * @gir-type Alias */ type TreeRowData = object | null; /** * @gir-type Flags */ export namespace ApplicationInhibitFlags { export const $gtype: GObject.GType; } /** * Types of user actions that may be blocked by {@link Gtk.Application}. * * See {@link Gtk.Application.inhibit}. * @gir-type Flags */ 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 BuilderClosureFlags { export const $gtype: GObject.GType; } /** * The list of flags that can be passed to `gtk_builder_create_closure()`. * * New values may be added in the future for new features, so external * implementations of {@link Gtk.BuilderScope} should test the flags * for unknown values and raise a {@link Gtk.BuilderError.INVALID_ATTRIBUTE} error * when they encounter one. * @gir-type Flags */ enum BuilderClosureFlags { /** * The closure should be created swapped. See * `g_cclosure_new_swap()` for details. */ SWAPPED, } /** * @gir-type Flags */ export namespace CellRendererState { export const $gtype: GObject.GType; } /** * Tells how a cell is to be rendered. * @gir-type Flags * @deprecated since 4.20: There is no replacement. */ 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 */ EXPANDABLE, /** * The cell is in a row that is expanded */ EXPANDED, } /** * @gir-type Flags */ export namespace DebugFlags { export const $gtype: GObject.GType; } /** * Flags to use with `gtk_set_debug_flags()`. * * Settings these flags causes GTK to print out different * types of debugging information. Some of these flags are * only available when GTK has been configured with `-Ddebug=true`. * @gir-type Flags */ enum DebugFlags { /** * Information about GtkTextView */ TEXT, /** * Information about GtkTreeView */ TREE, /** * Information about keyboard shortcuts */ KEYBINDINGS, /** * Information about modules and extensions */ MODULES, /** * Information about size allocation */ GEOMETRY, /** * Information about icon themes */ ICONTHEME, /** * Information about printing */ PRINTING, /** * Trace GtkBuilder operation */ BUILDER_TRACE, /** * Information about size requests */ SIZE_REQUEST, /** * Disable the style property cache */ NO_CSS_CACHE, /** * Open the GTK inspector */ INTERACTIVE, /** * Show touch UI elements for pointer events. */ TOUCHSCREEN, /** * Information about actions and menu models */ ACTIONS, /** * Information from layout managers */ LAYOUT, /** * Include debug render nodes in the generated snapshots */ SNAPSHOT, /** * Information from the constraints solver */ CONSTRAINTS, /** * Log unused GtkBuilder objects */ BUILDER_OBJECTS, /** * Information about accessibility state changes */ A11Y, /** * Information about icon fallback. */ ICONFALLBACK, /** * Inverts the default text-direction. */ INVERT_TEXT_DIR, /** * Information about deprecated CSS features. */ CSS, /** * Information about deprecated GtkBuilder features. */ BUILDER, /** * Information about session saving. */ SESSION, } /** * @gir-type Flags */ export namespace DialogFlags { export const $gtype: GObject.GType; } /** * Flags used to influence dialog construction. * @gir-type Flags * @deprecated since 4.20: There is no replacement. */ enum DialogFlags { /** * Make the constructed dialog modal */ MODAL, /** * Destroy the dialog when its parent is destroyed */ DESTROY_WITH_PARENT, /** * Create dialog with actions in header * bar instead of action area */ 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 */ 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 ::decelerate after continuous scroll finishes. */ KINETIC, /** * A {@link Gtk.EventControllerScrollFlags} value to prefer physical direction over * logical direction (i.e. oblivious to natural scroll). */ PHYSICAL_DIRECTION, /** * Emit scroll on both axes. */ BOTH_AXES, } /** * @gir-type Flags */ export namespace FontChooserLevel { export const $gtype: GObject.GType; } /** * Specifies the granularity of font selection * that is desired in a {@link Gtk.FontChooser}. * * This enumeration may be extended in the future; applications should * ignore unknown values. * @gir-type Flags * @deprecated since 4.20: There is no replacement. */ enum FontChooserLevel { /** * Allow selecting a font family */ FAMILY, /** * Allow selecting a specific font face */ STYLE, /** * Allow selecting a specific font size */ SIZE, /** * Allow changing OpenType font variation axes */ 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 { /** * Perform a regular lookup. */ NONE, /** * Try to always load regular icons, even * when symbolic icon names are given */ FORCE_REGULAR, /** * Try to always load symbolic icons, even * when regular icon names are given */ FORCE_SYMBOLIC, /** * Starts loading the texture in the background * so it is ready when later needed. */ PRELOAD, } /** * @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 InputPurpose} of the entry. * * Some common sense is expected when using these flags - mixing * {@link Gtk.InputHints.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 */ 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 */ VERTICAL_WRITING, /** * Suggest offering Emoji support */ EMOJI, /** * Suggest not offering Emoji support */ NO_EMOJI, /** * Request that the input method should not * update personalized data (like typing history) */ PRIVATE, } /** * @gir-type Flags */ export namespace ListScrollFlags { export const $gtype: GObject.GType; } /** * List of actions to perform when scrolling to items in * a list widget. * @gir-type Flags * @since 4.12 */ enum ListScrollFlags { /** * Don't do anything extra */ NONE, /** * Focus the target item */ FOCUS, /** * Select the target item and * unselect all other items. */ SELECT, } /** * @gir-type Flags */ export namespace PickFlags { export const $gtype: GObject.GType; } /** * Flags that influence the behavior of {@link Widget.pick}. * @gir-type Flags */ enum PickFlags { /** * The default behavior, include widgets that are receiving events */ DEFAULT, /** * Include widgets that are insensitive */ INSENSITIVE, /** * Include widgets that are marked as non-targetable. See {@link Widget.can_target} */ NON_TARGETABLE, } /** * @gir-type Flags */ export namespace PopoverMenuFlags { export const $gtype: GObject.GType; } /** * Flags that affect how {@link Gtk.PopoverMenu} widgets built from * a {@link Gio.MenuModel} are created and displayed. * @gir-type Flags */ enum PopoverMenuFlags { /** * Submenus are presented as sliding submenus that replace the main menu. */ SLIDING, /** * Submenus are presented as traditional, nested * popovers. */ NESTED, } /** * @gir-type Flags */ export namespace PrintCapabilities { export const $gtype: GObject.GType; } /** * Specifies which features the print dialog should offer. * * If neither {@link Gtk.PrintCapabilities.GENERATE_PDF} nor * {@link Gtk.PrintCapabilities.GENERATE_PS} is specified, GTK assumes that all * formats are supported. * @gir-type Flags */ enum PrintCapabilities { /** * Print dialog will offer printing even/odd pages. */ PAGE_SET, /** * Print dialog will allow to print multiple copies. */ COPIES, /** * Print dialog will allow to collate multiple copies. */ COLLATE, /** * Print dialog will allow to print pages in reverse order. */ REVERSE, /** * Print dialog will allow to scale the output. */ SCALE, /** * The program will send the document to * the printer in PDF format */ GENERATE_PDF, /** * The program will send the document to * the printer in Postscript format */ GENERATE_PS, /** * Print dialog will offer a preview */ PREVIEW, /** * Print dialog will offer printing multiple * pages per sheet */ NUMBER_UP, /** * Print dialog will allow to rearrange * pages when printing multiple pages per sheet */ NUMBER_UP_LAYOUT, } /** * @gir-type Flags */ export namespace ShortcutActionFlags { export const $gtype: GObject.GType; } /** * Flags that can be passed to action activation. * * More flags may be added in the future. * @gir-type Flags */ enum ShortcutActionFlags { /** * The action is the only * action that can be activated. If this flag is not set, * a future activation may select a different action. */ EXCLUSIVE, } /** * @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 */ DIR_LTR, /** * Widget is in right-to-left text direction */ DIR_RTL, /** * Widget is a link */ LINK, /** * The location the widget points to has already been visited */ VISITED, /** * Widget is checked */ CHECKED, /** * Widget is highlighted as a drop target for DND */ DROP_ACTIVE, /** * Widget has the visible focus */ FOCUS_VISIBLE, /** * Widget contains the keyboard focus */ FOCUS_WITHIN, } /** * @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 { /** * Default value. */ 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, /** * Show information about * what changes affect the styles */ SHOW_CHANGE, } /** * @gir-type Flags */ export namespace SvgFeatures { export const $gtype: GObject.GType; } /** * Features of the SVG renderer that can be enabled or disabled. * * By default, all features except `GTK_SVG_TRADITIONAL_SYMBOLIC` * are enabled. * * New values may be added in the future. * @gir-type Flags * @since 4.22 */ enum SvgFeatures { /** * Whether to run animations. If disabled, * state changes are applied without transitions */ ANIMATIONS, /** * Whether to use system resources, * such as fonts. If disabled, only embedded fonts are used */ SYSTEM_RESOURCES, /** * Whether to load external * resources, such as images. If disabled, only embedded * images are loaded */ EXTERNAL_RESOURCES, /** * Whether to allow gpa extensions, such * as states and transitions */ EXTENSIONS, /** * This feature is meant for * compatibility with old symbolic icons. If this is enabled, * fill and stroke attributes are ignored. The used colors * are derived from symbolic style classes if present, and * the default fill color is the symbolic foreground color. */ TRADITIONAL_SYMBOLIC, } /** * @gir-type Flags */ export namespace TextBufferNotifyFlags { export const $gtype: GObject.GType; } /** * Values for {@link Gtk.TextBufferCommitNotify} to denote the * point of the notification. * @gir-type Flags * @since 4.16 */ enum TextBufferNotifyFlags { /** * Be notified before text * is inserted into the underlying buffer. */ BEFORE_INSERT, /** * Be notified after text * has been inserted into the underlying buffer. */ AFTER_INSERT, /** * Be notified before text * is deleted from the underlying buffer. */ BEFORE_DELETE, /** * Be notified after text * has been deleted from the underlying buffer. */ AFTER_DELETE, } /** * @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 paintables 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 paintables 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 TreeModelFlags { export const $gtype: GObject.GType; } /** * These flags indicate various properties of a {@link Gtk.TreeModel}. * * They are returned by {@link Gtk.TreeModel.get_flags}, and must be * static for the lifetime of the object. A more complete description * of {@link Gtk.TreeModelFlags.ITERS_PERSIST} can be found in the overview of * this section. * @gir-type Flags * @deprecated since 4.10: There is no replacement */ enum TreeModelFlags { /** * iterators survive all signals * emitted by the tree */ ITERS_PERSIST, /** * the model is a list only, and never * has children */ LIST_ONLY, } namespace ATContext { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { /** * Emitted when the attributes of the accessible for the * {@link Gtk.ATContext} instance change. * @signal * @run-first */ "state-change": () => void; "notify::accessible": (pspec: GObject.ParamSpec) => void; "notify::accessible-role": (pspec: GObject.ParamSpec) => void; "notify::display": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { accessible: Accessible; accessible_role: AccessibleRole; accessibleRole: AccessibleRole; display: Gdk.Display; } } /** * Communicates with platform-specific assistive technologies API. * * Each platform supported by GTK implements a {@link Gtk.ATContext} subclass, and * is responsible for updating the accessible state in response to state * changes in {@link Gtk.Accessible}. * @gir-type Class */ abstract class ATContext extends GObject.Object { static $gtype: GObject.GType; // Properties /** * The {@link Gtk.Accessible} that created the {@link Gtk.ATContext} instance. * @construct-only */ get accessible(): Accessible; /** * The accessible role used by the AT context. * * Depending on the given role, different states and properties can be * set or retrieved. * @default Gtk.AccessibleRole.NONE */ get accessible_role(): AccessibleRole; set accessible_role(val: AccessibleRole); /** * The accessible role used by the AT context. * * Depending on the given role, different states and properties can be * set or retrieved. * @default Gtk.AccessibleRole.NONE */ get accessibleRole(): AccessibleRole; set accessibleRole(val: AccessibleRole); /** * The {@link Gdk.Display} for the {@link Gtk.ATContext}. */ get display(): Gdk.Display; set display(val: Gdk.Display); /** * 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: ATContext.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static create(accessible_role: AccessibleRole, accessible: Accessible, display: Gdk.Display): ATContext; // 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 {@link Gtk.Accessible} using this context. * @returns a {@link Gtk.Accessible} */ get_accessible(): Accessible; /** * Retrieves the accessible role of this context. * @returns a {@link Gtk.AccessibleRole} */ get_accessible_role(): AccessibleRole; } namespace AboutDialog { // Signal signatures interface SignalSignatures extends Window.SignalSignatures { /** * Emitted every time a URL is activated. * * Applications may connect to it to override the default behaviour, * which is to call {@link Gtk.FileLauncher.launch}. * @signal * @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::system-information": (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::application": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::decorated": (pspec: GObject.ParamSpec) => void; "notify::default-height": (pspec: GObject.ParamSpec) => void; "notify::default-widget": (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::display": (pspec: GObject.ParamSpec) => void; "notify::focus-visible": (pspec: GObject.ParamSpec) => void; "notify::focus-widget": (pspec: GObject.ParamSpec) => void; "notify::fullscreened": (pspec: GObject.ParamSpec) => void; "notify::gravity": (pspec: GObject.ParamSpec) => void; "notify::handle-menubar-accel": (pspec: GObject.ParamSpec) => void; "notify::hide-on-close": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-active": (pspec: GObject.ParamSpec) => void; "notify::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::startup-id": (pspec: GObject.ParamSpec) => void; "notify::suspended": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; "notify::titlebar": (pspec: GObject.ParamSpec) => void; "notify::transient-for": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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; } // Constructor properties interface interface ConstructorProps extends Window.ConstructorProps, Accessible.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps, Native.ConstructorProps, Root.ConstructorProps, ShortcutManager.ConstructorProps { artists: string[]; authors: string[]; comments: string | null; copyright: string | null; documenters: string[]; license: string | null; license_type: License; licenseType: License; logo: Gdk.Paintable | null; logo_icon_name: string | null; logoIconName: string | null; program_name: string | null; programName: string | null; system_information: string | null; systemInformation: string | null; translator_credits: string | null; translatorCredits: string | null; version: string | null; website: string | null; website_label: string | null; websiteLabel: string | null; wrap_license: boolean; wrapLicense: boolean; } } /** * Displays information about a program. * * The shown information includes the programs' 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. * * * * An example GtkAboutDialog * * * About dialogs often contain links and email addresses. {@link Gtk.AboutDialog} * displays these as clickable links. By default, it calls {@link Gtk.FileLauncher.launch} * when a user clicks one. The behaviour can be overridden with the * `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 https://www.gtk.org`. * * To make constructing an about dialog as convenient as possible, you can * use the function {@link 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 an about dialog, * as shown in the following example: * * ```c * GFile *logo_file = g_file_new_for_path ("./logo.png"); * GdkTexture *example_logo = gdk_texture_new_from_file (logo_file, NULL); * g_object_unref (logo_file); * * gtk_show_about_dialog (NULL, * "program-name", "ExampleCode", * "logo", example_logo, * "title", _("About ExampleCode"), * NULL); * ``` * * ## Shortcuts and Gestures * * {@link Gtk.AboutDialog} supports the following keyboard shortcuts: * * - Escape closes the window. * * ## CSS nodes * * {@link Gtk.AboutDialog} has a single CSS node with the name `window` and style * class `.aboutdialog`. * @gir-type Class */ class AboutDialog extends Window implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager { static $gtype: GObject.GType; // Properties /** * The people who contributed artwork to the program. * * Each string may contain email addresses and URLs, which will be displayed * as links. */ get artists(): string[]; set artists(val: string[]); /** * The authors of the program. * * Each string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. */ 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. * @default null */ get comments(): string | null; set comments(val: string | null); /** * Copyright information for the program. * @default null */ get copyright(): string | null; set copyright(val: string | null); /** * The people documenting the program. * * Each string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. */ get documenters(): string[]; set documenters(val: string[]); /** * The license of the program, as free-form text. * * 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. * * The text may contain links in this format `` * and email references in the form ``, and these will * be converted into clickable links. * @default null */ get license(): string | null; set license(val: string | null); /** * The license of the program. * * 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. * @default Gtk.License.UNKNOWN */ get license_type(): License; set license_type(val: License); /** * The license of the program. * * 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. * @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 * {@link Gtk.Window.set_default_icon_name} will be used. */ get logo(): Gdk.Paintable | null; set logo(val: Gdk.Paintable | null); /** * A named icon to use as the logo for the about box. * * This property overrides the {@link Gtk.AboutDialog.logo} property. * @default null */ get logo_icon_name(): string | null; set logo_icon_name(val: string | null); /** * A named icon to use as the logo for the about box. * * This property overrides the {@link Gtk.AboutDialog.logo} property. * @default null */ get logoIconName(): string | null; set logoIconName(val: string | null); /** * The name of the program. * * If this is not set, it defaults to the value returned by * {@link GLib.get_application_name}. * @default null */ get program_name(): string | null; set program_name(val: string | null); /** * The name of the program. * * If this is not set, it defaults to the value returned by * {@link GLib.get_application_name}. * @default null */ get programName(): string | null; set programName(val: string | null); /** * Information about the system on which the program is running. * * This information is displayed in a separate page, therefore it is fine * to use a long multi-paragraph text. Note that the text should contain * the intended linebreaks. * * The text may contain links in this format `` * and email references in the form ``, and these will * be converted into clickable links. * @default null */ get system_information(): string | null; set system_information(val: string | null); /** * Information about the system on which the program is running. * * This information is displayed in a separate page, therefore it is fine * to use a long multi-paragraph text. Note that the text should contain * the intended linebreaks. * * The text may contain links in this format `` * and email references in the form ``, and these will * be converted into clickable links. * @default null */ get systemInformation(): string | null; set systemInformation(val: string | null); /** * 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. * @default null */ get translator_credits(): string | null; set translator_credits(val: string | null); /** * 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. * @default null */ get translatorCredits(): string | null; set translatorCredits(val: string | null); /** * The version of the program. * @default null */ get version(): string | null; set version(val: string | null); /** * The URL for the link to the website of the program. * * This should be a string starting with `http://` or `https://`. * @default null */ get website(): string | null; set website(val: string | null); /** * The label for the link to the website of the program. * @default null */ get website_label(): string | null; set website_label(val: string | null); /** * The label for the link to the website of the program. * @default null */ get websiteLabel(): string | null; set websiteLabel(val: string | null); /** * Whether to wrap the text in the license dialog. * @default false */ get wrap_license(): boolean; set wrap_license(val: boolean); /** * Whether to wrap the text in the license dialog. * @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; // 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 names of the artists which are displayed * in the credits page. * @returns A `NULL`-terminated string array containing the artists */ get_artists(): string[]; /** * Returns the names of the authors which are displayed * in the credits page. * @returns A `NULL`-terminated string array containing the authors */ get_authors(): string[]; /** * Returns the comments string. * @returns The comments */ get_comments(): string | null; /** * Returns the copyright string. * @returns The copyright string */ get_copyright(): string | null; /** * Returns the name of the documenters which are displayed * in the credits page. * @returns A `NULL`-terminated string array containing the documenters */ get_documenters(): string[]; /** * Returns the license information. * @returns The license information */ get_license(): string | null; /** * Retrieves the license type. * @returns a {@link Gtk.License} value */ get_license_type(): License; /** * Returns the paintable displayed as logo in the about dialog. * @returns the paintable displayed as logo or `NULL` if the logo is unset or has been set via {@link Gtk.AboutDialog.set_logo_icon_name} */ get_logo(): Gdk.Paintable | null; /** * Returns the icon name displayed as logo in the about dialog. * @returns the icon name displayed as logo, or `NULL` if the logo has been set via {@link Gtk.AboutDialog.set_logo} */ get_logo_icon_name(): string | null; /** * Returns the program name displayed in the about dialog. * @returns the program name */ get_program_name(): string | null; /** * Returns the system information that is shown in the about dialog. * @returns the system information */ get_system_information(): string | null; /** * Returns the translator credits string which is displayed * in the credits page. * @returns The translator credits string */ get_translator_credits(): string | null; /** * Returns the version string. * @returns The version string */ get_version(): string | null; /** * Returns the website URL. * @returns The website URL */ get_website(): string | null; /** * Returns the label used for the website link. * @returns The label used for the website link */ get_website_label(): string | null; /** * Returns whether the license text in the about dialog is * automatically wrapped. * @returns `TRUE` if the license text is wrapped */ get_wrap_license(): boolean; /** * Sets the names of the artists to be displayed * in the "Credits" page. * @param artists the authors of the artwork of the application */ set_artists(artists: string[]): void; /** * Sets the names of the authors which are displayed * in the "Credits" page of the about dialog. * @param authors the authors of the application */ 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 names of the documenters which are displayed * in the "Credits" page. * @param documenters the authors of the documentation of the application */ set_documenters(documenters: string[]): void; /** * Sets the license information to be displayed in the * about dialog. * * If `license` is `NULL`, the license page is hidden. * @param license the license information */ 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 * {@link Gtk.AboutDialog.set_license}. * @param license_type the type of license */ set_license_type(license_type: License): void; /** * Sets the logo in the about dialog. * @param logo a {@link Gdk.Paintable} */ set_logo(logo: Gdk.Paintable | null): void; /** * Sets the icon name to be displayed as logo in the about dialog. * @param icon_name an icon name */ set_logo_icon_name(icon_name: string | null): void; /** * Sets the name to display in the about dialog. * * If `name` is not set, the string returned * by `g_get_application_name()` is used. * @param name the program name */ set_program_name(name: string | null): void; /** * Sets the system information to be displayed in the about * dialog. * * If `system_information` is `NULL`, the system information * page is hidden. * * See {@link Gtk.AboutDialog.system_information}. * @param system_information system information */ set_system_information(system_information: string | null): void; /** * Sets the translator credits string which is displayed in * the credits page. * * 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 omit translator credits. * @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 the about dialog should be * automatically wrapped. * @param wrap_license whether to wrap the license */ set_wrap_license(wrap_license: boolean): void; /** * Returns the renderer that is used for this {@link Gtk.Native}. * @returns the renderer for `self` */ get_renderer(): Gsk.Renderer | null; /** * Returns the surface of this {@link Gtk.Native}. * @returns the surface of `self` */ get_surface(): Gdk.Surface | null; /** * Retrieves the surface transform of `self`. * * This is the translation from `self`'s surface coordinates into * `self`'s widget coordinates. */ get_surface_transform(): [number, number]; /** * Realizes a {@link Gtk.Native}. * * This should only be used by subclasses. */ realize(): void; /** * Unrealizes a {@link Gtk.Native}. * * This should only be used by subclasses. */ unrealize(): void; /** * Returns the display that this {@link Gtk.Root} is on. * @returns the display of `root` */ get_display(): Gdk.Display; /** * Retrieves the current focused widget within the root. * * Note that this is the widget that would have the focus * if the root is active; if the root is not focused then * `gtk_widget_has_focus (widget)` will be `false` for the * widget. * @returns the currently focused widget */ get_focus(): Widget | null; /** * If `focus` is not the current focus widget, and is focusable, sets * it as the focus widget for the root. * * If `focus` is `null`, unsets the focus widget for the root. * * To set the focus to a particular widget in the root, it is usually * more convenient to use {@link Gtk.Widget.grab_focus} instead of * this function. * @param focus widget to be the new focus widget, or `null` to unset the focus widget */ set_focus(focus: Widget | null): void; /** * Add a {@link Gtk.ShortcutController} to be managed. * @param controller * @virtual */ vfunc_add_controller(controller: ShortcutController): void; /** * Remove a {@link Gtk.ShortcutController} that had previously * been added * @param controller * @virtual */ vfunc_remove_controller(controller: ShortcutController): void; } namespace AccessibleHyperlink { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { "notify::accessible-role": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, Accessible.ConstructorProps {} } /** * Represents a link (i.e. a uri). * * A widget that contains one or more links should implement * the {@link Gtk.AccessibleHypertext} interface and return * {@link Gtk.AccessibleHyperlink} objects for each of the links. * @gir-type Class * @since 4.22 */ class AccessibleHyperlink extends GObject.Object implements Accessible { 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: AccessibleHyperlink.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](parent: AccessibleHypertext, index: number, uri: string, bounds: AccessibleTextRange): AccessibleHyperlink; // 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 a platform state on the accessible. * @param state the platform state to change * @param enabled the new value for the platform state */ set_platform_state(state: AccessiblePlatformState, enabled: boolean): void; /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessible_role(): AccessibleRole; set accessible_role(val: AccessibleRole); /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessibleRole(): AccessibleRole; set accessibleRole(val: AccessibleRole); /** * Requests the user's screen reader to announce the given message. * * This kind of notification is useful for messages that * either have only a visual representation or that are not * exposed visually at all, e.g. a notification about a * successful operation. * * Also, by using this API, you can ensure that the message * does not interrupts the user's current screen reader output. * @param message the string to announce * @param priority the priority of the announcement */ announce(message: string, priority: AccessibleAnnouncementPriority): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @returns the accessible identifier */ get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @returns the accessible parent */ get_accessible_parent(): Accessible | null; /** * Retrieves the accessible role of an accessible object. * @returns the accessible role */ get_accessible_role(): AccessibleRole; /** * Retrieves the implementation for the given accessible object. * @returns the accessible implementation object */ get_at_context(): ATContext; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @returns true if the bounds are valid, and false otherwise */ get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @returns the first accessible child */ get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @returns the next accessible sibling */ get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @returns the value of state for the accessible */ get_platform_state(state: AccessiblePlatformState): boolean; /** * Resets the accessible property to its default value. * @param property the accessible property */ reset_property(property: AccessibleProperty): void; /** * Resets the accessible relation to its default value. * @param relation the accessible relation */ reset_relation(relation: AccessibleRelation): void; /** * Resets the accessible state to its default value. * @param state the accessible state */ reset_state(state: AccessibleState): void; /** * Sets the parent and sibling of an accessible object. * * This function is meant to be used by accessible implementations that are * not part of the widget hierarchy, and but act as a logical bridge between * widgets. For instance, if a widget creates an object that holds metadata * for each child, and you want that object to implement the {@link Gtk.Accessible} * interface, you will use this function to ensure that the parent of each * child widget is the metadata object, and the parent of each metadata * object is the container widget. * @param parent the parent accessible object * @param next_sibling the sibling accessible object */ set_accessible_parent(parent: Accessible | null, next_sibling: Accessible | null): void; /** * Updates the next accessible sibling. * * That might be useful when a new child of a custom accessible * is created, and it needs to be linked to a previous child. * @param new_sibling the new next accessible sibling to set */ update_next_accessible_sibling(new_sibling: Accessible | null): void; /** * Informs ATs that the platform state has changed. * * This function should be used by {@link Gtk.Accessible} implementations that * have a platform state but are not widgets. Widgets handle platform * states automatically. * @param state the platform state to update */ update_platform_state(state: AccessiblePlatformState): void; /** * Updates an array of accessible properties. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * property change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param properties an array of accessible properties * @param values an array of `GValues`, one for each property */ update_property(properties: AccessibleProperty[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible relations. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * relation change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param relations an array of accessible relations * @param values an array of `GValues`, one for each relation */ update_relation(relations: AccessibleRelation[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible states. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * state change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param states an array of accessible states * @param values an array of `GValues`, one for each state */ update_state(states: AccessibleState[], values: (GObject.Value | any)[]): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @virtual */ vfunc_get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @virtual */ vfunc_get_accessible_parent(): Accessible | null; /** * Retrieves the implementation for the given accessible object. * @virtual */ vfunc_get_at_context(): ATContext | null; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @virtual */ vfunc_get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @virtual */ vfunc_get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @virtual */ vfunc_get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @virtual */ vfunc_get_platform_state(state: AccessiblePlatformState): boolean; } namespace ActionBar { // Signal signatures interface SignalSignatures extends Widget.SignalSignatures { "notify::revealed": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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::accessible-role": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Widget.ConstructorProps, Accessible.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps { revealed: boolean; } } /** * Presents contextual actions. * * * * An example GtkActionBar * * * {@link Gtk.ActionBar} 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. * * # GtkActionBar as GtkBuildable * * The {@link Gtk.ActionBar} implementation of the {@link Gtk.Buildable} interface supports * adding children at the start or end sides by specifying “start” or “end” as * the “type” attribute of a `` element, or setting the center widget * by specifying “center” value. * * # CSS nodes * * ``` * actionbar * ╰── revealer * ╰── box * ├── box.start * │ ╰── [start children] * ├── [center widget] * ╰── box.end * ╰── [end children] * ``` * * A {@link Gtk.ActionBar}'s CSS node is called `actionbar`. It contains a `revealer` * subnode, which contains a `box` subnode, which contains two `box` subnodes at * the start and end of the action bar, with `start` and `end` style classes * respectively, as well as a center node that represents the center child. * * Each of the boxes contains children packed for that side. * @gir-type Class */ class ActionBar extends Widget implements Accessible, Buildable, ConstraintTarget { static $gtype: GObject.GType; // Properties /** * Controls whether the action bar shows its contents. * @default true */ get revealed(): boolean; set revealed(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: 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 widget */ get_center_widget(): Widget | null; /** * Gets whether the contents of the action bar are revealed. * @returns the current value of the {@link Gtk.ActionBar.revealed} property */ get_revealed(): boolean; /** * Adds a child to the action bar, packed with reference to the * end of the action bar. * @param child the widget to be added */ pack_end(child: Widget): void; /** * Adds a child to the action, packed with reference to the * start of the action bar. * @param child the widget to be added */ pack_start(child: Widget): void; /** * Removes a child from the action bar. * @param child the widget to be removed */ remove(child: Widget): void; /** * Sets the center widget for the action bar. * @param center_widget a widget to use for the center */ set_center_widget(center_widget: Widget | null): void; /** * Reveals or conceals the content of the action bar. * * Note: this does not show or hide the action bar in the * {@link Gtk.Widget.visible} sense, so revealing has * no effect if the action bar is hidden. * @param revealed the new value for the property */ set_revealed(revealed: boolean): void; /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessible_role(): AccessibleRole; set accessible_role(val: AccessibleRole); /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessibleRole(): AccessibleRole; set accessibleRole(val: AccessibleRole); /** * Requests the user's screen reader to announce the given message. * * This kind of notification is useful for messages that * either have only a visual representation or that are not * exposed visually at all, e.g. a notification about a * successful operation. * * Also, by using this API, you can ensure that the message * does not interrupts the user's current screen reader output. * @param message the string to announce * @param priority the priority of the announcement */ announce(message: string, priority: AccessibleAnnouncementPriority): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @returns the accessible identifier */ get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @returns the accessible parent */ get_accessible_parent(): Accessible | null; /** * Retrieves the accessible role of an accessible object. * @returns the accessible role */ get_accessible_role(): AccessibleRole; /** * Retrieves the implementation for the given accessible object. * @returns the accessible implementation object */ get_at_context(): ATContext; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @returns true if the bounds are valid, and false otherwise */ get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @returns the first accessible child */ get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @returns the next accessible sibling */ get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @returns the value of state for the accessible */ get_platform_state(state: AccessiblePlatformState): boolean; /** * Resets the accessible property to its default value. * @param property the accessible property */ reset_property(property: AccessibleProperty): void; /** * Resets the accessible relation to its default value. * @param relation the accessible relation */ reset_relation(relation: AccessibleRelation): void; /** * Resets the accessible state to its default value. * @param state the accessible state */ reset_state(state: AccessibleState): void; /** * Sets the parent and sibling of an accessible object. * * This function is meant to be used by accessible implementations that are * not part of the widget hierarchy, and but act as a logical bridge between * widgets. For instance, if a widget creates an object that holds metadata * for each child, and you want that object to implement the {@link Gtk.Accessible} * interface, you will use this function to ensure that the parent of each * child widget is the metadata object, and the parent of each metadata * object is the container widget. * @param parent the parent accessible object * @param next_sibling the sibling accessible object */ set_accessible_parent(parent: Accessible | null, next_sibling: Accessible | null): void; /** * Updates the next accessible sibling. * * That might be useful when a new child of a custom accessible * is created, and it needs to be linked to a previous child. * @param new_sibling the new next accessible sibling to set */ update_next_accessible_sibling(new_sibling: Accessible | null): void; /** * Informs ATs that the platform state has changed. * * This function should be used by {@link Gtk.Accessible} implementations that * have a platform state but are not widgets. Widgets handle platform * states automatically. * @param state the platform state to update */ update_platform_state(state: AccessiblePlatformState): void; /** * Updates an array of accessible properties. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * property change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param properties an array of accessible properties * @param values an array of `GValues`, one for each property */ update_property(properties: AccessibleProperty[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible relations. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * relation change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param relations an array of accessible relations * @param values an array of `GValues`, one for each relation */ update_relation(relations: AccessibleRelation[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible states. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * state change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param states an array of accessible states * @param values an array of `GValues`, one for each state */ update_state(states: AccessibleState[], values: (GObject.Value | any)[]): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @virtual */ vfunc_get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @virtual */ vfunc_get_accessible_parent(): Accessible | null; /** * Retrieves the implementation for the given accessible object. * @virtual */ vfunc_get_at_context(): ATContext | null; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @virtual */ vfunc_get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @virtual */ vfunc_get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @virtual */ vfunc_get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @virtual */ vfunc_get_platform_state(state: AccessiblePlatformState): boolean; /** * Gets the ID of the `buildable` object. * * {@link Gtk.Builder} sets the name based on the ID attribute * of the `` tag used to construct the `buildable`. * @returns the ID of the buildable object */ get_buildable_id(): string | null; /** * 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; /** * 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; /** * 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; /** * 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, BuildableParser, never]; /** * The getter corresponding to `set_id`. Implement this * if you implement `set_id`. * @virtual */ vfunc_get_id(): string; /** * Retrieves 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; /** * Called when a builder finishes the parsing * of a UI definition. It is normally not necessary to implement this, * unless you need to perform special cleanup actions. {@link Gtk.Window} sets * the {@link Gtk.Widget.visible} property here. * @param builder * @virtual */ vfunc_parser_finished(builder: Builder): void; /** * Sets a property of a buildable object. * It is normally not necessary to implement this, `g_object_set_property()` * is used by default. {@link Gtk.Window} implements this to delay showing itself * (i.e. setting the {@link Gtk.Widget.visible} property) until the whole * interface is created. * @param builder * @param name * @param value * @virtual */ vfunc_set_buildable_property(builder: Builder, name: string, value: unknown): void; /** * Stores the id attribute given in the {@link Gtk.Builder} UI definition. * {@link Gtk.Widget} stores the name as object data. Implement this method if your * object has some notion of “ID” and it makes sense to map the XML id * attribute to it. * @param id * @virtual */ vfunc_set_id(id: string): void; } namespace ActivateAction { // Signal signatures interface SignalSignatures extends ShortcutAction.SignalSignatures {} // Constructor properties interface interface ConstructorProps extends ShortcutAction.ConstructorProps {} } /** * Activates a widget. * * Widgets are activated by calling {@link Gtk.Widget.activate}. * @gir-type Class */ class ActivateAction extends ShortcutAction { 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: ActivateAction.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 /** * Gets the activate action. * * This is an action that calls `gtk_widget_activate()` * on the given widget upon activation. */ static get(): ActivateAction; } namespace Adjustment { // Signal signatures interface SignalSignatures extends GObject.InitiallyUnowned.SignalSignatures { /** * Emitted when one or more of the {@link Gtk.Adjustment} properties have been * changed. * * Note that the {@link Gtk.Adjustment.value} property is * covered by the `Gtk.Adjustment::value-changed` signal. * @signal * @run-first */ changed: () => void; /** * Emitted when the value 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; } } /** * A model for a numeric value. * * The {@link Gtk.Adjustment} has an associated lower and upper bound. * It also contains step and page increments, and a page size. * * Adjustments are used within several GTK widgets, including * {@link Gtk.SpinButton}, {@link Gtk.Viewport}, {@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. * @default 0 */ get lower(): number; set lower(val: number); /** * The page increment of the adjustment. * @default 0 */ get page_increment(): number; set page_increment(val: number); /** * The page increment of the adjustment. * @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}. * @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}. * @default 0 */ get pageSize(): number; set pageSize(val: number); /** * The step increment of the adjustment. * @default 0 */ get step_increment(): number; set step_increment(val: number); /** * The step increment of the adjustment. * @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. * @default 0 */ get upper(): number; set upper(val: number); /** * The value of the adjustment. * @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 /** * @virtual */ vfunc_changed(): void; /** * @virtual */ vfunc_value_changed(): void; // Methods /** * Updates the value of the adjustment to ensure that the * given range is contained in the current page. * * The current page goes from `value` to `value` + `page-size`. * If the range is larger than the page size, then only the * start of it will be in the current page. * * A `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 * `Gtk.Adjustment::changed` signal. See * {@link Gtk.Adjustment.set_lower} for an alternative * way of compressing multiple emissions of * `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 minimum value */ get_lower(): number; /** * Gets the smaller of step increment and page increment. * @returns the minimum increment */ get_minimum_increment(): number; /** * Retrieves the page increment of the adjustment. * @returns the page increment */ get_page_increment(): number; /** * Retrieves the page size of the adjustment. * @returns the page size */ get_page_size(): number; /** * Retrieves the step increment of the adjustment. * @returns the step increment */ get_step_increment(): number; /** * Retrieves the maximum value of the adjustment. * @returns the maximum value */ get_upper(): number; /** * Gets the current value of the adjustment. * @returns the current value */ get_value(): number; /** * Sets the minimum value of the adjustment. * * When setting multiple adjustment properties via their individual * setters, multiple `Gtk.Adjustment::changed` signals will * be emitted. However, since the emission of the * `Gtk.Adjustment::changed` signal is tied to the emission * of the ::notify signals of the changed properties, it’s possible * to compress the `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 {@link Gtk.Adjustment.configure} has the same effect. * @param lower the new minimum value */ set_lower(lower: number): void; /** * Sets the page increment of the adjustment. * * See {@link Gtk.Adjustment.set_lower} about how to compress * multiple emissions of the `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 {@link Gtk.Adjustment.set_lower} about how to compress * multiple emissions of the `Gtk.Adjustment::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 {@link Gtk.Adjustment.set_lower} about how to compress * multiple emissions of the `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 {@link Gtk.Adjustment.set_lower} about how to compress * multiple emissions of the `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; } namespace AlertDialog { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { "notify::buttons": (pspec: GObject.ParamSpec) => void; "notify::cancel-button": (pspec: GObject.ParamSpec) => void; "notify::default-button": (pspec: GObject.ParamSpec) => void; "notify::detail": (pspec: GObject.ParamSpec) => void; "notify::message": (pspec: GObject.ParamSpec) => void; "notify::modal": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { buttons: string[] | null; cancel_button: number; cancelButton: number; default_button: number; defaultButton: number; detail: string; message: string; modal: boolean; } } /** * Collects the arguments that are needed to present a message to the user. * * The message is shown with the {@link Gtk.AlertDialog.choose} * function. * * If you don't need to wait for a button to be clicked, you can use * {@link Gtk.AlertDialog.show}. * @gir-type Class * @since 4.10 */ class AlertDialog extends GObject.Object { static $gtype: GObject.GType; // Properties /** * Labels for buttons to show in the alert. * * The labels should be translated and may contain * a `_` character to indicate the mnemonic character. * * If this property is not set, then a 'Close' button is * automatically created. * @since 4.10 */ get buttons(): string[] | null; set buttons(val: string[] | null); /** * Determines what happens when the Escape key is pressed * while the alert is shown. * * If this property holds the index of a button in {@link Gtk.AlertDialog.buttons}, * then pressing Escape is treated as if that button was pressed. If it is -1 * or not a valid index for the `buttons` array, then an error is returned. * * If `buttons` is `NULL`, then the automatically created 'Close' button * is treated as both cancel and default button, so 0 is returned. * @since 4.10 * @default -1 */ get cancel_button(): number; set cancel_button(val: number); /** * Determines what happens when the Escape key is pressed * while the alert is shown. * * If this property holds the index of a button in {@link Gtk.AlertDialog.buttons}, * then pressing Escape is treated as if that button was pressed. If it is -1 * or not a valid index for the `buttons` array, then an error is returned. * * If `buttons` is `NULL`, then the automatically created 'Close' button * is treated as both cancel and default button, so 0 is returned. * @since 4.10 * @default -1 */ get cancelButton(): number; set cancelButton(val: number); /** * Determines what happens when the Return key is pressed * while the alert is shown. * * If this property holds the index of a button in {@link Gtk.AlertDialog.buttons}, * then pressing Return is treated as if that button was pressed. If it is -1 * or not a valid index for the `buttons` array, then nothing happens. * * If `buttons` is `NULL`, then the automatically created 'Close' button * is treated as both cancel and default button, so 0 is returned. * @since 4.10 * @default -1 */ get default_button(): number; set default_button(val: number); /** * Determines what happens when the Return key is pressed * while the alert is shown. * * If this property holds the index of a button in {@link Gtk.AlertDialog.buttons}, * then pressing Return is treated as if that button was pressed. If it is -1 * or not a valid index for the `buttons` array, then nothing happens. * * If `buttons` is `NULL`, then the automatically created 'Close' button * is treated as both cancel and default button, so 0 is returned. * @since 4.10 * @default -1 */ get defaultButton(): number; set defaultButton(val: number); /** * The detail text for the alert. * @since 4.10 * @default null */ get detail(): string; set detail(val: string); /** * The message for the alert. * @since 4.10 * @default null */ get message(): string; set message(val: string); /** * Whether the alert is modal. * @since 4.10 * @default true */ get modal(): boolean; set modal(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: AlertDialog.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; // Methods /** * Shows the alert to the user. * * It is ok to pass `NULL` for the callback if the alert * does not have more than one button. A simpler API for * this case is {@link Gtk.AlertDialog.show}. * @param parent the parent window * @param cancellable a cancellable to cancel the operation */ choose(parent: Window | null, cancellable: Gio.Cancellable | null): globalThis.Promise; /** * Shows the alert to the user. * * It is ok to pass `NULL` for the callback if the alert * does not have more than one button. A simpler API for * this case is {@link Gtk.AlertDialog.show}. * @param parent the parent window * @param cancellable a cancellable to cancel the operation * @param callback a callback to call when the operation is complete */ choose(parent: Window | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void; /** * Shows the alert to the user. * * It is ok to pass `NULL` for the callback if the alert * does not have more than one button. A simpler API for * this case is {@link Gtk.AlertDialog.show}. * @param parent the parent window * @param cancellable a cancellable to cancel the operation * @param callback a callback to call when the operation is complete */ choose(parent: Window | null, cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): globalThis.Promise | void; /** * Finishes the {@link Gtk.AlertDialog.choose} call. * @param result the result * @returns the index of the button that was clicked, or -1 if the dialog was cancelled and {@link Gtk.AlertDialog.cancel_button} is not set */ choose_finish(result: Gio.AsyncResult): number; /** * Returns the button labels for the alert. * @returns the button labels */ get_buttons(): string[] | null; /** * Returns the index of the cancel button. * @returns the index of the cancel button, or -1 */ get_cancel_button(): number; /** * Returns the index of the default button. * @returns the index of the default button, or -1 */ get_default_button(): number; /** * Returns the detail text that will be shown in the alert. * @returns the detail text */ get_detail(): string; /** * Returns the message that will be shown in the alert. * @returns the message */ get_message(): string; /** * Returns whether the alert blocks interaction * with the parent window while it is presented. * @returns true if the alert is modal */ get_modal(): boolean; /** * Sets the button labels for the alert. * @param labels the new button labels */ set_buttons(labels: string[]): void; /** * Sets the index of the cancel button. * * See {@link Gtk.AlertDialog.cancel_button} for * details of how this value is used. * @param button the new cancel button */ set_cancel_button(button: number): void; /** * Sets the index of the default button. * * See {@link Gtk.AlertDialog.default_button} for * details of how this value is used. * @param button the new default button */ set_default_button(button: number): void; /** * Sets the detail text that will be shown in the alert. * @param detail the new detail text */ set_detail(detail: string): void; /** * Sets the message that will be shown in the alert. * @param message the new message */ set_message(message: string): void; /** * Sets whether the alert blocks interaction * with the parent window while it is presented. * @param modal the new value */ set_modal(modal: boolean): void; /** * Shows the alert to the user. * * This function is a simpler version of {@link Gtk.AlertDialog.choose} * intended for dialogs with a single button. * * If you want to cancel the dialog or if the alert has more than one * button, you should use that function instead and provide it with a * {@link Gio.Cancellable} and callback respectively. * @param parent the parent window */ show(parent: Window | null): void; } namespace AlternativeTrigger { // Signal signatures interface SignalSignatures extends ShortcutTrigger.SignalSignatures { "notify::first": (pspec: GObject.ParamSpec) => void; "notify::second": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends ShortcutTrigger.ConstructorProps { first: ShortcutTrigger; second: ShortcutTrigger; } } /** * Combines two shortcut triggers. * * The {@link Gtk.AlternativeTrigger} triggers when either of the two trigger. * * This can be cascaded to combine more than two triggers. * @gir-type Class */ class AlternativeTrigger extends ShortcutTrigger { static $gtype: GObject.GType; // Properties /** * The first {@link Gtk.ShortcutTrigger} to check. * @construct-only */ get first(): ShortcutTrigger; /** * The second {@link Gtk.ShortcutTrigger} to check. * @construct-only */ get second(): ShortcutTrigger; /** * 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: AlternativeTrigger.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](first: ShortcutTrigger, second: ShortcutTrigger): AlternativeTrigger; // 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 first of the two alternative triggers that may * trigger `self`. * * {@link Gtk.AlternativeTrigger.get_second} will return * the other one. * @returns the first alternative trigger */ get_first(): ShortcutTrigger; /** * Gets the second of the two alternative triggers that may * trigger `self`. * * {@link Gtk.AlternativeTrigger.get_first} will return * the other one. * @returns the second alternative trigger */ get_second(): ShortcutTrigger; } namespace AnyFilter { // Signal signatures interface SignalSignatures extends MultiFilter.SignalSignatures { "notify::item-type": (pspec: GObject.ParamSpec) => void; "notify::n-items": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends MultiFilter.ConstructorProps, Gio.ListModel.ConstructorProps, Buildable.ConstructorProps {} } /** * Matches an item when at least one of its filters matches. * * To add filters to a {@link Gtk.AnyFilter}, use {@link Gtk.MultiFilter.append}. * @gir-type Class */ class AnyFilter extends MultiFilter implements Gio.ListModel, 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: AnyFilter.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](): AnyFilter; // 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; /** * Gets the type of the items in `list`. * * All items returned from `g_list_model_get_item()` are of the type * returned by this function, or a subtype, or if the type is an * interface, they are an implementation of that interface. * * The item type of a {@link Gio.ListModel} can not change during the life of the * model. * @returns the {@link GObject.GType} of the items contained in `list`. */ get_item_type(): GObject.GType; /** * Gets the number of items in `list`. * * Depending on the model implementation, calling this function may be * less efficient than iterating the list with increasing values for * `position` until `g_list_model_get_item()` returns `null`. * @returns the number of items in `list`. */ get_n_items(): number; /** * Get the item at `position`. * * If `position` is greater than the number of items in `list`, `null` is * returned. * * `null` is never returned for an index that is smaller than the length * of the list. * * This function is meant to be used by language bindings in place * of `g_list_model_get_item()`. * * See also: `g_list_model_get_n_items()` * @param position the position of the item to fetch * @returns the object at `position`. */ get_item(position: number): A | null; /** * Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`. * * This function should only be called by classes implementing * {@link Gio.ListModel}. It has to be called after the internal representation * of `list` has been updated, because handlers connected to this signal * might query the new state of the list. * * Implementations must only make changes to the model (as visible to * its consumer) in places that will not cause problems for that * consumer. For models that are driven directly by a write API (such * as {@link Gio.ListStore}), changes can be reported in response to uses of that * API. For models that represent remote data, changes should only be * made from a fresh mainloop dispatch. It is particularly not * permitted to make changes in response to a call to the {@link Gio.ListModel} * consumer API. * * Stated another way: in general, it is assumed that code making a * series of accesses to the model via the API, without returning to the * mainloop, and without calling other code, will continue to view the * same contents of the model. * @param position the position at which `list` changed * @param removed the number of items removed * @param added the number of items added */ items_changed(position: number, removed: number, added: number): void; /** * Get the item at `position`. If `position` is greater than the number of * items in `list`, `null` is returned. * * `null` is never returned for an index that is smaller than the length * of the list. See `g_list_model_get_n_items()`. * * The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}. * @param position the position of the item to fetch * @virtual */ vfunc_get_item(position: number): A | null; /** * Gets the type of the items in `list`. * * All items returned from `g_list_model_get_item()` are of the type * returned by this function, or a subtype, or if the type is an * interface, they are an implementation of that interface. * * The item type of a {@link Gio.ListModel} can not change during the life of the * model. * @virtual */ vfunc_get_item_type(): GObject.GType; /** * Gets the number of items in `list`. * * Depending on the model implementation, calling this function may be * less efficient than iterating the list with increasing values for * `position` until `g_list_model_get_item()` returns `null`. * @virtual */ vfunc_get_n_items(): number; /** * Gets the ID of the `buildable` object. * * {@link Gtk.Builder} sets the name based on the ID attribute * of the `` tag used to construct the `buildable`. * @returns the ID of the buildable object */ get_buildable_id(): string | null; /** * 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; /** * 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; /** * 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; /** * 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, BuildableParser, never]; /** * The getter corresponding to `set_id`. Implement this * if you implement `set_id`. * @virtual */ vfunc_get_id(): string; /** * Retrieves 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; /** * Called when a builder finishes the parsing * of a UI definition. It is normally not necessary to implement this, * unless you need to perform special cleanup actions. {@link Gtk.Window} sets * the {@link Gtk.Widget.visible} property here. * @param builder * @virtual */ vfunc_parser_finished(builder: Builder): void; /** * Sets a property of a buildable object. * It is normally not necessary to implement this, `g_object_set_property()` * is used by default. {@link Gtk.Window} implements this to delay showing itself * (i.e. setting the {@link Gtk.Widget.visible} property) until the whole * interface is created. * @param builder * @param name * @param value * @virtual */ vfunc_set_buildable_property(builder: Builder, name: string, value: unknown): void; /** * Stores the id attribute given in the {@link Gtk.Builder} UI definition. * {@link Gtk.Widget} stores the name as object data. Implement this method if your * object has some notion of “ID” and it makes sense to map the XML id * attribute to it. * @param id * @virtual */ vfunc_set_id(id: string): void; } namespace AppChooserButton { // Signal signatures interface SignalSignatures extends Widget.SignalSignatures { /** * Emitted to when the button is activated. * * The `::activate` signal on {@link Gtk.AppChooserButton} is an action signal and * emitting it causes the button to pop up its dialog. * @signal * @since 4.4 * @action * @run-first */ activate: () => void; /** * Emitted when the active application changes. * @signal * @run-last */ changed: () => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated": (arg0: string) => void; "notify::heading": (pspec: GObject.ParamSpec) => void; "notify::modal": (pspec: GObject.ParamSpec) => void; "notify::show-default-item": (pspec: GObject.ParamSpec) => void; "notify::show-dialog-item": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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::accessible-role": (pspec: GObject.ParamSpec) => void; "notify::content-type": (pspec: GObject.ParamSpec) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::heading": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::modal": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::show-default-item": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::show-dialog-item": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::can-focus": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::can-target": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::css-classes": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::css-name": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::cursor": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::focus-on-click": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::focusable": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::halign": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::has-default": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::has-focus": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::has-tooltip": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::height-request": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::hexpand": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::hexpand-set": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::layout-manager": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::limit-events": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::margin-bottom": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::margin-end": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::margin-start": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::margin-top": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::name": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::opacity": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::overflow": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::parent": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::receives-default": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::root": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::scale-factor": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::sensitive": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::tooltip-markup": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::tooltip-text": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::valign": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::vexpand": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::vexpand-set": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::visible": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::width-request": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::accessible-role": (arg0: string) => void; /** * Emitted when a custom item is activated. * * Use {@link Gtk.AppChooserButton.append_custom_item}, * to add custom items. * @signal * @detailed * @run-first */ "custom-item-activated::content-type": (arg0: string) => void; [key: `custom-item-activated::${string}`]: (arg0: string) => void; } // Constructor properties interface interface ConstructorProps extends Widget.ConstructorProps, Accessible.ConstructorProps, AppChooser.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps { heading: string | null; modal: boolean; show_default_item: boolean; showDefaultItem: boolean; show_dialog_item: boolean; showDialogItem: boolean; } } /** * The {@link Gtk.AppChooserButton} lets the user select an application. * * * * An example GtkAppChooserButton * * * 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 * {@link Gtk.AppChooserButton.append_custom_item}. These items cause * the `Gtk.AppChooserButton::custom-item-activated` signal to be * emitted when they are selected. * * To track changes in the selected application, use the * `Gtk.AppChooserButton::changed` signal. * * ## CSS nodes * * {@link Gtk.AppChooserButton} has a single CSS node with the name “appchooserbutton”. * @gir-type Class * @deprecated since 4.10: The application selection widgets should be implemented according to the design of each platform and/or application requiring them. */ class AppChooserButton extends Widget implements Accessible, AppChooser, Buildable, ConstraintTarget { 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); /** * Whether the app chooser dialog should be modal. * @default true */ get modal(): boolean; set modal(val: boolean); /** * Determines whether the dropdown menu shows the default application * on top for the provided content type. * @default false */ get show_default_item(): boolean; set show_default_item(val: boolean); /** * Determines whether the dropdown menu shows the default application * on top for the provided content type. * @default false */ get showDefaultItem(): boolean; set showDefaultItem(val: boolean); /** * Determines whether the dropdown menu shows an item to open * a {@link Gtk.AppChooserDialog}. * @default false */ get show_dialog_item(): boolean; set show_dialog_item(val: boolean); /** * Determines whether the dropdown menu shows an item to open * a {@link Gtk.AppChooserDialog}. * @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; // 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 /** * 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 * `Gtk.AppChooserButton::custom-item-activated` signal, to add a * callback for the activation of a particular custom item in the list. * * See also {@link Gtk.AppChooserButton.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; /** * Gets whether the dialog is modal. * @returns `true` if the dialog is modal */ get_modal(): boolean; /** * Returns whether the dropdown menu should show the default * application at the top. * @returns the value of {@link Gtk.AppChooserButton.show_default_item} */ get_show_default_item(): boolean; /** * Returns whether the dropdown menu shows an item * for a {@link Gtk.AppChooserDialog}. * @returns the value of {@link Gtk.AppChooserButton.show_dialog_item} */ get_show_dialog_item(): boolean; /** * Selects a custom item. * * See {@link Gtk.AppChooserButton.append_custom_item}. * * Use {@link Gtk.AppChooser.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 dialog should be modal. * @param modal `true` to make the dialog modal */ set_modal(modal: boolean): 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 accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessible_role(): AccessibleRole; set accessible_role(val: AccessibleRole); /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessibleRole(): AccessibleRole; set accessibleRole(val: AccessibleRole); /** * The content type of the {@link Gtk.AppChooser} object. * * See `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` for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get contentType(): string; /** * Requests the user's screen reader to announce the given message. * * This kind of notification is useful for messages that * either have only a visual representation or that are not * exposed visually at all, e.g. a notification about a * successful operation. * * Also, by using this API, you can ensure that the message * does not interrupts the user's current screen reader output. * @param message the string to announce * @param priority the priority of the announcement */ announce(message: string, priority: AccessibleAnnouncementPriority): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @returns the accessible identifier */ get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @returns the accessible parent */ get_accessible_parent(): Accessible | null; /** * Retrieves the accessible role of an accessible object. * @returns the accessible role */ get_accessible_role(): AccessibleRole; /** * Retrieves the implementation for the given accessible object. * @returns the accessible implementation object */ get_at_context(): ATContext; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @returns true if the bounds are valid, and false otherwise */ get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @returns the first accessible child */ get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @returns the next accessible sibling */ get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @returns the value of state for the accessible */ get_platform_state(state: AccessiblePlatformState): boolean; /** * Resets the accessible property to its default value. * @param property the accessible property */ reset_property(property: AccessibleProperty): void; /** * Resets the accessible relation to its default value. * @param relation the accessible relation */ reset_relation(relation: AccessibleRelation): void; /** * Resets the accessible state to its default value. * @param state the accessible state */ reset_state(state: AccessibleState): void; /** * Sets the parent and sibling of an accessible object. * * This function is meant to be used by accessible implementations that are * not part of the widget hierarchy, and but act as a logical bridge between * widgets. For instance, if a widget creates an object that holds metadata * for each child, and you want that object to implement the {@link Gtk.Accessible} * interface, you will use this function to ensure that the parent of each * child widget is the metadata object, and the parent of each metadata * object is the container widget. * @param parent the parent accessible object * @param next_sibling the sibling accessible object */ set_accessible_parent(parent: Accessible | null, next_sibling: Accessible | null): void; /** * Updates the next accessible sibling. * * That might be useful when a new child of a custom accessible * is created, and it needs to be linked to a previous child. * @param new_sibling the new next accessible sibling to set */ update_next_accessible_sibling(new_sibling: Accessible | null): void; /** * Informs ATs that the platform state has changed. * * This function should be used by {@link Gtk.Accessible} implementations that * have a platform state but are not widgets. Widgets handle platform * states automatically. * @param state the platform state to update */ update_platform_state(state: AccessiblePlatformState): void; /** * Updates an array of accessible properties. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * property change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param properties an array of accessible properties * @param values an array of `GValues`, one for each property */ update_property(properties: AccessibleProperty[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible relations. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * relation change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param relations an array of accessible relations * @param values an array of `GValues`, one for each relation */ update_relation(relations: AccessibleRelation[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible states. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * state change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param states an array of accessible states * @param values an array of `GValues`, one for each state */ update_state(states: AccessibleState[], values: (GObject.Value | any)[]): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @virtual */ vfunc_get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @virtual */ vfunc_get_accessible_parent(): Accessible | null; /** * Retrieves the implementation for the given accessible object. * @virtual */ vfunc_get_at_context(): ATContext | null; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @virtual */ vfunc_get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @virtual */ vfunc_get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @virtual */ vfunc_get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @virtual */ vfunc_get_platform_state(state: AccessiblePlatformState): boolean; /** * Returns the currently selected application. * @returns a {@link Gio.AppInfo} for the currently selected application */ get_app_info(): Gio.AppInfo | null; /** * Returns the content type for which the {@link Gtk.AppChooser} * shows applications. * @returns the content type of `self`. Free with `g_free()` */ get_content_type(): string; /** * Reloads the list of applications. */ refresh(): void; /** * Gets the ID of the `buildable` object. * * {@link Gtk.Builder} sets the name based on the ID attribute * of the `` tag used to construct the `buildable`. * @returns the ID of the buildable object */ get_buildable_id(): string | null; /** * 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; /** * 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; /** * 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; /** * 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, BuildableParser, never]; /** * The getter corresponding to `set_id`. Implement this * if you implement `set_id`. * @virtual */ vfunc_get_id(): string; /** * Retrieves 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; /** * Called when a builder finishes the parsing * of a UI definition. It is normally not necessary to implement this, * unless you need to perform special cleanup actions. {@link Gtk.Window} sets * the {@link Gtk.Widget.visible} property here. * @param builder * @virtual */ vfunc_parser_finished(builder: Builder): void; /** * Sets a property of a buildable object. * It is normally not necessary to implement this, `g_object_set_property()` * is used by default. {@link Gtk.Window} implements this to delay showing itself * (i.e. setting the {@link Gtk.Widget.visible} property) until the whole * interface is created. * @param builder * @param name * @param value * @virtual */ vfunc_set_buildable_property(builder: Builder, name: string, value: unknown): void; /** * Stores the id attribute given in the {@link Gtk.Builder} UI definition. * {@link Gtk.Widget} stores the name as object data. Implement this method if your * object has some notion of “ID” and it makes sense to map the XML id * attribute to it. * @param id * @virtual */ vfunc_set_id(id: string): 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::application": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::decorated": (pspec: GObject.ParamSpec) => void; "notify::default-height": (pspec: GObject.ParamSpec) => void; "notify::default-widget": (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::display": (pspec: GObject.ParamSpec) => void; "notify::focus-visible": (pspec: GObject.ParamSpec) => void; "notify::focus-widget": (pspec: GObject.ParamSpec) => void; "notify::fullscreened": (pspec: GObject.ParamSpec) => void; "notify::gravity": (pspec: GObject.ParamSpec) => void; "notify::handle-menubar-accel": (pspec: GObject.ParamSpec) => void; "notify::hide-on-close": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-active": (pspec: GObject.ParamSpec) => void; "notify::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::startup-id": (pspec: GObject.ParamSpec) => void; "notify::suspended": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; "notify::titlebar": (pspec: GObject.ParamSpec) => void; "notify::transient-for": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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::content-type": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Dialog.ConstructorProps, Accessible.ConstructorProps, AppChooser.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps, Native.ConstructorProps, Root.ConstructorProps, ShortcutManager.ConstructorProps { gfile: Gio.File; heading: string | null; } } /** * {@link Gtk.AppChooserDialog} shows a {@link Gtk.AppChooserWidget} inside a {@link Gtk.Dialog}. * * * * An example GtkAppChooserDialog * * * Note that {@link Gtk.AppChooserDialog} does not have any interesting methods * of its own. Instead, you should get the embedded {@link Gtk.AppChooserWidget} * using {@link Gtk.AppChooserDialog.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 {@link Gtk.AppChooserDialog.set_heading}. * * ## CSS nodes * * {@link Gtk.AppChooserDialog} has a single CSS node with the name `window` and style * class `.appchooser`. * @gir-type Class * @deprecated since 4.10: The application selection widgets should be implemented according to the design of each platform and/or application requiring them. */ class AppChooserDialog extends Dialog implements Accessible, AppChooser, Buildable, ConstraintTarget, Native, Root, ShortcutManager { 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` 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` for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get contentType(): string; /** * Returns the currently selected application. * @returns a {@link Gio.AppInfo} for the currently selected application */ get_app_info(): Gio.AppInfo | null; /** * Returns the content type for which the {@link Gtk.AppChooser} * shows applications. * @returns the content type of `self`. Free with `g_free()` */ get_content_type(): string; /** * Reloads the list of applications. */ refresh(): void; } namespace AppChooserWidget { // Signal signatures interface SignalSignatures extends Widget.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; "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::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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::accessible-role": (pspec: GObject.ParamSpec) => void; "notify::content-type": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Widget.ConstructorProps, Accessible.ConstructorProps, AppChooser.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps { default_text: string | null; defaultText: string | null; show_all: boolean; 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 * `Gtk.AppChooserWidget::application-selected` and * `Gtk.AppChooserWidget::application-activated` signals. * * ## CSS nodes * * {@link Gtk.AppChooserWidget} has a single CSS node with name appchooser. * @gir-type Class * @deprecated since 4.10: The application selection widgets should be implemented according to the design of each platform and/or application requiring them. */ class AppChooserWidget extends Widget implements Accessible, AppChooser, Buildable, ConstraintTarget { static $gtype: GObject.GType; // Properties /** * The text that appears in the widget when there are no applications * for the given content type. * @default null */ get default_text(): string | null; set default_text(val: string | null); /** * The text that appears in the widget when there are no applications * for the given content type. * @default null */ get defaultText(): string | null; set defaultText(val: string | null); /** * If `true`, the app chooser presents all applications * in a single list, without subsections for default, * recommended or related applications. * @default false */ get show_all(): boolean; set show_all(val: boolean); /** * If `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); /** * 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); /** * 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); /** * 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); /** * 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); /** * Determines whether the app chooser should show a section * for other applications. * @default false */ get show_other(): boolean; set show_other(val: boolean); /** * Determines whether the app chooser should show a section * for other applications. * @default false */ get showOther(): boolean; set showOther(val: boolean); /** * 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); /** * 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; // 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 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 | null; /** * Gets whether the app chooser should show all applications * in a flat list. * @returns the value of {@link Gtk.AppChooserWidget.show_all} */ get_show_all(): boolean; /** * Gets whether the app chooser should show the default handler * for the content type in a separate section. * @returns the value of {@link Gtk.AppChooserWidget.show_default} */ get_show_default(): boolean; /** * Gets whether the app chooser should show related applications * for the content type in a separate section. * @returns the value of {@link Gtk.AppChooserWidget.show_fallback} */ get_show_fallback(): boolean; /** * Gets whether the app chooser should show applications * which are unrelated to the content type. * @returns the value of {@link Gtk.AppChooserWidget.show_other} */ get_show_other(): boolean; /** * Gets whether the app chooser should show recommended applications * for the content type in a separate section. * @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 accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessible_role(): AccessibleRole; set accessible_role(val: AccessibleRole); /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessibleRole(): AccessibleRole; set accessibleRole(val: AccessibleRole); /** * The content type of the {@link Gtk.AppChooser} object. * * See `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` for more information about content types. * @construct-only * @default null * @category Inherited from Gtk.AppChooser */ get contentType(): string; /** * Requests the user's screen reader to announce the given message. * * This kind of notification is useful for messages that * either have only a visual representation or that are not * exposed visually at all, e.g. a notification about a * successful operation. * * Also, by using this API, you can ensure that the message * does not interrupts the user's current screen reader output. * @param message the string to announce * @param priority the priority of the announcement */ announce(message: string, priority: AccessibleAnnouncementPriority): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @returns the accessible identifier */ get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @returns the accessible parent */ get_accessible_parent(): Accessible | null; /** * Retrieves the accessible role of an accessible object. * @returns the accessible role */ get_accessible_role(): AccessibleRole; /** * Retrieves the implementation for the given accessible object. * @returns the accessible implementation object */ get_at_context(): ATContext; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @returns true if the bounds are valid, and false otherwise */ get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @returns the first accessible child */ get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @returns the next accessible sibling */ get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @returns the value of state for the accessible */ get_platform_state(state: AccessiblePlatformState): boolean; /** * Resets the accessible property to its default value. * @param property the accessible property */ reset_property(property: AccessibleProperty): void; /** * Resets the accessible relation to its default value. * @param relation the accessible relation */ reset_relation(relation: AccessibleRelation): void; /** * Resets the accessible state to its default value. * @param state the accessible state */ reset_state(state: AccessibleState): void; /** * Sets the parent and sibling of an accessible object. * * This function is meant to be used by accessible implementations that are * not part of the widget hierarchy, and but act as a logical bridge between * widgets. For instance, if a widget creates an object that holds metadata * for each child, and you want that object to implement the {@link Gtk.Accessible} * interface, you will use this function to ensure that the parent of each * child widget is the metadata object, and the parent of each metadata * object is the container widget. * @param parent the parent accessible object * @param next_sibling the sibling accessible object */ set_accessible_parent(parent: Accessible | null, next_sibling: Accessible | null): void; /** * Updates the next accessible sibling. * * That might be useful when a new child of a custom accessible * is created, and it needs to be linked to a previous child. * @param new_sibling the new next accessible sibling to set */ update_next_accessible_sibling(new_sibling: Accessible | null): void; /** * Informs ATs that the platform state has changed. * * This function should be used by {@link Gtk.Accessible} implementations that * have a platform state but are not widgets. Widgets handle platform * states automatically. * @param state the platform state to update */ update_platform_state(state: AccessiblePlatformState): void; /** * Updates an array of accessible properties. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * property change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param properties an array of accessible properties * @param values an array of `GValues`, one for each property */ update_property(properties: AccessibleProperty[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible relations. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * relation change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param relations an array of accessible relations * @param values an array of `GValues`, one for each relation */ update_relation(relations: AccessibleRelation[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible states. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * state change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param states an array of accessible states * @param values an array of `GValues`, one for each state */ update_state(states: AccessibleState[], values: (GObject.Value | any)[]): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @virtual */ vfunc_get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @virtual */ vfunc_get_accessible_parent(): Accessible | null; /** * Retrieves the implementation for the given accessible object. * @virtual */ vfunc_get_at_context(): ATContext | null; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @virtual */ vfunc_get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @virtual */ vfunc_get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @virtual */ vfunc_get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @virtual */ vfunc_get_platform_state(state: AccessiblePlatformState): boolean; /** * Returns the currently selected application. * @returns a {@link Gio.AppInfo} for the currently selected application */ get_app_info(): Gio.AppInfo | null; /** * Returns the content type for which the {@link Gtk.AppChooser} * shows applications. * @returns the content type of `self`. Free with `g_free()` */ get_content_type(): string; /** * Reloads the list of applications. */ refresh(): void; /** * Gets the ID of the `buildable` object. * * {@link Gtk.Builder} sets the name based on the ID attribute * of the `` tag used to construct the `buildable`. * @returns the ID of the buildable object */ get_buildable_id(): string | null; /** * 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; /** * 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; /** * 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; /** * 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, BuildableParser, never]; /** * The getter corresponding to `set_id`. Implement this * if you implement `set_id`. * @virtual */ vfunc_get_id(): string; /** * Retrieves 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; /** * Called when a builder finishes the parsing * of a UI definition. It is normally not necessary to implement this, * unless you need to perform special cleanup actions. {@link Gtk.Window} sets * the {@link Gtk.Widget.visible} property here. * @param builder * @virtual */ vfunc_parser_finished(builder: Builder): void; /** * Sets a property of a buildable object. * It is normally not necessary to implement this, `g_object_set_property()` * is used by default. {@link Gtk.Window} implements this to delay showing itself * (i.e. setting the {@link Gtk.Widget.visible} property) until the whole * interface is created. * @param builder * @param name * @param value * @virtual */ vfunc_set_buildable_property(builder: Builder, name: string, value: unknown): void; /** * Stores the id attribute given in the {@link Gtk.Builder} UI definition. * {@link Gtk.Widget} stores the name as object data. Implement this method if your * object has some notion of “ID” and it makes sense to map the XML id * attribute to it. * @param id * @virtual */ vfunc_set_id(id: string): void; } namespace Application { // Signal signatures interface SignalSignatures extends Gio.Application.SignalSignatures { /** * Emitted when the session manager is about to end the session. * * Applications can connect to this signal and call * {@link Gtk.Application.inhibit} with {@link Gtk.ApplicationInhibitFlags.LOGOUT} * to delay the end of the session until state has been saved. * @signal * @run-first */ "query-end": () => void; /** * Emitted when application global state is restored. * * The handler for this signal should do the opposite of what the * corresponding handler for `Gtk.Application::save-state` * does. * @signal * @since 4.24 * @run-last */ "restore-state": (arg0: RestoreReason, arg1: GLib.Variant) => boolean | void; /** * Emitted when an application's per-window state is restored. * * In response to this signal, you should create a new application * window, add it to `application`, apply the provided `state`, and present it. * The application can use the `reason` to determine how much of the state * should be restored. * * You must be careful to be robust in the face of app upgrades and downgrades: * the `state` might have been created by a previous or occasionally even a future * version of your app. Do not assume that a given key exists in the state. * Apps must try to restore state saved by a previous version, but are free to * discard state if it was written by a future version. * * GTK will remember which window the user was using most recently, and will * emit this signal for that window first. Thus, if you decide that the provided * `reason` means that only one window should be restored, you can reliably * ignore emissions if a window already exists * * Note that this signal is not emitted only during the app's initial launch. * If all windows are closed but the app keeps running, the signal will be * emitted the next time a new window is opened. * @signal * @since 4.24 * @run-first */ "restore-window": (arg0: RestoreReason, arg1: GLib.Variant) => void; /** * Emitted when the application is saving global state. * * The handler for this signal should persist any * global state of `application` into `dict`. * * See `Gtk.Application::restore-state` for how to * restore global state, and `Gtk.ApplicationWindow::save-state` * and `Gtk.Application::restore-window` for handling * per-window state. * @signal * @since 4.24 * @run-last */ "save-state": (arg0: GLib.VariantDict) => boolean | void; /** * Emitted when a window is added to an application. * * See {@link Gtk.Application.add_window}. * @signal * @run-first */ "window-added": (arg0: Window) => void; /** * Emitted when a window is removed from an application. * * This can happen as a side-effect of the window being destroyed * or explicitly through {@link Gtk.Application.remove_window}. * @signal * @run-first */ "window-removed": (arg0: Window) => void; "notify::active-window": (pspec: GObject.ParamSpec) => void; "notify::autosave-interval": (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::support-save": (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; autosave_interval: number; autosaveInterval: number; menubar: Gio.MenuModel | null; register_session: boolean; registerSession: boolean; screensaver_active: boolean; screensaverActive: boolean; support_save: boolean; supportSave: boolean; } } /** * A high-level API for writing applications. * * {@link Gtk.Application} supports many aspects of writing a GTK application * in a convenient fashion, without enforcing a one-size-fits-all model. * * Currently, it 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 {@link Gtk.Application} works fine with plain {@link Gtk.Window}s, * it is recommended to use it together with {@link Gtk.ApplicationWindow}. * * ## Initialization * * A typical {@link Gtk.Application} will create a window in its * `GIO.Application::activate`, `GIO.Application::open` * or `GIO.Application::command-line` handlers. Note that all * of these signals may be emitted multiple times, so handlers must * be careful to take existing windows into account. * * A typical ::activate handler should look like this: * * ``` * static void * activate (GApplication *gapp) * { * GtkApplication *app = GTK_APPLICATION (gapp); * GtkWindow *window; * * window = gtk_application_get_active_window (app); * if (!window) * window = create_window (app); * * gtk_window_present (window); * } * ``` * * ## 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 {@link Gio.Application.set_resource_base_path}). * The menu with the ID "menubar" is taken as the application's * menubar. Additional menus (most interesting submenus) can be named * and accessed via {@link Gtk.Application.get_menu_by_id} which allows for * dynamic population of a part of the menu structure. * * Note that automatic resource loading uses the resource base path * that is set at construction time and will not work if the resource * base path is changed at a later time. * * It is also possible to provide the menubar manually using * {@link 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 {@link Gtk.IconTheme.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 * {@link Gtk.Application} associates an instance of this shortcuts window with * each {@link Gtk.ApplicationWindow} and sets up the keyboard accelerator * Control+? to open it. To create a menu item that * displays the shortcuts window, associate the item with the action * `win.show-help-overlay`. * * {@link Gtk.Application} will also automatically set the application id as the * default window icon. Use {@link Gtk.Window.set_default_icon_name} or * {@link Gtk.Window.icon_name} to override that behavior. * * ## State saving * * {@link Gtk.Application} registers with a session manager if possible and * offers various functionality related to the session life-cycle, * such as state saving. * * State-saving functionality can be enabled by setting the * {@link Gtk.Application.support_save} property to true. * * In order to save and restore per-window state, applications must * connect to the `Gtk.Application::restore-window` signal and * handle the `Gtk.ApplicationWindow::save-state` signal. There * are also `Gtk.Application::restore-state` and * `Gtk.Application::save-state` signals, which can be used * for global state that is not connected to any window. * * {@link Gtk.Application} automatically saves state before app shutdown, and by * default periodically auto-saves app state (as configured by the * {@link Gtk.Application.autosave_interval} property). Applications can * also call {@link Gtk.Application.save} themselves at opportune times. * * # Inhibiting * * An application can block various ways to end the session with * the {@link 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. * * ## A simple application * * [A simple example](https://gitlab.gnome.org/GNOME/gtk/tree/main/examples/bp/bloatpad.c) * is available in the GTK source code repository * * ## See Also * * - [Using GtkApplication](https://developer.gnome.org/documentation/tutorials/application.html) * - [Getting Started with GTK: Basics](https://docs.gtk.org/gtk4/getting_started.html#basics) * @gir-type Class */ class Application extends Gio.Application implements Gio.ActionGroup, Gio.ActionMap { static $gtype: GObject.GType; // Properties /** * The currently focused window of the application. * @read-only */ get active_window(): Window | null; /** * The currently focused window of the application. * @read-only */ get activeWindow(): Window | null; /** * The number of seconds between automatic state saves. Defaults to 15. * A value of 0 will opt out of automatic state saving. * @since 4.24 * @default 15 */ get autosave_interval(): number; set autosave_interval(val: number); /** * The number of seconds between automatic state saves. Defaults to 15. * A value of 0 will opt out of automatic state saving. * @since 4.24 * @default 15 */ get autosaveInterval(): number; set autosaveInterval(val: number); /** * The menu model to be used for the application's menu bar. */ get menubar(): Gio.MenuModel | null; set menubar(val: Gio.MenuModel | null); /** * Set this property to true to register with the session manager. * * This will make GTK track the session state (such as the * {@link Gtk.Application.screensaver_active} property). * @deprecated since 4.22: This property is ignored. GTK always registers with the session manager * @default false */ get register_session(): boolean; set register_session(val: boolean); /** * Set this property to true to register with the session manager. * * This will make GTK track the session state (such as the * {@link Gtk.Application.screensaver_active} property). * @deprecated since 4.22: This property is ignored. GTK always registers with the session manager * @default false */ get registerSession(): boolean; set registerSession(val: boolean); /** * This property is true if GTK believes that the screensaver * is currently active. * * Tracking the screensaver state is currently only supported on * Linux. * @read-only * @default false */ get screensaver_active(): boolean; /** * This property is true if GTK believes that the screensaver * is currently active. * * Tracking the screensaver state is currently only supported on * Linux. * @read-only * @default false */ get screensaverActive(): boolean; /** * Set this property to true if the application supports * state saving and restoring. * @since 4.24 * @default false */ get support_save(): boolean; set support_save(val: boolean); /** * Set this property to true if the application supports * state saving and restoring. * @since 4.24 * @default false */ get supportSave(): boolean; set supportSave(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: 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 /** * Class closure for the `Gtk.Application::restore-state` signal. * @param reason the reason for restoring state * @param state a dictionary containing the application state to restore * @virtual */ vfunc_restore_state(reason: RestoreReason, state: GLib.Variant): boolean; /** * Class closure for the `Gtk.Application::restore-window` signal. * @param reason the reason this window is restored * @param state the state to restore, as saved by a `Gtk.ApplicationWindow::save-state` handler * @virtual */ vfunc_restore_window(reason: RestoreReason, state: GLib.Variant | null): void; /** * Class closure for the `Gtk.Application::save-state` signal. * @param state a dictionary where to store the application's state * @virtual */ vfunc_save_state(state: GLib.VariantDict): boolean; /** * 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 /** * Adds a window to the 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 `GIO.Application::activate` signal. * * This call is equivalent to setting the {@link Gtk.Window.application} * property of the 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 {@link Gtk.Application.remove_window}. * * GTK will keep the application running as long as it has any windows. * @param window a window */ add_window(window: Window): void; /** * Forget state that has been previously saved and prevent * further automatic state saving. * * In order to reenable state saving, call * {@link Gtk.Application.save}. */ forget(): 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` */ get_accels_for_action(detailed_action_name: string): string[]; /** * Returns the list of actions (possibly empty) that the accelerator 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 {@link Gtk.accelerator_parse} first. * @param accel an accelerator that can be parsed by {@link Gtk.accelerator_parse} * @returns 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 */ get_active_window(): Window | null; /** * Gets a menu from automatically loaded resources. * * See [the section on Automatic resources](https://docs.gtk.org/gtk4/class.Application.html#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 | null; /** * Returns the menu model for the menu bar of the application. * @returns the menubar for windows of the application */ get_menubar(): Gio.MenuModel | null; /** * Returns the window with the given ID. * * The ID of a {@link Gtk.ApplicationWindow} can be retrieved with * {@link Gtk.ApplicationWindow.get_id}. * @param id an identifier number * @returns the window for the given ID */ get_window_by_id(id: number): Window | null; /** * Gets a list of the window associated with the 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 the list of windows */ get_windows(): Window[]; /** * Informs 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 {@link 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. * * The `reason` message should be short and to the point. * * If a window is given, the session manager may point the user to * this window to find out more about why the action is inhibited. * * The cookie that is returned by this function should be used as an * argument to {@link Gtk.Application.uninhibit} in order to remove * the request. * @param window a window * @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, or 0 if the platform does not support inhibiting or the request failed for some reason */ inhibit(window: Window | null, flags: ApplicationInhibitFlags, reason: string | null): number; /** * Lists the detailed action names which have associated accelerators. * * See {@link Gtk.Application.set_accels_for_action}. * @returns the detailed action names */ list_action_descriptions(): string[]; /** * Remove a window from the application. * * If the window belongs to the application then this call is * equivalent to setting the {@link Gtk.Window.application} * property of the window to `NULL`. * * The application may stop running as a result of a call to this * function, if the window was the last window of the application. * @param window a window */ remove_window(window: Window): void; /** * Saves the state of application. * * See {@link Gtk.Application.forget} for a way to forget the state. * * If {@link Gtk.Application.register_session} is set, {@link Gtk.Application} * calls this function automatically when the application is closed or * the session ends. */ save(): 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 {@link Gio.Action.parse_detailed_name} * and [Gio.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 {@link Gtk.accelerator_parse} */ set_accels_for_action(detailed_action_name: string, accels: string[]): void; /** * Sets or unsets the menubar for windows of the 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.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 menu model */ set_menubar(menubar: Gio.MenuModel | null): void; /** * Removes an inhibitor that has been previously established. * * See {@link Gtk.Application.inhibit}. * * Inhibitors are also cleared when the application exits. * @param cookie a cookie that was returned by {@link 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 { /** * The handler for this signal should persist any * application-specific state of `window` into `dict`. * * Note that window management state such as maximized, * fullscreen, or window size should not be saved as * part of this, they are handled by GTK. * * You must be careful to be robust in the face of app upgrades and downgrades: * the `state` might have been created by a previous or occasionally even a future * version of your app. Do not assume that a given key exists in the state. * Apps must try to restore state saved by a previous version, but are free to * discard state if it was written by a future version. * * See `Gtk.Application::restore-window`. * @signal * @since 4.24 * @run-last */ "save-state": (arg0: GLib.VariantDict) => boolean | void; "notify::show-menubar": (pspec: GObject.ParamSpec) => void; "notify::application": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::decorated": (pspec: GObject.ParamSpec) => void; "notify::default-height": (pspec: GObject.ParamSpec) => void; "notify::default-widget": (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::display": (pspec: GObject.ParamSpec) => void; "notify::focus-visible": (pspec: GObject.ParamSpec) => void; "notify::focus-widget": (pspec: GObject.ParamSpec) => void; "notify::fullscreened": (pspec: GObject.ParamSpec) => void; "notify::gravity": (pspec: GObject.ParamSpec) => void; "notify::handle-menubar-accel": (pspec: GObject.ParamSpec) => void; "notify::hide-on-close": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-active": (pspec: GObject.ParamSpec) => void; "notify::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::startup-id": (pspec: GObject.ParamSpec) => void; "notify::suspended": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; "notify::titlebar": (pspec: GObject.ParamSpec) => void; "notify::transient-for": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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; } // Constructor properties interface interface ConstructorProps extends Window.ConstructorProps, Gio.ActionGroup.ConstructorProps, Gio.ActionMap.ConstructorProps, Accessible.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps, Native.ConstructorProps, Root.ConstructorProps, ShortcutManager.ConstructorProps { show_menubar: boolean; showMenubar: boolean; } } /** * A {@link Gtk.Window} subclass that integrates with {@link Gtk.Application}. * * Notably, {@link Gtk.ApplicationWindow} can handle an application 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 menu model. * * Note that widgets that are placed inside a {@link Gtk.ApplicationWindow} * can also activate these actions, if they implement the * {@link Gtk.Actionable} interface. * * 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. * * If the desktop environment does not display the menubar, it can be shown in * the {@link Gtk.ApplicationWindow} by setting the * {@link Gtk.ApplicationWindow.show_menubar} property to true. If the * desktop environment does not display the application menu, then it will * automatically be included in the menubar or in the window’s client-side * decorations. * * See {@link Gtk.PopoverMenu} for information about the XML language * used by {@link Gtk.Builder} for menu models. * * See also: {@link Gtk.Application.set_menubar}. * * ## A GtkApplicationWindow with a menubar * * The code sample below shows how to set up a {@link Gtk.ApplicationWindow} * with a menu bar defined on the {@link Gtk.Application}: * * ```c * GtkApplication *app = gtk_application_new ("org.gtk.test", 0); * * GtkBuilder *builder = gtk_builder_new_from_string ( * "" * " " * " " * " _Edit" * " " * " _Copy" * " win.copy" * " " * " " * " _Paste" * " win.paste" * " " * " " * " " * "", * -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); * ``` * @gir-type Class */ class ApplicationWindow extends Window implements Gio.ActionGroup, Gio.ActionMap, Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager { static $gtype: GObject.GType; // Properties /** * If this property is true, the window will display a menubar * unless it is shown by the desktop shell. * * See {@link Gtk.Application.set_menubar}. * * If false, the window will not display a menubar, regardless * of whether the desktop shell is showing it or not. * @default false */ get show_menubar(): boolean; set show_menubar(val: boolean); /** * If this property is true, the window will display a menubar * unless it is shown by the desktop shell. * * See {@link Gtk.Application.set_menubar}. * * If false, the window will not display a menubar, regardless * of whether the desktop shell is showing it or not. * @default false */ 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; // Virtual methods /** * Class closure for the `Gtk.ApplicationWindow::save-state` signal. * @param dict a dictionary where to store the window's state * @virtual */ vfunc_save_state(dict: GLib.VariantDict): boolean; // Methods /** * Gets the {@link Gtk.ShortcutsWindow} that is associated with `window`. * * See {@link Gtk.ApplicationWindow.set_help_overlay}. * @returns the help overlay associated with the window */ 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 the window, or `0` if the window has not yet been added to an application */ get_id(): number; /** * Returns whether the window will display a menubar for the app menu * and menubar as needed. * @returns True if the window will display a menubar when needed */ get_show_menubar(): boolean; /** * Associates a shortcuts window with the application window. * * Additionally, sets up an action with the name * `win.show-help-overlay` to present it. * * The window takes responsibility for destroying the help overlay. * @param help_overlay a shortcuts window */ 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; /** * @param args */ // Conflicted with Gtk.Widget.activate_action activate_action(...args: never[]): any; /** * 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; /** * Returns the renderer that is used for this {@link Gtk.Native}. * @returns the renderer for `self` */ get_renderer(): Gsk.Renderer | null; /** * Returns the surface of this {@link Gtk.Native}. * @returns the surface of `self` */ get_surface(): Gdk.Surface | null; /** * Retrieves the surface transform of `self`. * * This is the translation from `self`'s surface coordinates into * `self`'s widget coordinates. */ get_surface_transform(): [number, number]; /** * Realizes a {@link Gtk.Native}. * * This should only be used by subclasses. */ realize(): void; /** * Unrealizes a {@link Gtk.Native}. * * This should only be used by subclasses. */ unrealize(): void; /** * Returns the display that this {@link Gtk.Root} is on. * @returns the display of `root` */ get_display(): Gdk.Display; /** * Retrieves the current focused widget within the root. * * Note that this is the widget that would have the focus * if the root is active; if the root is not focused then * `gtk_widget_has_focus (widget)` will be `false` for the * widget. * @returns the currently focused widget */ get_focus(): Widget | null; /** * If `focus` is not the current focus widget, and is focusable, sets * it as the focus widget for the root. * * If `focus` is `null`, unsets the focus widget for the root. * * To set the focus to a particular widget in the root, it is usually * more convenient to use {@link Gtk.Widget.grab_focus} instead of * this function. * @param focus widget to be the new focus widget, or `null` to unset the focus widget */ set_focus(focus: Widget | null): void; /** * Add a {@link Gtk.ShortcutController} to be managed. * @param controller * @virtual */ vfunc_add_controller(controller: ShortcutController): void; /** * Remove a {@link Gtk.ShortcutController} that had previously * been added * @param controller * @virtual */ vfunc_remove_controller(controller: ShortcutController): void; } namespace AspectFrame { // Signal signatures interface SignalSignatures extends Widget.SignalSignatures { "notify::child": (pspec: GObject.ParamSpec) => void; "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::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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::accessible-role": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Widget.ConstructorProps, Accessible.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps { child: Widget | null; obey_child: boolean; obeyChild: boolean; ratio: number; xalign: number; yalign: number; } } /** * Preserves the aspect ratio of its child. * * The frame can respect the aspect ratio of the child widget, * or use its own aspect ratio. * * # CSS nodes * * {@link Gtk.AspectFrame} uses a CSS node with name `aspectframe`. * * # Accessibility * * Until GTK 4.10, {@link Gtk.AspectFrame} used the {@link Gtk.AccessibleRole.GROUP} role. * * Starting from GTK 4.12, {@link Gtk.AspectFrame} uses the {@link Gtk.AccessibleRole.GENERIC} role. * @gir-type Class */ class AspectFrame extends Widget implements Accessible, Buildable, ConstraintTarget { static $gtype: GObject.GType; // Properties /** * The child widget. */ get child(): Widget | null; set child(val: Widget | null); /** * Whether the {@link Gtk.AspectFrame} should use the aspect ratio of its child. * @default true */ get obey_child(): boolean; set obey_child(val: boolean); /** * Whether the {@link Gtk.AspectFrame} should use the aspect ratio of its child. * @default true */ get obeyChild(): boolean; set obeyChild(val: boolean); /** * The aspect ratio to be used by the {@link Gtk.AspectFrame}. * * This property is only used if * {@link Gtk.AspectFrame.obey_child} is set to `false`. * @default 1 */ get ratio(): number; set ratio(val: number); /** * The horizontal alignment of the child. * @default 0.5 */ get xalign(): number; set xalign(val: number); /** * The vertical alignment of the child. * @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; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](xalign: number, yalign: number, ratio: number, obey_child: boolean): AspectFrame; // 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 widget of `self`. * @returns the child widget of `self` */ get_child(): Widget | null; /** * Returns whether the child's size request should override * the set aspect ratio of the {@link Gtk.AspectFrame}. * @returns whether to obey the child's size request */ get_obey_child(): boolean; /** * Returns the desired aspect ratio of the child. * @returns the desired aspect ratio */ get_ratio(): number; /** * Returns the horizontal alignment of the child within the * allocation of the {@link Gtk.AspectFrame}. * @returns the horizontal alignment */ get_xalign(): number; /** * Returns the vertical alignment of the child within the * allocation of the {@link Gtk.AspectFrame}. * @returns the vertical alignment */ get_yalign(): number; /** * Sets the child widget of `self`. * @param child the child widget */ set_child(child: Widget | null): void; /** * Sets whether the aspect ratio of the child's size * request should override the set aspect ratio of * the {@link Gtk.AspectFrame}. * @param obey_child If `true`, `ratio` is ignored, and the aspect ratio is taken from the requisition of the child. */ set_obey_child(obey_child: boolean): void; /** * Sets the desired aspect ratio of the child. * @param ratio aspect ratio of the child */ set_ratio(ratio: number): void; /** * Sets the horizontal alignment of the child within the allocation * of the {@link Gtk.AspectFrame}. * @param xalign horizontal alignment, from 0.0 (left aligned) to 1.0 (right aligned) */ set_xalign(xalign: number): void; /** * Sets the vertical alignment of the child within the allocation * of the {@link Gtk.AspectFrame}. * @param yalign horizontal alignment, from 0.0 (top aligned) to 1.0 (bottom aligned) */ set_yalign(yalign: number): void; /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessible_role(): AccessibleRole; set accessible_role(val: AccessibleRole); /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessibleRole(): AccessibleRole; set accessibleRole(val: AccessibleRole); /** * Requests the user's screen reader to announce the given message. * * This kind of notification is useful for messages that * either have only a visual representation or that are not * exposed visually at all, e.g. a notification about a * successful operation. * * Also, by using this API, you can ensure that the message * does not interrupts the user's current screen reader output. * @param message the string to announce * @param priority the priority of the announcement */ announce(message: string, priority: AccessibleAnnouncementPriority): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @returns the accessible identifier */ get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @returns the accessible parent */ get_accessible_parent(): Accessible | null; /** * Retrieves the accessible role of an accessible object. * @returns the accessible role */ get_accessible_role(): AccessibleRole; /** * Retrieves the implementation for the given accessible object. * @returns the accessible implementation object */ get_at_context(): ATContext; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @returns true if the bounds are valid, and false otherwise */ get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @returns the first accessible child */ get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @returns the next accessible sibling */ get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @returns the value of state for the accessible */ get_platform_state(state: AccessiblePlatformState): boolean; /** * Resets the accessible property to its default value. * @param property the accessible property */ reset_property(property: AccessibleProperty): void; /** * Resets the accessible relation to its default value. * @param relation the accessible relation */ reset_relation(relation: AccessibleRelation): void; /** * Resets the accessible state to its default value. * @param state the accessible state */ reset_state(state: AccessibleState): void; /** * Sets the parent and sibling of an accessible object. * * This function is meant to be used by accessible implementations that are * not part of the widget hierarchy, and but act as a logical bridge between * widgets. For instance, if a widget creates an object that holds metadata * for each child, and you want that object to implement the {@link Gtk.Accessible} * interface, you will use this function to ensure that the parent of each * child widget is the metadata object, and the parent of each metadata * object is the container widget. * @param parent the parent accessible object * @param next_sibling the sibling accessible object */ set_accessible_parent(parent: Accessible | null, next_sibling: Accessible | null): void; /** * Updates the next accessible sibling. * * That might be useful when a new child of a custom accessible * is created, and it needs to be linked to a previous child. * @param new_sibling the new next accessible sibling to set */ update_next_accessible_sibling(new_sibling: Accessible | null): void; /** * Informs ATs that the platform state has changed. * * This function should be used by {@link Gtk.Accessible} implementations that * have a platform state but are not widgets. Widgets handle platform * states automatically. * @param state the platform state to update */ update_platform_state(state: AccessiblePlatformState): void; /** * Updates an array of accessible properties. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * property change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param properties an array of accessible properties * @param values an array of `GValues`, one for each property */ update_property(properties: AccessibleProperty[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible relations. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * relation change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param relations an array of accessible relations * @param values an array of `GValues`, one for each relation */ update_relation(relations: AccessibleRelation[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible states. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * state change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param states an array of accessible states * @param values an array of `GValues`, one for each state */ update_state(states: AccessibleState[], values: (GObject.Value | any)[]): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @virtual */ vfunc_get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @virtual */ vfunc_get_accessible_parent(): Accessible | null; /** * Retrieves the implementation for the given accessible object. * @virtual */ vfunc_get_at_context(): ATContext | null; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @virtual */ vfunc_get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @virtual */ vfunc_get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @virtual */ vfunc_get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @virtual */ vfunc_get_platform_state(state: AccessiblePlatformState): boolean; /** * Gets the ID of the `buildable` object. * * {@link Gtk.Builder} sets the name based on the ID attribute * of the `` tag used to construct the `buildable`. * @returns the ID of the buildable object */ get_buildable_id(): string | null; /** * 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; /** * 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; /** * 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; /** * 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, BuildableParser, never]; /** * The getter corresponding to `set_id`. Implement this * if you implement `set_id`. * @virtual */ vfunc_get_id(): string; /** * Retrieves 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; /** * Called when a builder finishes the parsing * of a UI definition. It is normally not necessary to implement this, * unless you need to perform special cleanup actions. {@link Gtk.Window} sets * the {@link Gtk.Widget.visible} property here. * @param builder * @virtual */ vfunc_parser_finished(builder: Builder): void; /** * Sets a property of a buildable object. * It is normally not necessary to implement this, `g_object_set_property()` * is used by default. {@link Gtk.Window} implements this to delay showing itself * (i.e. setting the {@link Gtk.Widget.visible} property) until the whole * interface is created. * @param builder * @param name * @param value * @virtual */ vfunc_set_buildable_property(builder: Builder, name: string, value: unknown): void; /** * Stores the id attribute given in the {@link Gtk.Builder} UI definition. * {@link Gtk.Widget} stores the name as object data. Implement this method if your * object has some notion of “ID” and it makes sense to map the XML id * attribute to it. * @param id * @virtual */ vfunc_set_id(id: string): void; } namespace Assistant { // Signal signatures interface SignalSignatures extends Window.SignalSignatures { /** * 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 `Gtk.Assistant::prepare` signal of * the progress page. * @signal * @deprecated since 4.10: This widget will be removed in GTK 5 * @run-last */ apply: () => void; /** * Emitted when then the cancel button is clicked. * @signal * @deprecated since 4.10: This widget will be removed in GTK 5 * @run-last */ cancel: () => void; /** * 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 * @deprecated since 4.10: This widget will be removed in GTK 5 * @run-last */ close: () => void; /** * The action signal for the Escape binding. * @signal * @deprecated since 4.10: This widget will be removed in GTK 5 * @action * @run-first */ escape: () => void; /** * 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 * @deprecated since 4.10: This widget will be removed in GTK 5 * @run-last */ prepare: (arg0: Widget) => void; "notify::pages": (pspec: GObject.ParamSpec) => void; "notify::use-header-bar": (pspec: GObject.ParamSpec) => void; "notify::application": (pspec: GObject.ParamSpec) => void; "notify::child": (pspec: GObject.ParamSpec) => void; "notify::decorated": (pspec: GObject.ParamSpec) => void; "notify::default-height": (pspec: GObject.ParamSpec) => void; "notify::default-widget": (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::display": (pspec: GObject.ParamSpec) => void; "notify::focus-visible": (pspec: GObject.ParamSpec) => void; "notify::focus-widget": (pspec: GObject.ParamSpec) => void; "notify::fullscreened": (pspec: GObject.ParamSpec) => void; "notify::gravity": (pspec: GObject.ParamSpec) => void; "notify::handle-menubar-accel": (pspec: GObject.ParamSpec) => void; "notify::hide-on-close": (pspec: GObject.ParamSpec) => void; "notify::icon-name": (pspec: GObject.ParamSpec) => void; "notify::is-active": (pspec: GObject.ParamSpec) => void; "notify::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::startup-id": (pspec: GObject.ParamSpec) => void; "notify::suspended": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; "notify::titlebar": (pspec: GObject.ParamSpec) => void; "notify::transient-for": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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; } // Constructor properties interface interface ConstructorProps extends Window.ConstructorProps, Accessible.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps, Native.ConstructorProps, Root.ConstructorProps, ShortcutManager.ConstructorProps { pages: Gio.ListModel; use_header_bar: number; useHeaderBar: number; } } /** * {@link Gtk.Assistant} is used to represent a complex as a series of steps. * * * * An example GtkAssistant * * * Each step consists of one or more pages. {@link Gtk.Assistant} guides the user * through the pages, and controls the page flow to collect the data needed * for the operation. * * {@link Gtk.Assistant} handles which buttons to show and to make sensitive based * on page sequence knowledge and the {@link Gtk.AssistantPageType} of each * page in addition to state information like the *completed* and *committed* * page statuses. * * If you have a case that doesn’t quite fit in {@link Gtk.Assistant}s way of * handling buttons, you can use the {@link Gtk.AssistantPageType.CUSTOM} page * type and handle buttons yourself. * * {@link Gtk.Assistant} maintains a {@link Gtk.AssistantPage} object for each added * child, which holds additional per-child properties. You * obtain the {@link Gtk.AssistantPage} for a child with {@link Gtk.Assistant.get_page}. * * # GtkAssistant as GtkBuildable * * The {@link Gtk.Assistant} 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 {@link Gtk.Assistant} object. If you need to set per-object * properties, create a {@link Gtk.AssistantPage} object explicitly, and * set the child widget as a property on it. * * # CSS nodes * * {@link Gtk.Assistant} has a single CSS node with the name window and style * class .assistant. * @gir-type Class * @deprecated since 4.10: This widget will be removed in GTK 5 */ class Assistant extends Window implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager { static $gtype: GObject.GType; // Properties /** * {@link Gio.ListModel} containing the pages. * @read-only */ get pages(): Gio.ListModel; /** * `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`. * @deprecated since 4.10: This widget will be removed in GTK 5 * @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`. * @deprecated since 4.10: This widget will be removed in GTK 5 * @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; // 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. * * GTK will then hide the back button 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; /** * Returns the {@link Gtk.AssistantPage} object for `child`. * @param child a child of `assistant` * @returns the {@link Gtk.AssistantPage} for `child` */ get_page(child: Widget): AssistantPage; /** * Gets whether `page` is complete. * @param page a page of `assistant` * @returns `true` if `page` is complete. */ get_page_complete(page: Widget): boolean; /** * 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; /** * Gets a list model of the assistant pages. * @returns A list model of the pages. */ get_pages(): Gio.ListModel; /** * 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 * {@link Gtk.AssistantPageType.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 * {@link Gtk.AssistantPageType.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 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; /** * Returns the renderer that is used for this {@link Gtk.Native}. * @returns the renderer for `self` */ get_renderer(): Gsk.Renderer | null; /** * Returns the surface of this {@link Gtk.Native}. * @returns the surface of `self` */ get_surface(): Gdk.Surface | null; /** * Retrieves the surface transform of `self`. * * This is the translation from `self`'s surface coordinates into * `self`'s widget coordinates. */ get_surface_transform(): [number, number]; /** * Realizes a {@link Gtk.Native}. * * This should only be used by subclasses. */ realize(): void; /** * Unrealizes a {@link Gtk.Native}. * * This should only be used by subclasses. */ unrealize(): void; /** * Returns the display that this {@link Gtk.Root} is on. * @returns the display of `root` */ get_display(): Gdk.Display; /** * Retrieves the current focused widget within the root. * * Note that this is the widget that would have the focus * if the root is active; if the root is not focused then * `gtk_widget_has_focus (widget)` will be `false` for the * widget. * @returns the currently focused widget */ get_focus(): Widget | null; /** * If `focus` is not the current focus widget, and is focusable, sets * it as the focus widget for the root. * * If `focus` is `null`, unsets the focus widget for the root. * * To set the focus to a particular widget in the root, it is usually * more convenient to use {@link Gtk.Widget.grab_focus} instead of * this function. * @param focus widget to be the new focus widget, or `null` to unset the focus widget */ set_focus(focus: Widget | null): void; /** * Add a {@link Gtk.ShortcutController} to be managed. * @param controller * @virtual */ vfunc_add_controller(controller: ShortcutController): void; /** * Remove a {@link Gtk.ShortcutController} that had previously * been added * @param controller * @virtual */ vfunc_remove_controller(controller: ShortcutController): void; } namespace AssistantPage { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { "notify::child": (pspec: GObject.ParamSpec) => void; "notify::complete": (pspec: GObject.ParamSpec) => void; "notify::page-type": (pspec: GObject.ParamSpec) => void; "notify::title": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { child: Widget; complete: boolean; page_type: AssistantPageType; pageType: AssistantPageType; title: string; } } /** * {@link Gtk.AssistantPage} is an auxiliary object used by {@link Gtk.Assistant}. * @gir-type Class * @deprecated since 4.10: This object will be removed in GTK 5 */ class AssistantPage extends GObject.Object { static $gtype: GObject.GType; // Properties /** * The child widget. * @deprecated since 4.10: This object will be removed in GTK 5 * @construct-only */ get child(): Widget; /** * Whether all required fields are filled in. * * GTK uses this information to control the sensitivity * of the navigation buttons. * @deprecated since 4.10: This object will be removed in GTK 5 * @default false */ get complete(): boolean; set complete(val: boolean); /** * The type of the assistant page. * @deprecated since 4.10: This object will be removed in GTK 5 * @default Gtk.AssistantPageType.CONTENT */ get page_type(): AssistantPageType; set page_type(val: AssistantPageType); /** * The type of the assistant page. * @deprecated since 4.10: This object will be removed in GTK 5 * @default Gtk.AssistantPageType.CONTENT */ get pageType(): AssistantPageType; set pageType(val: AssistantPageType); /** * The title of the page. * @deprecated since 4.10: This object will be removed in GTK 5 * @default null */ get title(): string; set title(val: string); /** * 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: AssistantPage.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; // Methods /** * Returns the child to which `page` belongs. * @returns the child to which `page` belongs */ get_child(): Widget; } namespace BinLayout { // Signal signatures interface SignalSignatures extends LayoutManager.SignalSignatures {} // Constructor properties interface interface ConstructorProps extends LayoutManager.ConstructorProps {} } /** * A layout manager for widgets with a single child. * * {@link Gtk.BinLayout} will stack each child of a widget on top of each other, * using the {@link Gtk.Widget.hexpand}, {@link Gtk.Widget.vexpand}, * {@link Gtk.Widget.halign}, and {@link Gtk.Widget.valign} properties * of each child to determine where they should be positioned. * @gir-type Class */ class BinLayout extends LayoutManager { 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: BinLayout.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](): BinLayout; // 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 BookmarkList { // Signal signatures interface SignalSignatures extends GObject.Object.SignalSignatures { "notify::attributes": (pspec: GObject.ParamSpec) => void; "notify::filename": (pspec: GObject.ParamSpec) => void; "notify::io-priority": (pspec: GObject.ParamSpec) => void; "notify::item-type": (pspec: GObject.ParamSpec) => void; "notify::loading": (pspec: GObject.ParamSpec) => void; "notify::n-items": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, Gio.ListModel.ConstructorProps { attributes: string | null; filename: string; io_priority: number; ioPriority: number; item_type: GObject.GTypeInput; itemType: GObject.GTypeInput; loading: boolean; n_items: number; nItems: number; } } /** * A list model that wraps {@link GLib.BookmarkFile}. * * It presents a {@link Gio.ListModel} and fills it asynchronously with the * {@link Gio.FileInfo}s returned from that function. * * The {@link Gio.FileInfo}s in the list have some attributes in the recent * namespace added: `recent::private` (boolean) and `recent:applications` * (stringv). * @gir-type Class */ class BookmarkList extends GObject.Object implements Gio.ListModel { static $gtype: GObject.GType; // Properties /** * The attributes to query. * @default null */ get attributes(): string | null; set attributes(val: string | null); /** * The bookmark file to load. * @construct-only * @default null */ get filename(): string; /** * Priority used when loading. * @default 0 */ get io_priority(): number; set io_priority(val: number); /** * Priority used when loading. * @default 0 */ get ioPriority(): number; set ioPriority(val: number); /** * The type of items. See {@link Gio.ListModel.get_item_type}. * @since 4.8 * @read-only */ get item_type(): GObject.GType; /** * The type of items. See {@link Gio.ListModel.get_item_type}. * @since 4.8 * @read-only */ get itemType(): GObject.GType; /** * `true` if files are being loaded. * @read-only * @default false */ get loading(): boolean; /** * The number of items. See {@link Gio.ListModel.get_n_items}. * @since 4.8 * @read-only * @default 0 */ get n_items(): number; /** * The number of items. See {@link Gio.ListModel.get_n_items}. * @since 4.8 * @read-only * @default 0 */ get nItems(): 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: BookmarkList.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](filename: string | null, attributes: string | null): BookmarkList; // 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 attributes queried on the children. * @returns The queried attributes */ get_attributes(): string | null; /** * Returns the filename of the bookmark file that * this list is loading. * @returns the filename of the .xbel file */ get_filename(): string; /** * Gets the IO priority to use while loading file. * @returns The IO priority. */ get_io_priority(): number; /** * Returns `true` if the files are currently being loaded. * * Files will be added to `self` from time to time while loading is * going on. The order in which are added is undefined and may change * in between runs. * @returns `true` if `self` is loading */ is_loading(): boolean; /** * Sets the `attributes` to be enumerated and starts the enumeration. * * If `attributes` is `null`, no attributes will be queried, but a list * of {@link Gio.FileInfo}s will still be created. * @param attributes the attributes to enumerate */ set_attributes(attributes: string | null): void; /** * Sets the IO priority to use while loading files. * * The default IO priority is `G_PRIORITY_DEFAULT`. * @param io_priority IO priority to use */ set_io_priority(io_priority: number): void; /** * Gets the type of the items in `list`. * * All items returned from `g_list_model_get_item()` are of the type * returned by this function, or a subtype, or if the type is an * interface, they are an implementation of that interface. * * The item type of a {@link Gio.ListModel} can not change during the life of the * model. * @returns the {@link GObject.GType} of the items contained in `list`. */ get_item_type(): GObject.GType; /** * Gets the number of items in `list`. * * Depending on the model implementation, calling this function may be * less efficient than iterating the list with increasing values for * `position` until `g_list_model_get_item()` returns `null`. * @returns the number of items in `list`. */ get_n_items(): number; /** * Get the item at `position`. * * If `position` is greater than the number of items in `list`, `null` is * returned. * * `null` is never returned for an index that is smaller than the length * of the list. * * This function is meant to be used by language bindings in place * of `g_list_model_get_item()`. * * See also: `g_list_model_get_n_items()` * @param position the position of the item to fetch * @returns the object at `position`. */ get_item(position: number): A | null; /** * Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`. * * This function should only be called by classes implementing * {@link Gio.ListModel}. It has to be called after the internal representation * of `list` has been updated, because handlers connected to this signal * might query the new state of the list. * * Implementations must only make changes to the model (as visible to * its consumer) in places that will not cause problems for that * consumer. For models that are driven directly by a write API (such * as {@link Gio.ListStore}), changes can be reported in response to uses of that * API. For models that represent remote data, changes should only be * made from a fresh mainloop dispatch. It is particularly not * permitted to make changes in response to a call to the {@link Gio.ListModel} * consumer API. * * Stated another way: in general, it is assumed that code making a * series of accesses to the model via the API, without returning to the * mainloop, and without calling other code, will continue to view the * same contents of the model. * @param position the position at which `list` changed * @param removed the number of items removed * @param added the number of items added */ items_changed(position: number, removed: number, added: number): void; /** * Get the item at `position`. If `position` is greater than the number of * items in `list`, `null` is returned. * * `null` is never returned for an index that is smaller than the length * of the list. See `g_list_model_get_n_items()`. * * The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}. * @param position the position of the item to fetch * @virtual */ vfunc_get_item(position: number): A | null; /** * Gets the type of the items in `list`. * * All items returned from `g_list_model_get_item()` are of the type * returned by this function, or a subtype, or if the type is an * interface, they are an implementation of that interface. * * The item type of a {@link Gio.ListModel} can not change during the life of the * model. * @virtual */ vfunc_get_item_type(): GObject.GType; /** * Gets the number of items in `list`. * * Depending on the model implementation, calling this function may be * less efficient than iterating the list with increasing values for * `position` until `g_list_model_get_item()` returns `null`. * @virtual */ vfunc_get_n_items(): number; } namespace BoolFilter { // Signal signatures interface SignalSignatures extends Filter.SignalSignatures { "notify::expression": (pspec: GObject.ParamSpec) => void; "notify::invert": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Filter.ConstructorProps { expression: Expression | null; invert: boolean; } } /** * Evaluates a boolean expression to determine whether to include items. * @gir-type Class */ class BoolFilter extends Filter { static $gtype: GObject.GType; // Properties /** * The boolean expression to evaluate on each item. */ get expression(): Expression | null; set expression(val: Expression | null); /** * If the expression result should be inverted. * @default false */ get invert(): boolean; set invert(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: BoolFilter.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](expression: Expression | null): BoolFilter; // 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 expression that the filter evaluates for * each item. * @returns the expression */ get_expression(): Expression | null; /** * Returns whether the filter inverts the expression. * @returns true if the filter inverts */ get_invert(): boolean; /** * Sets the expression that the filter uses to check if items * should be filtered. * * The expression must have a value type of `G_TYPE_BOOLEAN`. * @param expression the expression */ set_expression(expression: Expression | null): void; /** * Sets whether the filter should invert the expression. * @param invert true to invert */ set_invert(invert: boolean): void; } namespace Box { // Signal signatures interface SignalSignatures extends Widget.SignalSignatures { "notify::baseline-child": (pspec: GObject.ParamSpec) => void; "notify::baseline-position": (pspec: GObject.ParamSpec) => void; "notify::homogeneous": (pspec: GObject.ParamSpec) => void; "notify::spacing": (pspec: GObject.ParamSpec) => void; "notify::can-focus": (pspec: GObject.ParamSpec) => void; "notify::can-target": (pspec: GObject.ParamSpec) => void; "notify::css-classes": (pspec: GObject.ParamSpec) => void; "notify::css-name": (pspec: GObject.ParamSpec) => void; "notify::cursor": (pspec: GObject.ParamSpec) => void; "notify::focus-on-click": (pspec: GObject.ParamSpec) => void; "notify::focusable": (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::layout-manager": (pspec: GObject.ParamSpec) => void; "notify::limit-events": (pspec: GObject.ParamSpec) => void; "notify::margin-bottom": (pspec: GObject.ParamSpec) => void; "notify::margin-end": (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::opacity": (pspec: GObject.ParamSpec) => void; "notify::overflow": (pspec: GObject.ParamSpec) => void; "notify::parent": (pspec: GObject.ParamSpec) => void; "notify::receives-default": (pspec: GObject.ParamSpec) => void; "notify::root": (pspec: GObject.ParamSpec) => void; "notify::scale-factor": (pspec: GObject.ParamSpec) => void; "notify::sensitive": (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::accessible-role": (pspec: GObject.ParamSpec) => void; "notify::orientation": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends Widget.ConstructorProps, Accessible.ConstructorProps, Buildable.ConstructorProps, ConstraintTarget.ConstructorProps, Orientable.ConstructorProps { baseline_child: number; baselineChild: number; baseline_position: BaselinePosition; baselinePosition: BaselinePosition; homogeneous: boolean; spacing: number; } } /** * Arranges child widgets into a single row or column. * * * * An example GtkBox * * * Whether it is a row or column depends on the value of its * {@link Gtk.Orientable.orientation} property. Within the other * dimension, all children are allocated the same size. The * {@link Gtk.Widget.halign} and {@link Gtk.Widget.valign} * properties can be used on the children to influence their allocation. * * Use repeated calls to {@link Gtk.Box.append} to pack widgets into a * {@link Gtk.Box} from start to end. Use {@link Gtk.Box.remove} to remove widgets * from the {@link Gtk.Box}. {@link Gtk.Box.insert_child_after} can be used to add * a child at a particular position. * * Use {@link Gtk.Box.set_homogeneous} to specify whether or not all children * of the {@link Gtk.Box} are forced to get the same amount of space. * * Use {@link Gtk.Box.set_spacing} to determine how much space will be minimally * placed between all children in the {@link Gtk.Box}. Note that spacing is added * *between* the children. * * Use {@link Gtk.Box.reorder_child_after} to move a child to a different * place in the box. * * # CSS nodes * * {@link Gtk.Box} uses a single CSS node with name box. * * # Accessibility * * Until GTK 4.10, {@link Gtk.Box} used the {@link Gtk.AccessibleRole.GROUP} role. * * Starting from GTK 4.12, {@link Gtk.Box} uses the {@link Gtk.AccessibleRole.GENERIC} role. * @gir-type Class */ class Box extends Widget implements Accessible, Buildable, ConstraintTarget, Orientable { static $gtype: GObject.GType; // Properties /** * The position of the child that determines the baseline. * * This is only relevant if the box is in vertical orientation. * @since 4.12 * @default -1 */ get baseline_child(): number; set baseline_child(val: number); /** * The position of the child that determines the baseline. * * This is only relevant if the box is in vertical orientation. * @since 4.12 * @default -1 */ get baselineChild(): number; set baselineChild(val: number); /** * How to position baseline-aligned widgets if extra space is available. * @default Gtk.BaselinePosition.CENTER */ get baseline_position(): BaselinePosition; set baseline_position(val: BaselinePosition); /** * How to position baseline-aligned widgets if extra space is available. * @default Gtk.BaselinePosition.CENTER */ get baselinePosition(): BaselinePosition; set baselinePosition(val: BaselinePosition); /** * Whether the children should all be the same size. * @default false */ get homogeneous(): boolean; set homogeneous(val: boolean); /** * The amount of space between children. * @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; // 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 /** * Adds a child at the end. * @param child the widget to append */ append(child: Widget): void; /** * Gets the value set by {@link Gtk.Box.set_baseline_child}. * @returns the baseline child */ get_baseline_child(): number; /** * Gets the value set by {@link Gtk.Box.set_baseline_position}. * @returns the baseline position */ get_baseline_position(): BaselinePosition; /** * Returns whether the box is homogeneous. * * In a homogeneous box all children are the same size. * @returns true if the box is homogeneous */ get_homogeneous(): boolean; /** * Gets the value set by {@link Gtk.Box.set_spacing}. * @returns spacing between children */ get_spacing(): number; /** * Inserts a child at a specific position. * * The child is added after `sibling` in the list of `box` children. * * If `sibling` is `NULL`, the `child` is placed at the beginning. * @param child the widget to insert * @param sibling the sibling after which to insert `child` */ insert_child_after(child: Widget, sibling: Widget | null): void; /** * Adds a child at the beginning. * @param child the widget to prepend */ prepend(child: Widget): void; /** * Removes a child widget from the box. * * The child must have been added before with * {@link Gtk.Box.append}, {@link Gtk.Box.prepend}, or * {@link Gtk.Box.insert_child_after}. * @param child the child to remove */ remove(child: Widget): void; /** * Moves a child to a different position. * * The child is moved to the position after `sibling` in the list * of `box` children. * * If `sibling` is `NULL`, the child is placed at the beginning. * @param child the widget to move, must be a child of `box` * @param sibling the sibling to move `child` after */ reorder_child_after(child: Widget, sibling: Widget | null): void; /** * Sets the baseline child of a box. * * This affects only vertical boxes. * @param child a child position, or -1 */ set_baseline_child(child: 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 with respect to the * extra space available. * @param position the baseline position */ set_baseline_position(position: BaselinePosition): void; /** * Sets whether or not all children are given equal space * in the box. * @param homogeneous true to create equal allotments, false for variable allotments */ set_homogeneous(homogeneous: boolean): void; /** * Sets the number of pixels to place between children. * @param spacing the number of pixels to put between children */ set_spacing(spacing: number): void; /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessible_role(): AccessibleRole; set accessible_role(val: AccessibleRole); /** * The accessible role of the given {@link Gtk.Accessible} implementation. * * The accessible role cannot be changed once set. * @default Gtk.AccessibleRole.NONE * @category Inherited from Gtk.Accessible */ get accessibleRole(): AccessibleRole; set accessibleRole(val: AccessibleRole); /** * The orientation of the orientable. * @default Gtk.Orientation.HORIZONTAL * @category Inherited from Gtk.Orientable */ get orientation(): Orientation; set orientation(val: Orientation); /** * Requests the user's screen reader to announce the given message. * * This kind of notification is useful for messages that * either have only a visual representation or that are not * exposed visually at all, e.g. a notification about a * successful operation. * * Also, by using this API, you can ensure that the message * does not interrupts the user's current screen reader output. * @param message the string to announce * @param priority the priority of the announcement */ announce(message: string, priority: AccessibleAnnouncementPriority): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @returns the accessible identifier */ get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @returns the accessible parent */ get_accessible_parent(): Accessible | null; /** * Retrieves the accessible role of an accessible object. * @returns the accessible role */ get_accessible_role(): AccessibleRole; /** * Retrieves the implementation for the given accessible object. * @returns the accessible implementation object */ get_at_context(): ATContext; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @returns true if the bounds are valid, and false otherwise */ get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @returns the first accessible child */ get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @returns the next accessible sibling */ get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @returns the value of state for the accessible */ get_platform_state(state: AccessiblePlatformState): boolean; /** * Resets the accessible property to its default value. * @param property the accessible property */ reset_property(property: AccessibleProperty): void; /** * Resets the accessible relation to its default value. * @param relation the accessible relation */ reset_relation(relation: AccessibleRelation): void; /** * Resets the accessible state to its default value. * @param state the accessible state */ reset_state(state: AccessibleState): void; /** * Sets the parent and sibling of an accessible object. * * This function is meant to be used by accessible implementations that are * not part of the widget hierarchy, and but act as a logical bridge between * widgets. For instance, if a widget creates an object that holds metadata * for each child, and you want that object to implement the {@link Gtk.Accessible} * interface, you will use this function to ensure that the parent of each * child widget is the metadata object, and the parent of each metadata * object is the container widget. * @param parent the parent accessible object * @param next_sibling the sibling accessible object */ set_accessible_parent(parent: Accessible | null, next_sibling: Accessible | null): void; /** * Updates the next accessible sibling. * * That might be useful when a new child of a custom accessible * is created, and it needs to be linked to a previous child. * @param new_sibling the new next accessible sibling to set */ update_next_accessible_sibling(new_sibling: Accessible | null): void; /** * Informs ATs that the platform state has changed. * * This function should be used by {@link Gtk.Accessible} implementations that * have a platform state but are not widgets. Widgets handle platform * states automatically. * @param state the platform state to update */ update_platform_state(state: AccessiblePlatformState): void; /** * Updates an array of accessible properties. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * property change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param properties an array of accessible properties * @param values an array of `GValues`, one for each property */ update_property(properties: AccessibleProperty[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible relations. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * relation change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param relations an array of accessible relations * @param values an array of `GValues`, one for each relation */ update_relation(relations: AccessibleRelation[], values: (GObject.Value | any)[]): void; /** * Updates an array of accessible states. * * This function should be called by {@link Gtk.Widget} types whenever an accessible * state change must be communicated to assistive technologies. * * This function is meant to be used by language bindings. * @param states an array of accessible states * @param values an array of `GValues`, one for each state */ update_state(states: AccessibleState[], values: (GObject.Value | any)[]): void; /** * Retrieves the accessible identifier for the accessible object. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations. * * It is left to the accessible implementation to define the scope * and uniqueness of the identifier. * @virtual */ vfunc_get_accessible_id(): string | null; /** * Retrieves the accessible parent for an accessible object. * * This function returns `NULL` for top level widgets. * @virtual */ vfunc_get_accessible_parent(): Accessible | null; /** * Retrieves the implementation for the given accessible object. * @virtual */ vfunc_get_at_context(): ATContext | null; /** * Queries the coordinates and dimensions of this accessible * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get the bounds from an ignored * child widget. * @virtual */ vfunc_get_bounds(): [boolean, number, number, number, number]; /** * Retrieves the first accessible child of an accessible object. * @virtual */ vfunc_get_first_accessible_child(): Accessible | null; /** * Retrieves the next accessible sibling of an accessible object * @virtual */ vfunc_get_next_accessible_sibling(): Accessible | null; /** * Queries a platform state, such as focus. * * This functionality can be overridden by {@link Gtk.Accessible} * implementations, e.g. to get platform state from an ignored * child widget, as is the case for {@link Gtk.Text} wrappers. * @param state platform state to query * @virtual */ vfunc_get_platform_state(state: AccessiblePlatformState): boolean; /** * Gets the ID of the `buildable` object. * * {@link Gtk.Builder} sets the name based on the ID attribute * of the `` tag used to construct the `buildable`. * @returns the ID of the buildable object */ get_buildable_id(): string | null; /** * 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; /** * 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; /** * 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; /** * 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, BuildableParser, never]; /** * The getter corresponding to `set_id`. Implement this * if you implement `set_id`. * @virtual */ vfunc_get_id(): string; /** * Retrieves 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; /** * Called when a builder finishes the parsing * of a UI definition. It is normally not necessary to implement this, * unless you need to perform special cleanup actions. {@link Gtk.Window} sets * the {@link Gtk.Widget.visible} property here. * @param builder * @virtual */ vfunc_parser_finished(builder: Builder): void; /** * Sets a property of a buildable object. * It is normally not necessary to implement this, `g_object_set_property()` * is used by default. {@link Gtk.Window} implements this to delay showing itself * (i.e. setting the {@link Gtk.Widget.visible} property) until the whole * interface is created. * @param builder * @param name * @param value * @virtual */ vfunc_set_buildable_property(builder: Builder, name: string, value: unknown): void; /** * Stores the id attribute given in the {@link Gtk.Builder} UI definition. * {@link Gtk.Widget} stores the name as object data. Implement this method if your * object has some notion of “ID” and it makes sense to map the XML id * attribute to it. * @param id * @virtual */ vfunc_set_id(id: string): 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; } namespace BoxLayout { // Signal signatures interface SignalSignatures extends LayoutManager.SignalSignatures { "notify::baseline-child": (pspec: GObject.ParamSpec) => void; "notify::baseline-position": (pspec: GObject.ParamSpec) => void; "notify::homogeneous": (pspec: GObject.ParamSpec) => void; "notify::spacing": (pspec: GObject.ParamSpec) => void; "notify::orientation": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends LayoutManager.ConstructorProps, Orientable.ConstructorProps { baseline_child: number; baselineChild: number; baseline_position: BaselinePosition; baselinePosition: BaselinePosition; homogeneous: boolean; spacing: number; } } /** * Arranges children in a single row or column. * * Whether it is a row or column depends on the value of its * {@link Gtk.Orientable.orientation} property. Within the other dimension * all children all allocated the same size. The {@link Gtk.BoxLayout} will respect * the {@link Gtk.Widget.halign} and {@link Gtk.Widget.valign} * properties of each child widget. * * If you want all children to be assigned the same size, you can use * the {@link Gtk.BoxLayout.homogeneous} property. * * If you want to specify the amount of space placed between each child, * you can use the {@link Gtk.BoxLayout.spacing} property. * @gir-type Class */ class BoxLayout extends LayoutManager implements Orientable { static $gtype: GObject.GType; // Properties /** * The child that determines the baseline of the box * in vertical layout. * * If the child does baseline positioning, then its baseline * is lined up with the baseline of the box. If it doesn't, then * the bottom edge of the child is used. * @since 4.12 * @default -1 */ get baseline_child(): number; set baseline_child(val: number); /** * The child that determines the baseline of the box * in vertical layout. * * If the child does baseline positioning, then its baseline * is lined up with the baseline of the box. If it doesn't, then * the bottom edge of the child is used. * @since 4.12 * @default -1 */ get baselineChild(): number; set baselineChild(val: number); /** * The position of the allocated baseline within the extra space * allocated to each child. * * This property is only relevant for horizontal layouts containing * at least one child with a baseline alignment. * @default Gtk.BaselinePosition.CENTER */ get baseline_position(): BaselinePosition; set baseline_position(val: BaselinePosition); /** * The position of the allocated baseline within the extra space * allocated to each child. * * This property is only relevant for horizontal layouts containing * at least one child with a baseline alignment. * @default Gtk.BaselinePosition.CENTER */ get baselinePosition(): BaselinePosition; set baselinePosition(val: BaselinePosition); /** * Whether the box layout should distribute the available space * equally among the children. * @default false */ get homogeneous(): boolean; set homogeneous(val: boolean); /** * The space to put between the children. * @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: BoxLayout.SignalSignatures; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ["new"](orientation: Orientation): BoxLayout; // 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_layout_set_baseline_child()`. * @returns the index of the child that determines the baseline in vertical layout, or -1 */ get_baseline_child(): number; /** * Gets the value set by `gtk_box_layout_set_baseline_position()`. * @returns the baseline position */ get_baseline_position(): BaselinePosition; /** * Returns whether the layout is set to be homogeneous. * @returns `true` if the layout is homogeneous */ get_homogeneous(): boolean; /** * Returns the space that `box_layout` puts between children. * @returns the spacing of the layout */ get_spacing(): number; /** * Sets the index of the child that determines the baseline * in vertical layout. * @param child the child position, or -1 */ set_baseline_child(child: number): void; /** * Sets the baseline position of a box layout. * * The baseline position 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 the * given `position` is used to allocate the baseline within the extra * space available. * @param position a {@link Gtk.BaselinePosition} */ set_baseline_position(position: BaselinePosition): void; /** * Sets whether the box layout will allocate the same * size to all children. * @param homogeneous `true` to set the box layout as homogeneous */ set_homogeneous(homogeneous: boolean): void; /** * Sets how much spacing to put between children. * @param spacing the spacing to apply between children */ set_spacing(spacing: number): void; /** * The orientation of the orientable. * @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::current-object": (pspec: GObject.ParamSpec) => void; "notify::scope": (pspec: GObject.ParamSpec) => void; "notify::translation-domain": (pspec: GObject.ParamSpec) => void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { current_object: GObject.Object | null; currentObject: GObject.Object | null; scope: BuilderScope; translation_domain: string | null; translationDomain: string | null; } } /** * Reads XML descriptions of a user interface and instantiates the described objects. * * To create a {@link Gtk.Builder} from a user interface description, call * {@link Gtk.Builder.new_from_file}, {@link Gtk.Builder.new_from_resource} * or {@link Gtk.Builder.new_from_string}. * * In the (unusual) case that you want to add user interface * descriptions from multiple sources to the same {@link Gtk.Builder} you can * call {@link Gtk.Builder.new} to get an empty builder and populate it by * (multiple) calls to {@link Gtk.Builder.add_from_file}, * {@link Gtk.Builder.add_from_resource} or * {@link Gtk.Builder.add_from_string}. * * A {@link Gtk.Builder} 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 * {@link Gtk.Window.destroy} to get rid of them and all the widgets * they contain. * * The functions {@link Gtk.Builder.get_object} and * {@link 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 {@link Gtk.Window.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. * * ## GtkBuilder UI Definitions * * {@link Gtk.Builder} parses textual descriptions of user interfaces which are * specified in XML format. We refer to these descriptions as “GtkBuilder * UI definitions” or just “UI definitions” if the context is clear. * * ### Structure of UI definitions * * UI definition files are always encoded in UTF-8. * * 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 {@link Gtk.Builder.set_translation_domain} on the builder. * For example: * * ```xml * * * ... * * ``` * * ### Requirements * * 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 “``.``”. {@link Gtk.Builder} will * error out if the version requirements are not met. For example: * * ```xml * * * * * ``` * * ### Objects * * Objects are defined as children of the `` element. * * Objects are described by `` elements, which can contain * `` elements to set properties, `` elements which * connect signals to handlers, and `` elements, which describe * child objects. * * 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 explicitly with the "type-func" attribute. If your UI definition * is referencing internal types, you should make sure to call * `g_type_ensure()` for each object type before parsing the UI definition. * * Objects may be given a name with the “id” attribute, which allows the * application to retrieve them from the builder with * {@link 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 `___` (three consecutive * underscores) for its own purposes. * * ### Properties * * 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: * * ```xml * * Hello, world * * ``` * * 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: * * ```xml * * Hello, world * * ``` * * The xgettext tool that is part of gettext can extract these strings, * but note that it only looks for translatable="yes". * * {@link Gtk.Builder} 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 values, strings like “FALSE”, “f”, “no”, “n”, “0” are interpreted * as false values) * - string lists (separated by newlines) * - enumeration types (can be specified by their full C identifier their short * name used when registering the enumeration type, or their integer value) * - flag types (can be specified by their C identifier or short name, * optionally combined with “|” for bitwise OR, or a single integer value * e.g., “GTK_INPUT_HINT_EMOJI|GTK_INPUT_HINT_LOWERCASE”, or “emoji|lowercase” or 520). * - colors (in the format understood by {@link Gdk.RGBA.parse}) * - transforms (in the format understood by {@link Gsk.Transform.parse}) * - Pango attribute lists (in the format understood by {@link Pango.AttrList.to_string}) * - Pango tab arrays (in the format understood by {@link Pango.TabArray.to_string}) * - Pango font descriptions (in the format understood by {@link Pango.FontDescription.from_string}) * - {@link GLib.Variant} (in the format understood by {@link GLib.Variant.parse}) * - textures (can be specified as an object id, a resource path or a filename of an image file to load relative to the Builder file or the CWD if {@link Gtk.Builder.add_from_string} was used) * - GFile (like textures, can be specified as an object id, a URI or a filename of a file to load relative to the Builder file or the CWD if {@link Gtk.Builder.add_from_string} was used) * * Objects can be referred to by their name and by default refer to * objects declared in the local XML fragment and objects exposed via * {@link Gtk.Builder.expose_object}. In general, {@link Gtk.Builder} 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. * * ### Child objects * * Many widgets have properties for child widgets, such as * {@link Gtk.Expander.child}. In this case, the preferred way to * specify the child widget in a ui file is to simply set the property: * * ```xml * * * * ... * * * * ``` * * Generic containers that can contain an arbitrary number of children, * such as {@link Gtk.Box} instead use the `` element. A `` * element contains an `` element which describes the child object. * Most often, child objects are widgets inside a container, but they can * also be, e.g., actions in an action group, or columns in a tree model. * * Any object type that implements the {@link Gtk.Buildable} interface can * specify how children may be added to it. Since many objects and widgets that * are included with GTK already implement the {@link Gtk.Buildable} interface, * typically child objects can be added using the `` element without * having to be concerned about the underlying implementation. * * See the [{@link Gtk.Widget} documentation](https://docs.gtk.org/gtk4/class.Widget.html#gtkwidget-as-gtkbuildable) * for many examples of using {@link Gtk.Builder} with widgets, including setting * child objects using the `` element. * * A noteworthy special case to the general rule that only objects implementing * {@link Gtk.Buildable} may specify how to handle the `` element is that * {@link Gtk.Builder} provides special support for adding objects to a * {@link Gio.ListStore} by using the `` element. For instance: * * ```xml * * MyObject * * * * ... * * ``` * * ### Property bindings * * 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, and optionally, "bind-property" and * "bind-flags" to specify the source property and source binding flags * respectively. Internally, {@link Gtk.Builder} implements this using * {@link GObject.Binding} objects. * * For instance, in the example below the “label” property of the * `bottom_label` widget is bound to the “label” property of the * `top_button` widget: * * ```xml * * vertical * * * Hello, world * * * * * * * * * ``` * * For more information, see the documentation of the * {@link GObject.Object.bind_property} method. * * Please note that another way to set up bindings between objects in .ui files * is to use the {@link Gtk.Expression} methodology. See the * [{@link Gtk.Expression} documentation](https://docs.gtk.org/gtk4/class.Expression.html#gtkexpression-in-ui-files) * for more information. * * ### Internal children * * 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 content area * of a {@link Gtk.Dialog}). This can be achieved by setting the “internal-child” * property of the `` element to a true value. Note that {@link Gtk.Builder} * still requires an `` element for the internal child, even if it * has already been constructed. * * ### Specialized children * * 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. * * ### Signal handlers and function pointers * * 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. * * ```xml * * * * ``` * * The remaining attributes, “after”, “swapped” and “object”, have the * same meaning as the corresponding parameters of the * {@link GObject.signal_connect_object} or {@link GObject.signal_connect_data} * functions: * * - “after” matches the `G_CONNECT_AFTER` flag, and will ensure that the * handler is called after the default class closure for the signal * - “swapped” matches the `G_CONNECT_SWAPPED` flag, and will swap the * instance and closure arguments when invoking the signal handler * - “object” will bind the signal handler to the lifetime of the object * referenced by the attribute * * By default "swapped" will be set to "yes" if not specified otherwise, in * the case where "object" is set, for convenience. A “last_modification_time” * attribute is also allowed, but it does not have a meaning to the builder. * * When compiling applications for Windows, you must declare signal callbacks * with the `G_MODULE_EXPORT` decorator, or they will not be put in the symbol * table: * * ```c * G_MODULE_EXPORT void * hello_button__clicked (GtkButton *button, * gpointer data) * { * // ... * } * ``` * * On Linux and Unix, this is not necessary; applications should instead * be compiled with the `-Wl,--export-dynamic` argument inside their compiler * flags, and linked against `gmodule-export-2.0`. * * ## Example UI Definition * * ```xml * * * * * * * * * _Ok * True * * * * * * * * * * ``` * * ## Using GtkBuildable for extending UI definitions * * Objects can implement the {@link Gtk.Buildable} interface to add custom * elements and attributes to the XML. Typically, any extension will be * documented in each type that implements the interface. * * ## Menus * * In addition to objects with properties that are created with `` and * `` elements, {@link Gtk.Builder} also allows to parse XML menu definitions * as used by {@link Gio.Menu} when exporting menu models over D-Bus, and as * described in the {@link Gtk.PopoverMenu} documentation. Menus can be defined * as toplevel elements, or as property values for properties of type {@link Gio.MenuModel}. * * ## Templates * * When describing a {@link Gtk.Widget}, you can use the `