/// /// /// /// /// /// /// /// /// /// /// /// /** * 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, ... */ declare module 'gi://Gtk?version=2.0' { // Module dependencies import type Gdk from 'gi://Gdk?version=2.0'; import type cairo from 'cairo'; import type GObject from 'gi://GObject?version=2.0'; import type GLib from 'gi://GLib?version=2.0'; import type Pango from 'gi://Pango?version=1.0'; import type HarfBuzz from 'gi://HarfBuzz?version=0.0'; import type freetype2 from 'gi://freetype2?version=2.0'; import type Gio from 'gi://Gio?version=2.0'; import type GModule from 'gi://GModule?version=2.0'; import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0'; import type Atk from 'gi://Atk?version=1.0'; export namespace Gtk { /** * Gtk-2.0 */ export namespace AnchorType { export const $gtype: GObject.GType; } enum AnchorType { CENTER, NORTH, NORTH_WEST, NORTH_EAST, SOUTH, SOUTH_WEST, SOUTH_EAST, WEST, EAST, N, NW, NE, S, SW, SE, W, E, } export namespace ArrowPlacement { export const $gtype: GObject.GType; } enum ArrowPlacement { BOTH, START, END, } export namespace ArrowType { export const $gtype: GObject.GType; } enum ArrowType { UP, DOWN, LEFT, RIGHT, NONE, } /** * An enum for determining the page role inside the #GtkAssistant. It's * used to handle buttons sensitivity and visibility. * * Note that an assistant needs to end its page flow with a page of type * %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or * %GTK_ASSISTANT_PAGE_PROGRESS to be correct. */ /** * An enum for determining the page role inside the #GtkAssistant. It's * used to handle buttons sensitivity and visibility. * * Note that an assistant needs to end its page flow with a page of type * %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or * %GTK_ASSISTANT_PAGE_PROGRESS to be correct. */ export namespace AssistantPageType { export const $gtype: GObject.GType; } enum AssistantPageType { /** * The page has regular contents. */ CONTENT, /** * The page contains an introduction to the * assistant task. */ INTRO, /** * The page lets the user confirm or deny the * changes. */ CONFIRM, /** * The page informs the user of the changes * done. */ SUMMARY, /** * Used for tasks that take a long time to * complete, blocks the assistant until the page is marked as complete. */ PROGRESS, } class BuilderError extends GLib.Error { static $gtype: GObject.GType; // Static fields static INVALID_TYPE_FUNCTION: number; static UNHANDLED_TAG: number; static MISSING_ATTRIBUTE: number; static INVALID_ATTRIBUTE: number; static INVALID_TAG: number; static MISSING_PROPERTY_VALUE: number; static INVALID_VALUE: number; static VERSION_MISMATCH: number; static DUPLICATE_ID: number; // Constructors constructor(options: { message: string; code: number }); _init(...args: any[]): void; // Static methods static quark(): GLib.Quark; } export namespace ButtonBoxStyle { export const $gtype: GObject.GType; } enum ButtonBoxStyle { DEFAULT_STYLE, SPREAD, EDGE, START, END, CENTER, } /** * Prebuilt sets of buttons for the dialog. If * none of these choices are appropriate, simply use %GTK_BUTTONS_NONE * then call gtk_dialog_add_buttons(). * * Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO * and %GTK_BUTTONS_OK_CANCEL are discouraged by the * GNOME HIG. * */ /** * Prebuilt sets of buttons for the dialog. If * none of these choices are appropriate, simply use %GTK_BUTTONS_NONE * then call gtk_dialog_add_buttons(). * * Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO * and %GTK_BUTTONS_OK_CANCEL are discouraged by the * GNOME HIG. * */ export namespace ButtonsType { export const $gtype: GObject.GType; } 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, } export namespace CListDragPos { export const $gtype: GObject.GType; } enum CListDragPos { NONE, BEFORE, INTO, AFTER, } export namespace CTreeExpanderStyle { export const $gtype: GObject.GType; } enum CTreeExpanderStyle { NONE, SQUARE, TRIANGLE, CIRCULAR, } export namespace CTreeExpansionType { export const $gtype: GObject.GType; } enum CTreeExpansionType { EXPAND, EXPAND_RECURSIVE, COLLAPSE, COLLAPSE_RECURSIVE, TOGGLE, TOGGLE_RECURSIVE, } export namespace CTreeLineStyle { export const $gtype: GObject.GType; } enum CTreeLineStyle { NONE, SOLID, DOTTED, TABBED, } export namespace CTreePos { export const $gtype: GObject.GType; } enum CTreePos { BEFORE, AS_CHILD, AFTER, } export namespace CellRendererAccelMode { export const $gtype: GObject.GType; } enum CellRendererAccelMode { GTK, OTHER, } export namespace CellRendererMode { export const $gtype: GObject.GType; } enum CellRendererMode { INERT, ACTIVATABLE, EDITABLE, } export namespace CellType { export const $gtype: GObject.GType; } enum CellType { EMPTY, TEXT, PIXMAP, PIXTEXT, WIDGET, } export namespace CornerType { export const $gtype: GObject.GType; } enum CornerType { TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT, } export namespace CurveType { export const $gtype: GObject.GType; } enum CurveType { LINEAR, SPLINE, FREE, } export namespace DeleteType { export const $gtype: GObject.GType; } enum DeleteType { CHARS, WORD_ENDS, WORDS, DISPLAY_LINES, DISPLAY_LINE_ENDS, PARAGRAPH_ENDS, PARAGRAPHS, WHITESPACE, } export namespace DirectionType { export const $gtype: GObject.GType; } enum DirectionType { TAB_FORWARD, TAB_BACKWARD, UP, DOWN, LEFT, RIGHT, } export namespace DragResult { export const $gtype: GObject.GType; } enum DragResult { SUCCESS, NO_TARGET, USER_CANCELLED, TIMEOUT_EXPIRED, GRAB_BROKEN, ERROR, } export namespace EntryIconPosition { export const $gtype: GObject.GType; } enum EntryIconPosition { PRIMARY, SECONDARY, } export namespace ExpanderStyle { export const $gtype: GObject.GType; } enum ExpanderStyle { COLLAPSED, SEMI_COLLAPSED, SEMI_EXPANDED, EXPANDED, } /** * Describes whether a #GtkFileChooser is being used to open existing files * or to save to a possibly new file. */ /** * Describes whether a #GtkFileChooser is being used to open existing files * or to save to a possibly new file. */ export namespace FileChooserAction { export const $gtype: GObject.GType; } enum FileChooserAction { /** * Indicates open mode. The file chooser * will only let the user pick an existing file. */ OPEN, /** * Indicates save mode. The file chooser * will let the user pick an existing file, or type in a new * filename. */ SAVE, /** * Indicates an Open mode for * selecting folders. The file chooser will let the user pick an * existing folder. */ SELECT_FOLDER, /** * Indicates a mode for creating a * new folder. The file chooser will let the user name an existing or * new folder. */ CREATE_FOLDER, } /** * Used as a return value of handlers for the * #GtkFileChooser::confirm-overwrite signal of a #GtkFileChooser. This * value determines whether the file chooser will present the stock * confirmation dialog, accept the user's choice of a filename, or * let the user choose another filename. */ /** * Used as a return value of handlers for the * #GtkFileChooser::confirm-overwrite signal of a #GtkFileChooser. This * value determines whether the file chooser will present the stock * confirmation dialog, accept the user's choice of a filename, or * let the user choose another filename. */ export namespace FileChooserConfirmation { export const $gtype: GObject.GType; } enum FileChooserConfirmation { /** * The file chooser will present * its stock dialog to confirm about overwriting an existing file. */ CONFIRM, /** * The file chooser will * terminate and accept the user's choice of a file name. */ ACCEPT_FILENAME, /** * The file chooser will * continue running, so as to let the user select another file name. */ SELECT_AGAIN, } /** * These identify the various errors that can occur while calling * #GtkFileChooser functions. */ 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 }); _init(...args: any[]): void; // Static methods /** * Registers an error quark for #GtkFileChooser if necessary. */ static quark(): GLib.Quark; } export namespace IMPreeditStyle { export const $gtype: GObject.GType; } enum IMPreeditStyle { NOTHING, CALLBACK, NONE, } export namespace IMStatusStyle { export const $gtype: GObject.GType; } enum IMStatusStyle { NOTHING, CALLBACK, NONE, } export namespace IconSize { export const $gtype: GObject.GType; } enum IconSize { INVALID, MENU, SMALL_TOOLBAR, LARGE_TOOLBAR, BUTTON, DND, DIALOG, } /** * Error codes for GtkIconTheme operations. */ 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 }); _init(...args: any[]): void; // Static methods static quark(): GLib.Quark; } export namespace IconViewDropPosition { export const $gtype: GObject.GType; } enum IconViewDropPosition { NO_DROP, DROP_INTO, DROP_LEFT, DROP_RIGHT, DROP_ABOVE, DROP_BELOW, } /** * Describes the image data representation used by a #GtkImage. If you * want to get the image from the widget, you can only get the * currently-stored representation. e.g. if the * gtk_image_get_storage_type() returns #GTK_IMAGE_PIXBUF, then you can * call gtk_image_get_pixbuf() but not gtk_image_get_stock(). For empty * images, you can request any storage type (call any of the "get" * functions), but they will all return %NULL values. */ /** * Describes the image data representation used by a #GtkImage. If you * want to get the image from the widget, you can only get the * currently-stored representation. e.g. if the * gtk_image_get_storage_type() returns #GTK_IMAGE_PIXBUF, then you can * call gtk_image_get_pixbuf() but not gtk_image_get_stock(). For empty * images, you can request any storage type (call any of the "get" * functions), but they will all return %NULL values. */ export namespace ImageType { export const $gtype: GObject.GType; } enum ImageType { /** * there is no image displayed by the widget */ EMPTY, /** * the widget contains a #GdkPixmap */ PIXMAP, /** * the widget contains a #GdkImage */ IMAGE, /** * the widget contains a #GdkPixbuf */ PIXBUF, /** * the widget contains a stock icon name (see ) */ STOCK, /** * the widget contains a #GtkIconSet */ ICON_SET, /** * the widget contains a #GdkPixbufAnimation */ ANIMATION, /** * the widget contains a named icon. * This image type was added in GTK+ 2.6 */ ICON_NAME, /** * the widget contains a #GIcon. * This image type was added in GTK+ 2.14 */ GICON, } export namespace Justification { export const $gtype: GObject.GType; } enum Justification { LEFT, RIGHT, CENTER, FILL, } export namespace MatchType { export const $gtype: GObject.GType; } enum MatchType { ALL, ALL_TAIL, HEAD, TAIL, EXACT, LAST, } export namespace MenuDirectionType { export const $gtype: GObject.GType; } enum MenuDirectionType { PARENT, CHILD, NEXT, PREV, } /** * The type of message being displayed in the dialog. */ /** * The type of message being displayed in the dialog. */ export namespace MessageType { export const $gtype: GObject.GType; } enum MessageType { /** * Informational message */ INFO, /** * Nonfatal warning message */ WARNING, /** * Question requiring a choice */ QUESTION, /** * Fatal error message */ ERROR, /** * None of the above, doesn't get an icon */ OTHER, } export namespace MetricType { export const $gtype: GObject.GType; } enum MetricType { PIXELS, INCHES, CENTIMETERS, } export namespace MovementStep { export const $gtype: GObject.GType; } enum MovementStep { LOGICAL_POSITIONS, VISUAL_POSITIONS, WORDS, DISPLAY_LINES, DISPLAY_LINE_ENDS, PARAGRAPHS, PARAGRAPH_ENDS, PAGES, BUFFER_ENDS, HORIZONTAL_PAGES, } export namespace NotebookTab { export const $gtype: GObject.GType; } enum NotebookTab { FIRST, LAST, } export namespace NumberUpLayout { export const $gtype: GObject.GType; } enum NumberUpLayout { LRTB, LRBT, RLTB, RLBT, TBLR, TBRL, BTLR, BTRL, } export namespace Orientation { export const $gtype: GObject.GType; } enum Orientation { HORIZONTAL, VERTICAL, } export namespace PackDirection { export const $gtype: GObject.GType; } enum PackDirection { LTR, RTL, TTB, BTT, } export namespace PackType { export const $gtype: GObject.GType; } enum PackType { START, END, } export namespace PageOrientation { export const $gtype: GObject.GType; } enum PageOrientation { PORTRAIT, LANDSCAPE, REVERSE_PORTRAIT, REVERSE_LANDSCAPE, } export namespace PageSet { export const $gtype: GObject.GType; } enum PageSet { ALL, EVEN, ODD, } export namespace PathPriorityType { export const $gtype: GObject.GType; } enum PathPriorityType { LOWEST, GTK, APPLICATION, THEME, RC, HIGHEST, } export namespace PathType { export const $gtype: GObject.GType; } enum PathType { WIDGET, WIDGET_CLASS, CLASS, } export namespace PolicyType { export const $gtype: GObject.GType; } enum PolicyType { ALWAYS, AUTOMATIC, NEVER, } export namespace PositionType { export const $gtype: GObject.GType; } enum PositionType { LEFT, RIGHT, TOP, BOTTOM, } export namespace PreviewType { export const $gtype: GObject.GType; } enum PreviewType { COLOR, GRAYSCALE, } export namespace PrintDuplex { export const $gtype: GObject.GType; } enum PrintDuplex { SIMPLEX, HORIZONTAL, VERTICAL, } class PrintError extends GLib.Error { static $gtype: GObject.GType; // Static fields static GENERAL: number; static INTERNAL_ERROR: number; static NOMEM: number; static INVALID_FILE: number; // Constructors constructor(options: { message: string; code: number }); _init(...args: any[]): void; // Static methods /** * Registers an error quark for #GtkPrintOperation if necessary. */ static quark(): GLib.Quark; } export namespace PrintOperationAction { export const $gtype: GObject.GType; } enum PrintOperationAction { PRINT_DIALOG, PRINT, PREVIEW, EXPORT, } export namespace PrintOperationResult { export const $gtype: GObject.GType; } enum PrintOperationResult { ERROR, APPLY, CANCEL, IN_PROGRESS, } export namespace PrintPages { export const $gtype: GObject.GType; } enum PrintPages { ALL, CURRENT, RANGES, SELECTION, } export namespace PrintQuality { export const $gtype: GObject.GType; } enum PrintQuality { LOW, NORMAL, HIGH, DRAFT, } export namespace PrintStatus { export const $gtype: GObject.GType; } enum PrintStatus { INITIAL, PREPARING, GENERATING_DATA, SENDING_DATA, PENDING, PENDING_ISSUE, PRINTING, FINISHED, FINISHED_ABORTED, } export namespace ProgressBarOrientation { export const $gtype: GObject.GType; } enum ProgressBarOrientation { LEFT_TO_RIGHT, RIGHT_TO_LEFT, BOTTOM_TO_TOP, TOP_TO_BOTTOM, } export namespace ProgressBarStyle { export const $gtype: GObject.GType; } enum ProgressBarStyle { CONTINUOUS, DISCRETE, } export namespace RcTokenType { export const $gtype: GObject.GType; } enum RcTokenType { INVALID, INCLUDE, NORMAL, ACTIVE, PRELIGHT, SELECTED, INSENSITIVE, FG, BG, TEXT, BASE, XTHICKNESS, YTHICKNESS, FONT, FONTSET, FONT_NAME, BG_PIXMAP, PIXMAP_PATH, STYLE, BINDING, BIND, WIDGET, WIDGET_CLASS, CLASS, LOWEST, GTK, APPLICATION, THEME, RC, HIGHEST, ENGINE, MODULE_PATH, IM_MODULE_PATH, IM_MODULE_FILE, STOCK, LTR, RTL, COLOR, UNBIND, LAST, } class RecentChooserError extends GLib.Error { static $gtype: GObject.GType; // Static fields static NOT_FOUND: number; static INVALID_URI: number; // Constructors constructor(options: { message: string; code: number }); _init(...args: any[]): void; // Static methods static quark(): GLib.Quark; } /** * Error codes for GtkRecentManager operations */ 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 }); _init(...args: any[]): void; // Static methods static quark(): GLib.Quark; } /** * Used to specify the sorting method to be applyed to the recently * used resource list. */ /** * Used to specify the sorting method to be applyed to the recently * used resource list. */ export namespace RecentSortType { export const $gtype: GObject.GType; } enum RecentSortType { /** * Do not sort the returned list of recently used * resources. */ NONE, /** * Sort the returned list with the most recently used * items first. */ MRU, /** * Sort the returned list with the least recently used * items first. */ LRU, /** * Sort the returned list using a custom sorting * function passed using gtk_recent_manager_set_sort_func(). */ CUSTOM, } export namespace ReliefStyle { export const $gtype: GObject.GType; } enum ReliefStyle { NORMAL, HALF, NONE, } export namespace ResizeMode { export const $gtype: GObject.GType; } enum ResizeMode { PARENT, QUEUE, IMMEDIATE, } export namespace ResponseType { export const $gtype: GObject.GType; } enum ResponseType { NONE, REJECT, ACCEPT, DELETE_EVENT, OK, CANCEL, CLOSE, YES, NO, APPLY, HELP, } export namespace ScrollStep { export const $gtype: GObject.GType; } enum ScrollStep { STEPS, PAGES, ENDS, HORIZONTAL_STEPS, HORIZONTAL_PAGES, HORIZONTAL_ENDS, } export namespace ScrollType { export const $gtype: GObject.GType; } enum ScrollType { NONE, JUMP, STEP_BACKWARD, STEP_FORWARD, PAGE_BACKWARD, PAGE_FORWARD, STEP_UP, STEP_DOWN, PAGE_UP, PAGE_DOWN, STEP_LEFT, STEP_RIGHT, PAGE_LEFT, PAGE_RIGHT, START, END, } export namespace SelectionMode { export const $gtype: GObject.GType; } enum SelectionMode { NONE, SINGLE, BROWSE, MULTIPLE, EXTENDED, } export namespace SensitivityType { export const $gtype: GObject.GType; } enum SensitivityType { AUTO, ON, OFF, } export namespace ShadowType { export const $gtype: GObject.GType; } enum ShadowType { NONE, IN, OUT, ETCHED_IN, ETCHED_OUT, } export namespace SideType { export const $gtype: GObject.GType; } enum SideType { TOP, BOTTOM, LEFT, RIGHT, } /** * The mode of the size group determines the directions in which the size * group affects the requested sizes of its component widgets. */ /** * The mode of the size group determines the directions in which the size * group affects the requested sizes of its component widgets. */ export namespace SizeGroupMode { export const $gtype: GObject.GType; } 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, } export namespace SortType { export const $gtype: GObject.GType; } enum SortType { ASCENDING, DESCENDING, } export namespace SpinButtonUpdatePolicy { export const $gtype: GObject.GType; } enum SpinButtonUpdatePolicy { ALWAYS, IF_VALID, } export namespace SpinType { export const $gtype: GObject.GType; } enum SpinType { STEP_FORWARD, STEP_BACKWARD, PAGE_FORWARD, PAGE_BACKWARD, HOME, END, USER_DEFINED, } export namespace StateType { export const $gtype: GObject.GType; } enum StateType { NORMAL, ACTIVE, PRELIGHT, SELECTED, INSENSITIVE, } export namespace SubmenuDirection { export const $gtype: GObject.GType; } enum SubmenuDirection { LEFT, RIGHT, } export namespace SubmenuPlacement { export const $gtype: GObject.GType; } enum SubmenuPlacement { TOP_BOTTOM, LEFT_RIGHT, } export namespace TextBufferTargetInfo { export const $gtype: GObject.GType; } enum TextBufferTargetInfo { BUFFER_CONTENTS, RICH_TEXT, TEXT, } export namespace TextDirection { export const $gtype: GObject.GType; } enum TextDirection { NONE, LTR, RTL, } export namespace TextWindowType { export const $gtype: GObject.GType; } enum TextWindowType { PRIVATE, WIDGET, TEXT, LEFT, RIGHT, TOP, BOTTOM, } export namespace ToolbarChildType { export const $gtype: GObject.GType; } enum ToolbarChildType { SPACE, BUTTON, TOGGLEBUTTON, RADIOBUTTON, WIDGET, } export namespace ToolbarSpaceStyle { export const $gtype: GObject.GType; } enum ToolbarSpaceStyle { EMPTY, LINE, } export namespace ToolbarStyle { export const $gtype: GObject.GType; } enum ToolbarStyle { ICONS, TEXT, BOTH, BOTH_HORIZ, } export namespace TreeViewColumnSizing { export const $gtype: GObject.GType; } enum TreeViewColumnSizing { GROW_ONLY, AUTOSIZE, FIXED, } export namespace TreeViewDropPosition { export const $gtype: GObject.GType; } enum TreeViewDropPosition { BEFORE, AFTER, INTO_OR_BEFORE, INTO_OR_AFTER, } export namespace TreeViewGridLines { export const $gtype: GObject.GType; } enum TreeViewGridLines { NONE, HORIZONTAL, VERTICAL, BOTH, } export namespace TreeViewMode { export const $gtype: GObject.GType; } enum TreeViewMode { LINE, ITEM, } export namespace Unit { export const $gtype: GObject.GType; } enum Unit { PIXEL, POINTS, INCH, MM, } export namespace UpdateType { export const $gtype: GObject.GType; } enum UpdateType { CONTINUOUS, DISCONTINUOUS, DELAYED, } export namespace Visibility { export const $gtype: GObject.GType; } enum Visibility { NONE, PARTIAL, FULL, } export namespace WidgetHelpType { export const $gtype: GObject.GType; } enum WidgetHelpType { TOOLTIP, WHATS_THIS, } export namespace WindowPosition { export const $gtype: GObject.GType; } enum WindowPosition { NONE, CENTER, MOUSE, CENTER_ALWAYS, CENTER_ON_PARENT, } export namespace WindowType { export const $gtype: GObject.GType; } enum WindowType { TOPLEVEL, POPUP, } export namespace WrapMode { export const $gtype: GObject.GType; } enum WrapMode { NONE, CHAR, WORD, WORD_CHAR, } const ARG_READWRITE: number; const BINARY_AGE: number; const BUTTONBOX_DEFAULT: number; const INPUT_ERROR: number; const INTERFACE_AGE: number; const MAJOR_VERSION: number; const MAX_COMPOSE_LEN: number; const MICRO_VERSION: number; const MINOR_VERSION: number; const NO_TEXT_INPUT_MOD_MASK: number; const PAPER_NAME_A3: string; const PAPER_NAME_A4: string; const PAPER_NAME_A5: string; const PAPER_NAME_B5: string; const PAPER_NAME_EXECUTIVE: string; const PAPER_NAME_LEGAL: string; const PAPER_NAME_LETTER: string; const PARAM_READABLE: number; const PARAM_READWRITE: number; const PARAM_WRITABLE: number; const PATH_PRIO_MASK: number; const PRINT_SETTINGS_COLLATE: string; const PRINT_SETTINGS_DEFAULT_SOURCE: string; const PRINT_SETTINGS_DITHER: string; const PRINT_SETTINGS_DUPLEX: string; const PRINT_SETTINGS_FINISHINGS: string; const PRINT_SETTINGS_MEDIA_TYPE: string; const PRINT_SETTINGS_NUMBER_UP: string; const PRINT_SETTINGS_NUMBER_UP_LAYOUT: string; const PRINT_SETTINGS_N_COPIES: string; const PRINT_SETTINGS_ORIENTATION: string; const PRINT_SETTINGS_OUTPUT_BIN: string; const PRINT_SETTINGS_OUTPUT_FILE_FORMAT: string; const PRINT_SETTINGS_OUTPUT_URI: string; const PRINT_SETTINGS_PAGE_RANGES: string; const PRINT_SETTINGS_PAGE_SET: string; const PRINT_SETTINGS_PAPER_FORMAT: string; const PRINT_SETTINGS_PAPER_HEIGHT: string; const PRINT_SETTINGS_PAPER_WIDTH: string; const PRINT_SETTINGS_PRINTER: string; const PRINT_SETTINGS_PRINTER_LPI: string; const PRINT_SETTINGS_PRINT_PAGES: string; const PRINT_SETTINGS_QUALITY: string; const PRINT_SETTINGS_RESOLUTION: string; const PRINT_SETTINGS_RESOLUTION_X: string; const PRINT_SETTINGS_RESOLUTION_Y: string; const PRINT_SETTINGS_REVERSE: string; const PRINT_SETTINGS_SCALE: string; const PRINT_SETTINGS_USE_COLOR: string; const PRINT_SETTINGS_WIN32_DRIVER_EXTRA: string; const PRINT_SETTINGS_WIN32_DRIVER_VERSION: string; const PRIORITY_REDRAW: number; const PRIORITY_RESIZE: number; /** * The "About" item. * */ const STOCK_ABOUT: string; /** * The "Add" item. * */ const STOCK_ADD: string; /** * The "Apply" item. * */ const STOCK_APPLY: string; /** * The "Bold" item. * */ const STOCK_BOLD: string; /** * The "Cancel" item. * */ const STOCK_CANCEL: string; /** * The "Caps Lock Warning" icon. * */ const STOCK_CAPS_LOCK_WARNING: string; /** * The "CD-Rom" item. * */ const STOCK_CDROM: string; /** * The "Clear" item. * */ const STOCK_CLEAR: string; /** * The "Close" item. * */ const STOCK_CLOSE: string; /** * The "Color Picker" item. * */ const STOCK_COLOR_PICKER: string; /** * The "Connect" icon. * */ const STOCK_CONNECT: string; /** * The "Convert" item. * */ const STOCK_CONVERT: string; /** * The "Copy" item. * */ const STOCK_COPY: string; /** * The "Cut" item. * */ const STOCK_CUT: string; /** * The "Delete" item. * */ const STOCK_DELETE: string; /** * The "Authentication" item. * */ const STOCK_DIALOG_AUTHENTICATION: string; /** * The "Error" item. * */ const STOCK_DIALOG_ERROR: string; /** * The "Information" item. * */ const STOCK_DIALOG_INFO: string; /** * The "Question" item. * */ const STOCK_DIALOG_QUESTION: string; /** * The "Warning" item. * */ const STOCK_DIALOG_WARNING: string; /** * The "Directory" icon. * */ const STOCK_DIRECTORY: string; /** * The "Discard" item. */ const STOCK_DISCARD: string; /** * The "Disconnect" icon. * */ const STOCK_DISCONNECT: string; /** * The "Drag-And-Drop" icon. * */ const STOCK_DND: string; /** * The "Drag-And-Drop multiple" icon. * */ const STOCK_DND_MULTIPLE: string; /** * The "Edit" item. * */ const STOCK_EDIT: string; /** * The "Execute" item. * */ const STOCK_EXECUTE: string; /** * The "File" icon. * */ const STOCK_FILE: string; /** * The "Find" item. * */ const STOCK_FIND: string; /** * The "Find and Replace" item. * */ const STOCK_FIND_AND_REPLACE: string; /** * The "Floppy" item. * */ const STOCK_FLOPPY: string; /** * The "Fullscreen" item. * */ const STOCK_FULLSCREEN: string; /** * The "Bottom" item. * */ const STOCK_GOTO_BOTTOM: string; /** * The "First" item. * * RTL variant * */ const STOCK_GOTO_FIRST: string; /** * The "Last" item. * * RTL variant * */ const STOCK_GOTO_LAST: string; /** * The "Top" item. * */ const STOCK_GOTO_TOP: string; /** * The "Back" item. * * RTL variant * */ const STOCK_GO_BACK: string; /** * The "Down" item. * */ const STOCK_GO_DOWN: string; /** * The "Forward" item. * * RTL variant * */ const STOCK_GO_FORWARD: string; /** * The "Up" item. * */ const STOCK_GO_UP: string; /** * The "Harddisk" item. * */ const STOCK_HARDDISK: string; /** * The "Help" item. * */ const STOCK_HELP: string; /** * The "Home" item. * */ const STOCK_HOME: string; /** * The "Indent" item. * * RTL variant * */ const STOCK_INDENT: string; /** * The "Index" item. * */ const STOCK_INDEX: string; /** * The "Info" item. * */ const STOCK_INFO: string; /** * The "Italic" item. * */ const STOCK_ITALIC: string; /** * The "Jump to" item. * * RTL-variant * */ const STOCK_JUMP_TO: string; /** * The "Center" item. * */ const STOCK_JUSTIFY_CENTER: string; /** * The "Fill" item. * */ const STOCK_JUSTIFY_FILL: string; /** * The "Left" item. * */ const STOCK_JUSTIFY_LEFT: string; /** * The "Right" item. * */ const STOCK_JUSTIFY_RIGHT: string; /** * The "Leave Fullscreen" item. * */ const STOCK_LEAVE_FULLSCREEN: string; /** * The "Media Forward" item. * * RTL variant * */ const STOCK_MEDIA_FORWARD: string; /** * The "Media Next" item. * * RTL variant * */ const STOCK_MEDIA_NEXT: string; /** * The "Media Pause" item. * */ const STOCK_MEDIA_PAUSE: string; /** * The "Media Play" item. * * RTL variant * */ const STOCK_MEDIA_PLAY: string; /** * The "Media Previous" item. * * RTL variant * */ const STOCK_MEDIA_PREVIOUS: string; /** * The "Media Record" item. * */ const STOCK_MEDIA_RECORD: string; /** * The "Media Rewind" item. * * RTL variant * */ const STOCK_MEDIA_REWIND: string; /** * The "Media Stop" item. * */ const STOCK_MEDIA_STOP: string; /** * The "Missing image" icon. * */ const STOCK_MISSING_IMAGE: string; /** * The "Network" item. * */ const STOCK_NETWORK: string; /** * The "New" item. * */ const STOCK_NEW: string; /** * The "No" item. * */ const STOCK_NO: string; /** * The "OK" item. * */ const STOCK_OK: string; /** * The "Open" item. * */ const STOCK_OPEN: string; /** * The "Landscape Orientation" item. * */ const STOCK_ORIENTATION_LANDSCAPE: string; /** * The "Portrait Orientation" item. * */ const STOCK_ORIENTATION_PORTRAIT: string; /** * The "Reverse Landscape Orientation" item. * */ const STOCK_ORIENTATION_REVERSE_LANDSCAPE: string; /** * The "Reverse Portrait Orientation" item. * */ const STOCK_ORIENTATION_REVERSE_PORTRAIT: string; /** * The "Page Setup" item. * */ const STOCK_PAGE_SETUP: string; /** * The "Paste" item. * */ const STOCK_PASTE: string; /** * The "Preferences" item. * */ const STOCK_PREFERENCES: string; /** * The "Print" item. * */ const STOCK_PRINT: string; /** * The "Print Error" icon. * */ const STOCK_PRINT_ERROR: string; /** * The "Print Paused" icon. * */ const STOCK_PRINT_PAUSED: string; /** * The "Print Preview" item. * */ const STOCK_PRINT_PREVIEW: string; /** * The "Print Report" icon. * */ const STOCK_PRINT_REPORT: string; /** * The "Print Warning" icon. * */ const STOCK_PRINT_WARNING: string; /** * The "Properties" item. * */ const STOCK_PROPERTIES: string; /** * The "Quit" item. * */ const STOCK_QUIT: string; /** * The "Redo" item. * * RTL variant * */ const STOCK_REDO: string; /** * The "Refresh" item. * */ const STOCK_REFRESH: string; /** * The "Remove" item. * */ const STOCK_REMOVE: string; /** * The "Revert" item. * * RTL variant * */ const STOCK_REVERT_TO_SAVED: string; /** * The "Save" item. * */ const STOCK_SAVE: string; /** * The "Save As" item. * */ const STOCK_SAVE_AS: string; /** * The "Select All" item. * */ const STOCK_SELECT_ALL: string; /** * The "Color" item. * */ const STOCK_SELECT_COLOR: string; /** * The "Font" item. * */ const STOCK_SELECT_FONT: string; /** * The "Ascending" item. * */ const STOCK_SORT_ASCENDING: string; /** * The "Descending" item. * */ const STOCK_SORT_DESCENDING: string; /** * The "Spell Check" item. * */ const STOCK_SPELL_CHECK: string; /** * The "Stop" item. * */ const STOCK_STOP: string; /** * The "Strikethrough" item. * */ const STOCK_STRIKETHROUGH: string; /** * The "Undelete" item. * * RTL variant * */ const STOCK_UNDELETE: string; /** * The "Underline" item. * */ const STOCK_UNDERLINE: string; /** * The "Undo" item. * * RTL variant * */ const STOCK_UNDO: string; /** * The "Unindent" item. * * RTL variant * */ const STOCK_UNINDENT: string; /** * The "Yes" item. * */ const STOCK_YES: string; /** * The "Zoom 100%" item. * */ const STOCK_ZOOM_100: string; /** * The "Zoom to Fit" item. * */ const STOCK_ZOOM_FIT: string; /** * The "Zoom In" item. * */ const STOCK_ZOOM_IN: string; /** * The "Zoom Out" item. * */ const STOCK_ZOOM_OUT: string; const TEXT_VIEW_PRIORITY_VALIDATE: number; const TOGGLE_GROUP_MOD_MASK: number; const TYPE_FUNDAMENTAL_LAST: number; /** * Finds the first accelerator in any #GtkAccelGroup attached * to `object` that matches `accel_key` and `accel_mods,` and * activates that accelerator. * @param object the #GObject, usually a #GtkWindow, on which to activate the accelerator. * @param accel_key accelerator keyval from a key event * @param accel_mods keyboard state mask from a key event * @returns %TRUE if an accelerator was activated and handled this keypress */ function accel_groups_activate( object: GObject.Object, accel_key: number, accel_mods: Gdk.ModifierType | null, ): boolean; /** * Gets a list of all accel groups which are attached to `object`. * @param object a #GObject, usually a #GtkWindow * @returns a list of all accel groups which are attached to @object */ function accel_groups_from_object(object: GObject.Object): AccelGroup[]; /** * Gets the value set by gtk_accelerator_set_default_mod_mask(). * @returns the default accelerator modifier mask */ function accelerator_get_default_mod_mask(): number; /** * 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 | null): string; /** * Converts an accelerator keyval and modifier mask * into a string parseable by gtk_accelerator_parse(). * For example, if you pass in #GDK_q and #GDK_CONTROL_MASK, * this function returns "<Control>q". * * If you need to display accelerators in the user interface, * see gtk_accelerator_get_label(). * @param accelerator_key accelerator keyval * @param accelerator_mods accelerator modifier mask * @returns a newly-allocated accelerator name */ function accelerator_name(accelerator_key: number, accelerator_mods: Gdk.ModifierType | null): string; /** * Parses a string representing an accelerator. The * format looks like "<Control>a" or "<Shift><Alt>F1" or * "<Release>z" (the last one is for key release). * The parser is fairly liberal and allows lower or upper case, * and also abbreviations such as "<Ctl>" and "<Ctrl>". * Key names are parsed using gdk_keyval_from_name(). For character keys the * name is not the symbol, but the lowercase name, e.g. one would use * "<Ctrl>minus" instead of "<Ctrl>-". * * If the parse fails, `accelerator_key` and `accelerator_mods` will * be set to 0 (zero). * @param accelerator string representing an accelerator */ function accelerator_parse(accelerator: string): [number, Gdk.ModifierType | null]; /** * Sets the modifiers that will be considered significant for keyboard * accelerators. The default mod mask is #GDK_CONTROL_MASK | * #GDK_SHIFT_MASK | #GDK_MOD1_MASK | #GDK_SUPER_MASK | * #GDK_HYPER_MASK | #GDK_META_MASK, that is, Control, Shift, Alt, * Super, Hyper and Meta. Other modifiers will by default be ignored * by #GtkAccelGroup. * You must include at least the three modifiers Control, Shift * and Alt in any value you pass to this function. * * The default mod mask should be changed on application startup, * before using any accelerator groups. * @param default_mod_mask accelerator modifier mask */ function accelerator_set_default_mod_mask(default_mod_mask: Gdk.ModifierType | null): void; /** * Determines whether a given keyval and modifier mask constitute * a valid keyboard accelerator. For example, the #GDK_a keyval * plus #GDK_CONTROL_MASK is valid - this is a "Ctrl+a" accelerator. * But, you can't, for instance, use the #GDK_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 | null): boolean; /** * Returns %TRUE if dialogs are expected to use an alternative * button order on the screen `screen`. See * gtk_dialog_set_alternative_button_order() for more details * about alternative button order. * * If you need to use this function, you should probably connect * to the ::notify:gtk-alternative-button-order signal on the * #GtkSettings object associated to `screen,` in order to be * notified if the button order setting changes. * @param screen a #GdkScreen, or %NULL to use the default screen * @returns Whether the alternative button order should be used */ function alternative_dialog_button_order(screen?: Gdk.Screen | null): boolean; /** * Override or install a new key binding for `keyval` with `modifiers` on * `binding_set`. * @param binding_set a #GtkBindingSet to add a signal to * @param keyval key value * @param modifiers key modifier * @param signal_name signal name to be bound * @param binding_args list of #GtkBindingArg signal arguments */ function binding_entry_add_signall( binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType | null, signal_name: string, binding_args: BindingArg[], ): void; /** * Clears a binding entry. * @param binding_set binding set to clear an entry of * @param keyval key value of binding to clear * @param modifiers key modifier of binding to clear */ function binding_entry_clear(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType | null): void; /** * Remove a binding previously installed via * gtk_binding_entry_add_signal() on `binding_set`. * @param binding_set a #GtkBindingSet to remove an entry of * @param keyval key value of binding to remove * @param modifiers key modifier of binding to remove */ function binding_entry_remove( binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType | null, ): void; /** * Install a binding on `binding_set` which causes key lookups * to be aborted, to prevent bindings from lower priority sets * to be activated. * @param binding_set a #GtkBindingSet to skip an entry of * @param keyval key value of binding to skip * @param modifiers key modifier of binding to skip */ function binding_entry_skip(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType | null): void; /** * Parse a binding entry from a gtkrc file. * @param scanner GtkRC scanner * @returns expected token upon errors, %G_TOKEN_NONE on success. */ function binding_parse_binding(scanner: GLib.Scanner): number; /** * Find a binding set by its globally unique name. The `set_name` can * either be a name used for gtk_binding_set_new() or the type name of * a class used in gtk_binding_set_by_class(). * @param set_name unique binding set name * @returns %NULL or the specified binding set */ function binding_set_find(set_name: string): BindingSet; /** * Find a key binding matching `keyval` and `modifiers` and activate the * binding on `object`. * @param object object to activate when binding found * @param keyval key value of the binding * @param modifiers key modifier of the binding * @returns %TRUE if a binding was found and activated */ function bindings_activate(object: Object, keyval: number, modifiers: Gdk.ModifierType | null): boolean; /** * Looks up key bindings for `object` to find one matching * `event,` and if one was found, activate it. * @param object a #GtkObject (generally must be a widget) * @param event a #GdkEventKey * @returns %TRUE if a matching key binding was found */ function bindings_activate_event(object: Object, event: Gdk.EventKey): boolean; 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 * 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; function ctree_node_get_type(): GObject.GType; /** * Prevents gtk_init(), gtk_init_check(), gtk_init_with_args() and * gtk_parse_args() from automatically * calling setlocale (LC_ALL, ""). You would * want to use this function if you wanted to set the locale for * your program to something other than the user's locale, or if * you wanted to set different values for different locale categories. * * Most programs should not need to call this function. */ function disable_setlocale(): void; /** * Initiates a drag on the source side. The function * only needs to be used when the application is * starting drags itself, and is not needed when * gtk_drag_source_set() is used. * * The `event` is used to retrieve the timestamp that will be used internally to * grab the pointer. If `event` is #NULL, then GDK_CURRENT_TIME will be used. * However, you should try to pass a real event in all cases, since that can be * used by GTK+ to get information about the start position of the drag, for * example if the `event` is a GDK_MOTION_NOTIFY. * * Generally there are three cases when you want to start a drag by hand by calling * this function: * * 1. During a button-press-event handler, if you want to start a drag immediately * when the user presses the mouse button. Pass the `event` that you have in your * button-press-event handler. * * 2. During a motion-notify-event handler, if you want to start a drag when the mouse * moves past a certain threshold distance after a button-press. Pass the `event` that you * have in your motion-notify-event handler. * * 3. During a timeout handler, if you want to start a drag after the mouse * button is held down for some time. Try to save the last event that you got * from the mouse, using gdk_event_copy(), and pass it to this function * (remember to free the event with gdk_event_free() when you are done). If you * can really not pass a real event, pass #NULL instead. * @param widget the source widget. * @param targets The targets (data formats) in which the source can provide the data. * @param actions A bitmask of the allowed drag actions for this drag. * @param button The button the user clicked to start the drag. * @param event The event that triggered the start of the drag. * @returns the context for this drag. */ function drag_begin( widget: Widget, targets: TargetList, actions: Gdk.DragAction | null, button: number, event: Gdk.Event, ): Gdk.DragContext; /** * Checks to see if a mouse drag starting at (`start_x,` `start_y)` and ending * at (`current_x,` `current_y)` has passed the GTK+ drag threshold, and thus * should trigger the beginning of a drag-and-drop operation. * @param widget a #GtkWidget * @param start_x X coordinate of start of drag * @param start_y Y coordinate of start of drag * @param current_x current X coordinate * @param current_y current Y coordinate * @returns %TRUE if the drag threshold has been passed. */ function drag_check_threshold( widget: Widget, start_x: number, start_y: number, current_x: number, current_y: number, ): boolean; /** * Add the image targets supported by #GtkSelection to * the target list of the drag destination. The targets * are added with `info` = 0. If you need another value, * use gtk_target_list_add_image_targets() and * gtk_drag_dest_set_target_list(). * @param widget a #GtkWidget that's a drag destination */ function drag_dest_add_image_targets(widget: Widget): void; /** * Add the text targets supported by #GtkSelection to * the target list of the drag destination. The targets * are added with `info` = 0. If you need another value, * use gtk_target_list_add_text_targets() and * gtk_drag_dest_set_target_list(). * @param widget a #GtkWidget that's a drag destination */ function drag_dest_add_text_targets(widget: Widget): void; /** * Add the URI targets supported by #GtkSelection to * the target list of the drag destination. The targets * are added with `info` = 0. If you need another value, * use gtk_target_list_add_uri_targets() and * gtk_drag_dest_set_target_list(). * @param widget a #GtkWidget that's a drag destination */ function drag_dest_add_uri_targets(widget: Widget): void; function drag_dest_find_target( widget: Widget, context: Gdk.DragContext, target_list?: TargetList | null, ): Gdk.Atom; /** * Returns the list of targets this widget can accept from * drag-and-drop. * @param widget a #GtkWidget * @returns the #GtkTargetList, or %NULL if none */ function drag_dest_get_target_list(widget: Widget): TargetList; /** * Returns whether the widget has been configured to always * emit ::drag-motion signals. * @param widget a #GtkWidget that's a drag destination * @returns %TRUE if the widget always emits ::drag-motion events */ function drag_dest_get_track_motion(widget: Widget): boolean; /** * Sets a widget as a potential drop destination, and adds default behaviors. * * The default behaviors listed in `flags` have an effect similar * to installing default handlers for the widget's drag-and-drop signals * (#GtkWidget:drag-motion, #GtkWidget:drag-drop, ...). They all exist * for convenience. When passing #GTK_DEST_DEFAULT_ALL for instance it is * sufficient to connect to the widget's #GtkWidget::drag-data-received * signal to get primitive, but consistent drag-and-drop support. * * Things become more complicated when you try to preview the dragged data, * as described in the documentation for #GtkWidget:drag-motion. The default * behaviors described by `flags` make some assumptions, that can conflict * with your own signal handlers. For instance #GTK_DEST_DEFAULT_DROP causes * invokations of gdk_drag_status() in the context of #GtkWidget:drag-motion, * and invokations of gtk_drag_finish() in #GtkWidget:drag-data-received. * Especially the later is dramatic, when your own #GtkWidget:drag-motion * handler calls gtk_drag_get_data() to inspect the dragged data. * * There's no way to set a default action here, you can use the * #GtkWidget:drag-motion callback for that. Here's an example which selects * the action to use depending on whether the control key is pressed or not: * * ``` * static void * drag_motion (GtkWidget *widget, * GdkDragContext *context, * gint x, * gint y, * guint time) * { * GdkModifierType mask; * * gdk_window_get_pointer (gtk_widget_get_window (widget), * NULL, NULL, &mask); * if (mask & GDK_CONTROL_MASK) * gdk_drag_status (context, GDK_ACTION_COPY, time); * else * gdk_drag_status (context, GDK_ACTION_MOVE, time); * } * ``` * * @param widget a #GtkWidget * @param flags which types of default drag behavior to use * @param targets a pointer to an array of #GtkTargetEntrys indicating the drop types that this @widget will accept, or %NULL. Later you can access the list with gtk_drag_dest_get_target_list() and gtk_drag_dest_find_target(). * @param actions a bitmask of possible actions for a drop onto this @widget. */ function drag_dest_set( widget: Widget, flags: DestDefaults | null, targets: TargetEntry[] | null, actions: Gdk.DragAction | null, ): void; function drag_dest_set_proxy( widget: Widget, proxy_window: Gdk.Window, protocol: Gdk.DragProtocol | null, use_coordinates: boolean, ): void; /** * Sets the target types that this widget can accept from drag-and-drop. * The widget must first be made into a drag destination with * gtk_drag_dest_set(). * @param widget a #GtkWidget that's a drag destination * @param target_list list of droppable targets, or %NULL for none */ function drag_dest_set_target_list(widget: Widget, target_list?: TargetList | null): void; /** * Tells the widget to emit ::drag-motion and ::drag-leave * events regardless of the targets and the %GTK_DEST_DEFAULT_MOTION * flag. * * This may be used when a widget wants to do generic * actions regardless of the targets that the source offers. * @param widget a #GtkWidget that's a drag destination * @param track_motion whether to accept all targets */ function drag_dest_set_track_motion(widget: Widget, track_motion: boolean): void; function drag_dest_unset(widget: Widget): void; function drag_finish(context: Gdk.DragContext, success: boolean, del: boolean, time_: number): void; function drag_get_data(widget: Widget, context: Gdk.DragContext, target: Gdk.Atom, time_: number): void; /** * Determines the source widget for a drag. * @param context a (destination side) drag context * @returns if the drag is occurring within a single application, a pointer to the source widget. Otherwise, %NULL. */ function drag_get_source_widget(context: Gdk.DragContext): Widget; function drag_highlight(widget: Widget): void; /** * Changes the default drag icon. GTK+ retains references for the * arguments, and will release them when they are no longer needed. * @param colormap the colormap of the icon * @param pixmap the image data for the icon * @param mask the transparency mask for an image, or %NULL * @param hot_x The X offset within @widget of the hotspot. * @param hot_y The Y offset within @widget of the hotspot. */ function drag_set_default_icon( colormap: Gdk.Colormap, pixmap: Gdk.Pixmap, mask: Gdk.Bitmap | null, hot_x: number, hot_y: number, ): void; /** * Sets the icon for a particular drag to the default * icon. * @param context the context for a drag. (This must be called with a context for the source side of a drag) */ function drag_set_icon_default(context: Gdk.DragContext): void; /** * Sets the icon for a given drag from a named themed icon. See * the docs for #GtkIconTheme for more details. Note that the * size of the icon depends on the icon theme (the icon is * loaded at the symbolic size #GTK_ICON_SIZE_DND), thus * `hot_x` and `hot_y` have to be used with care. * @param context the context for a drag. (This must be called with a context for the source side of a drag) * @param icon_name name of icon to use * @param hot_x the X offset of the hotspot within the icon * @param hot_y the Y offset of the hotspot within the icon */ function drag_set_icon_name(context: Gdk.DragContext, icon_name: string, hot_x: number, hot_y: number): void; /** * Sets `pixbuf` as the icon for a given drag. * @param context the context for a drag. (This must be called with a context for the source side of a drag) * @param pixbuf the #GdkPixbuf to use as the drag icon. * @param hot_x the X offset within @widget of the hotspot. * @param hot_y the Y offset within @widget of the hotspot. */ function drag_set_icon_pixbuf( context: Gdk.DragContext, pixbuf: GdkPixbuf.Pixbuf, hot_x: number, hot_y: number, ): void; /** * Sets `pixmap` as the icon for a given drag. GTK+ retains * references for the arguments, and will release them when * they are no longer needed. In general, gtk_drag_set_icon_pixbuf() * will be more convenient to use. * @param context the context for a drag. (This must be called with a context for the source side of a drag) * @param colormap the colormap of the icon * @param pixmap the image data for the icon * @param mask the transparency mask for the icon or %NULL for none. * @param hot_x the X offset within @pixmap of the hotspot. * @param hot_y the Y offset within @pixmap of the hotspot. */ function drag_set_icon_pixmap( context: Gdk.DragContext, colormap: Gdk.Colormap, pixmap: Gdk.Pixmap, mask: Gdk.Bitmap | null, hot_x: number, hot_y: number, ): void; /** * Sets the icon for a given drag from a stock ID. * @param context the context for a drag. (This must be called with a context for the source side of a drag) * @param stock_id the ID of the stock icon to use for the drag. * @param hot_x the X offset within the icon of the hotspot. * @param hot_y the Y offset within the icon of the hotspot. */ function drag_set_icon_stock(context: Gdk.DragContext, stock_id: string, hot_x: number, hot_y: number): void; /** * Changes the icon for a widget to a given widget. GTK+ * will not destroy the icon, so if you don't want * it to persist, you should connect to the "drag-end" * signal and destroy it yourself. * @param context the context for a drag. (This must be called with a context for the source side of a drag) * @param widget a toplevel window to use as an icon. * @param hot_x the X offset within @widget of the hotspot. * @param hot_y the Y offset within @widget of the hotspot. */ function drag_set_icon_widget(context: Gdk.DragContext, widget: Widget, hot_x: number, hot_y: number): void; /** * Add the writable image targets supported by #GtkSelection to * the target list of the drag source. The targets * are added with `info` = 0. If you need another value, * use gtk_target_list_add_image_targets() and * gtk_drag_source_set_target_list(). * @param widget a #GtkWidget that's is a drag source */ function drag_source_add_image_targets(widget: Widget): void; /** * Add the text targets supported by #GtkSelection to * the target list of the drag source. The targets * are added with `info` = 0. If you need another value, * use gtk_target_list_add_text_targets() and * gtk_drag_source_set_target_list(). * @param widget a #GtkWidget that's is a drag source */ function drag_source_add_text_targets(widget: Widget): void; /** * Add the URI targets supported by #GtkSelection to * the target list of the drag source. The targets * are added with `info` = 0. If you need another value, * use gtk_target_list_add_uri_targets() and * gtk_drag_source_set_target_list(). * @param widget a #GtkWidget that's is a drag source */ function drag_source_add_uri_targets(widget: Widget): void; /** * Gets the list of targets this widget can provide for * drag-and-drop. * @param widget a #GtkWidget * @returns the #GtkTargetList, or %NULL if none */ function drag_source_get_target_list(widget: Widget): TargetList; /** * Sets up a widget so that GTK+ will start a drag operation when the user * clicks and drags on the widget. The widget must have a window. * @param widget a #GtkWidget * @param start_button_mask the bitmask of buttons that can start the drag * @param targets the table of targets that the drag will support, may be %NULL * @param actions the bitmask of possible actions for a drag from this widget */ function drag_source_set( widget: Widget, start_button_mask: Gdk.ModifierType | null, targets: TargetEntry[] | null, actions: Gdk.DragAction | null, ): void; /** * Sets the icon that will be used for drags from a particular widget * from a pixmap/mask. GTK+ retains references for the arguments, and * will release them when they are no longer needed. * Use gtk_drag_source_set_icon_pixbuf() instead. * @param widget a #GtkWidget * @param colormap the colormap of the icon * @param pixmap the image data for the icon * @param mask the transparency mask for an image. */ function drag_source_set_icon( widget: Widget, colormap: Gdk.Colormap, pixmap: Gdk.Pixmap, mask?: Gdk.Bitmap | null, ): void; /** * Sets the icon that will be used for drags from a particular source * to a themed icon. See the docs for #GtkIconTheme for more details. * @param widget a #GtkWidget * @param icon_name name of icon to use */ function drag_source_set_icon_name(widget: Widget, icon_name: string): void; /** * Sets the icon that will be used for drags from a particular widget * from a #GdkPixbuf. GTK+ retains a reference for `pixbuf` and will * release it when it is no longer needed. * @param widget a #GtkWidget * @param pixbuf the #GdkPixbuf for the drag icon */ function drag_source_set_icon_pixbuf(widget: Widget, pixbuf: GdkPixbuf.Pixbuf): void; /** * Sets the icon that will be used for drags from a particular source * to a stock icon. * @param widget a #GtkWidget * @param stock_id the ID of the stock icon to use */ function drag_source_set_icon_stock(widget: Widget, stock_id: string): void; /** * Changes the target types that this widget offers for drag-and-drop. * The widget must first be made into a drag source with * gtk_drag_source_set(). * @param widget a #GtkWidget that's a drag source * @param target_list list of draggable targets, or %NULL for none */ function drag_source_set_target_list(widget: Widget, target_list?: TargetList | null): void; function drag_source_unset(widget: Widget): void; function drag_unhighlight(widget: Widget): void; /** * Draws an arrow in the given rectangle on `window` using the given * parameters. `arrow_type` determines the direction of the arrow. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param arrow_type the type of arrow to draw * @param fill %TRUE if the arrow tip should be filled * @param x x origin of the rectangle to draw the arrow in * @param y y origin of the rectangle to draw the arrow in * @param width width of the rectangle to draw the arrow in * @param height height of the rectangle to draw the arrow in */ function draw_arrow( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, arrow_type: ArrowType | null, fill: boolean, x: number, y: number, width: number, height: number, ): void; /** * Draws a box on `window` with the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param x x origin of the box * @param y y origin of the box * @param width the width of the box * @param height the height of the box */ function draw_box( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a box in `window` using the given style and state and shadow type, * leaving a gap in one side. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle * @param gap_side side in which to leave the gap * @param gap_x starting position of the gap * @param gap_width width of the gap */ function draw_box_gap( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, gap_side: PositionType | null, gap_x: number, gap_width: number, ): void; /** * Draws a check button indicator in the given rectangle on `window` with * the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param x x origin of the rectangle to draw the check in * @param y y origin of the rectangle to draw the check in * @param width the width of the rectangle to draw the check in * @param height the height of the rectangle to draw the check in */ function draw_check( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a diamond in the given rectangle on `window` using the given * parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param x x origin of the rectangle to draw the diamond in * @param y y origin of the rectangle to draw the diamond in * @param width width of the rectangle to draw the diamond in * @param height height of the rectangle to draw the diamond in */ function draw_diamond( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, ): void; /** * Draws an expander as used in #GtkTreeView. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param x the x position to draw the expander at * @param y the y position to draw the expander at * @param expander_style the style to draw the expander in */ function draw_expander( style: Style, window: Gdk.Window, state_type: StateType | null, x: number, y: number, expander_style: ExpanderStyle | null, ): void; /** * Draws an extension, i.e. a notebook tab. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param x x origin of the extension * @param y y origin of the extension * @param width width of the extension * @param height width of the extension * @param gap_side the side on to which the extension is attached */ function draw_extension( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, gap_side: PositionType | null, ): void; /** * Draws a flat box on `window` with the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param x x origin of the box * @param y y origin of the box * @param width the width of the box * @param height the height of the box */ function draw_flat_box( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a focus indicator around the given rectangle on `window` using the * given style. * @param style a #GtkStyle * @param window a #GdkWindow * @param x the x origin of the rectangle around which to draw a focus indicator * @param y the y origin of the rectangle around which to draw a focus indicator * @param width the width of the rectangle around which to draw a focus indicator * @param height the height of the rectangle around which to draw a focus indicator */ function draw_focus( style: Style, window: Gdk.Window, x: number, y: number, width: number, height: number, ): void; /** * Draws a handle as used in #GtkHandleBox and #GtkPaned. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param x x origin of the handle * @param y y origin of the handle * @param width with of the handle * @param height height of the handle * @param orientation the orientation of the handle */ function draw_handle( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, orientation: Orientation | null, ): void; /** * Draws a horizontal line from (`x1`, `y)` to (`x2`, `y)` in `window` * using the given style and state. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param x1 the starting x coordinate * @param x2 the ending x coordinate * @param y the y coordinate */ function draw_hline( style: Style, window: Gdk.Window, state_type: StateType | null, x1: number, x2: number, y: number, ): void; /** * Draws a text caret on `drawable` at `location`. This is not a style function * but merely a convenience function for drawing the standard cursor shape. * @param widget a #GtkWidget * @param drawable a #GdkDrawable * @param area rectangle to which the output is clipped, or %NULL if the output should not be clipped * @param location location where to draw the cursor (@location->width is ignored) * @param is_primary if the cursor should be the primary cursor color. * @param direction whether the cursor is left-to-right or right-to-left. Should never be #GTK_TEXT_DIR_NONE * @param draw_arrow %TRUE to draw a directional arrow on the cursor. Should be %FALSE unless the cursor is split. */ function draw_insertion_cursor( widget: Widget, drawable: Gdk.Drawable, area: Gdk.Rectangle | null, location: Gdk.Rectangle, is_primary: boolean, direction: TextDirection | null, draw_arrow: boolean, ): void; /** * Draws a layout on `window` using the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param use_text whether to use the text or foreground graphics context of @style * @param x x origin * @param y y origin * @param layout the layout to draw */ function draw_layout( style: Style, window: Gdk.Window, state_type: StateType | null, use_text: boolean, x: number, y: number, layout: Pango.Layout, ): void; /** * Draws a radio button indicator in the given rectangle on `window` with * the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param x x origin of the rectangle to draw the option in * @param y y origin of the rectangle to draw the option in * @param width the width of the rectangle to draw the option in * @param height the height of the rectangle to draw the option in */ function draw_option( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a polygon on `window` with the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param points an array of #GdkPoints * @param npoints length of @points * @param fill %TRUE if the polygon should be filled */ function draw_polygon( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, points: Gdk.Point, npoints: number, fill: boolean, ): void; /** * Draws a resize grip in the given rectangle on `window` using the given * parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param edge the edge in which to draw the resize grip * @param x the x origin of the rectangle in which to draw the resize grip * @param y the y origin of the rectangle in which to draw the resize grip * @param width the width of the rectangle in which to draw the resize grip * @param height the height of the rectangle in which to draw the resize grip */ function draw_resize_grip( style: Style, window: Gdk.Window, state_type: StateType | null, edge: Gdk.WindowEdge | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a shadow around the given rectangle in `window` * using the given style and state and shadow type. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle */ function draw_shadow( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a shadow around the given rectangle in `window` * using the given style and state and shadow type, leaving a * gap in one side. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle * @param gap_side side in which to leave the gap * @param gap_x starting position of the gap * @param gap_width width of the gap */ function draw_shadow_gap( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, gap_side: PositionType | null, gap_x: number, gap_width: number, ): void; /** * Draws a slider in the given rectangle on `window` using the * given style and orientation. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type a shadow * @param x the x origin of the rectangle in which to draw a slider * @param y the y origin of the rectangle in which to draw a slider * @param width the width of the rectangle in which to draw a slider * @param height the height of the rectangle in which to draw a slider * @param orientation the orientation to be used */ function draw_slider( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, orientation: Orientation | null, ): void; /** * Draws a text string on `window` with the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param x x origin * @param y y origin * @param string the string to draw */ function draw_string( style: Style, window: Gdk.Window, state_type: StateType | null, x: number, y: number, string: string, ): void; /** * Draws an option menu tab (i.e. the up and down pointing arrows) * in the given rectangle on `window` using the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param x x origin of the rectangle to draw the tab in * @param y y origin of the rectangle to draw the tab in * @param width the width of the rectangle to draw the tab in * @param height the height of the rectangle to draw the tab in */ function draw_tab( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a vertical line from (`x,` `y1`_) to (`x,` `y2`_) in `window` * using the given style and state. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param y1_ the starting y coordinate * @param y2_ the ending y coordinate * @param x the x coordinate */ function draw_vline( style: Style, window: Gdk.Window, state_type: StateType | null, y1_: number, y2_: number, x: number, ): void; function events_pending(): boolean; function exit(error_code: number): void; function __false(): boolean; /** * Registers an error quark for #GtkFileChooser if necessary. * @returns The error quark used for #GtkFileChooser errors. */ function file_chooser_error_quark(): GLib.Quark; function gc_release(gc: Gdk.GC): void; /** * Obtains a copy of the event currently being processed by GTK+. For * example, if you get a "clicked" signal from #GtkButton, the current * event will be the #GdkEventButton that triggered the "clicked" * signal. The returned event must be freed with gdk_event_free(). * If there is no current event, the function returns %NULL. * @returns a copy of the current event, or %NULL if no current event. */ function get_current_event(): Gdk.Event; /** * If there is a current event and it has a state field, place * that state field in `state` and return %TRUE, otherwise return * %FALSE. * @returns %TRUE if there was a current event and it had a state field */ function get_current_event_state(): [boolean, Gdk.ModifierType]; /** * If there is a current event and it has a timestamp, return that * timestamp, otherwise return %GDK_CURRENT_TIME. * @returns the timestamp from the current event, or %GDK_CURRENT_TIME. */ function get_current_event_time(): number; /** * Returns the #PangoLanguage for the default language currently in * effect. (Note that this can change over the life of an * application.) The default language is derived from the current * locale. It determines, for example, whether GTK+ uses the * right-to-left or left-to-right text direction. * * This function is equivalent to pango_language_get_default(). See * that function for details. * @returns the default language as a #PangoLanguage, must not be freed */ function get_default_language(): Pango.Language; /** * If `event` is %NULL or the event was not associated with any widget, * returns %NULL, otherwise returns the widget that received the event * originally. * @param event a #GdkEvent * @returns the widget that originally received @event, or %NULL */ function get_event_widget(event: Gdk.Event): Widget; /** * Returns a #GOptionGroup for the commandline arguments recognized * by GTK+ and GDK. You should add this group to your #GOptionContext * with g_option_context_add_group(), if you are using * g_option_context_parse() to parse your commandline arguments. * @param open_default_display whether to open the default display when parsing the commandline arguments * @returns a #GOptionGroup for the commandline arguments recognized by GTK+ */ function get_option_group(open_default_display: boolean): GLib.OptionGroup; function grab_add(widget: Widget): void; /** * Queries the current grab of the default window group. * @returns The widget which currently has the grab or %NULL if no grab is active */ function grab_get_current(): Widget; function grab_remove(widget: Widget): void; /** * Looks up the icon size associated with `name`. * @param name the name to look up. * @returns the icon size */ function icon_size_from_name(name: string): number; /** * Gets the canonical name of the given icon size. The returned string * is statically allocated and should not be freed. * @param size a #GtkIconSize. * @returns the name of the given icon size. */ function icon_size_get_name(size: number): string; /** * Obtains the pixel size of a semantic icon size, possibly * modified by user preferences for the default #GtkSettings. * (See gtk_icon_size_lookup_for_settings().) * Normally `size` would be * #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function * isn't normally needed, gtk_widget_render_icon() is the usual * way to get an icon for rendering, then just look at the size of * the rendered pixbuf. The rendered pixbuf may not even correspond to * the width/height returned by gtk_icon_size_lookup(), because themes * are free to render the pixbuf however they like, including changing * the usual size. * @param size an icon size * @returns %TRUE if @size was a valid size */ function icon_size_lookup(size: number): [boolean, number, number]; /** * Obtains the pixel size of a semantic icon size, possibly * modified by user preferences for a particular * #GtkSettings. Normally `size` would be * #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function * isn't normally needed, gtk_widget_render_icon() is the usual * way to get an icon for rendering, then just look at the size of * the rendered pixbuf. The rendered pixbuf may not even correspond to * the width/height returned by gtk_icon_size_lookup(), because themes * are free to render the pixbuf however they like, including changing * the usual size. * @param settings a #GtkSettings object, used to determine which set of user preferences to used. * @param size an icon size * @returns %TRUE if @size was a valid size */ function icon_size_lookup_for_settings(settings: Settings, size: number): [boolean, number, number]; /** * Registers a new icon size, along the same lines as #GTK_ICON_SIZE_MENU, * etc. Returns the integer value for the size. * @param name name of the icon size * @param width the icon width * @param height the icon height * @returns integer value representing the size */ function icon_size_register(name: string, width: number, height: number): number; /** * Registers `alias` as another name for `target`. * So calling gtk_icon_size_from_name() with `alias` as argument * will return `target`. * @param alias an alias for @target * @param target an existing icon size */ function icon_size_register_alias(alias: string, target: number): void; function icon_theme_error_quark(): GLib.Quark; function idle_remove(idle_handler_id: number): void; function idle_remove_by_data(data?: any | null): void; /** * Call this function before using any other GTK+ functions in your GUI * applications. It will initialize everything needed to operate the * toolkit and parses some standard command line options. * * `argc` and `argv` are adjusted accordingly so your own code will * never see those standard arguments. * * Note that there are some alternative ways to initialize GTK+: * if you are calling gtk_parse_args(), gtk_init_check(), * gtk_init_with_args() or g_option_context_parse() with * the option group returned by gtk_get_option_group(), * you don't have to call gtk_init(). * * * This function will terminate your program if it was unable to * initialize the windowing system for some reason. If you want * your program to fall back to a textual interface you want to * call gtk_init_check() instead. * * * * Since 2.18, GTK+ calls signal (SIGPIPE, SIG_IGN) * during initialization, to ignore SIGPIPE signals, since these are * almost never wanted in graphical applications. If you do need to * handle SIGPIPE for some reason, reset the handler after gtk_init(), * but notice that other libraries (e.g. libdbus or gvfs) might do * similar things. * * @param argv Address of the argv parameter of main(). Any options understood by GTK+ are stripped before return. */ function init(argv?: string[] | null): string[] | null; /** * This function does the same work as gtk_init() with only * a single change: It does not terminate the program if the GUI 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. * @param argv Address of the argv parameter of main(). Any parameters understood by gtk_init() are stripped before return. * @returns %TRUE if the GUI has been successfully initialized, %FALSE otherwise. */ function init_check(argv?: string[] | null): [boolean, string[] | null]; /** * This function does the same work as gtk_init_check(). * Additionally, it allows you to add your own commandline options, * and it automatically generates nicely formatted * output. Note that your program will * be terminated after writing out the help output. * @param argv a pointer to the array of command line arguments. * @param parameter_string a string which is displayed in the first line of output, after programname [OPTION...] * @param entries a %NULL-terminated array of #GOptionEntrys describing the options of your program * @param translation_domain a translation domain to use for translating the output for the options in @entries and the @parameter_string with gettext(), or %NULL * @returns %TRUE if the GUI has been successfully initialized, %FALSE otherwise. */ function init_with_args( argv: string[], parameter_string: string, entries: GLib.OptionEntry[], translation_domain: string, ): [boolean, string[]]; function input_remove(input_handler_id: number): void; function key_snooper_remove(snooper_handler_id: number): void; function main(): void; function main_do_event(event: Gdk.Event): void; function main_iteration(): boolean; function main_iteration_do(blocking: boolean): boolean; function main_level(): number; function main_quit(): void; function marshal_BOOLEAN__POINTER( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_BOOLEAN__POINTER_INT_INT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_BOOLEAN__POINTER_INT_INT_UINT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_BOOLEAN__POINTER_POINTER_INT_INT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_BOOLEAN__POINTER_STRING_STRING_POINTER( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_BOOLEAN__VOID( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_ENUM__ENUM( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_INT__POINTER( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_INT__POINTER_CHAR_CHAR( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__ENUM_FLOAT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__ENUM_FLOAT_BOOLEAN( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__INT_INT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__INT_INT_POINTER( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_INT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_POINTER( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_POINTER_POINTER( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_POINTER_UINT_UINT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_STRING_STRING( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_UINT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_UINT_ENUM( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__POINTER_UINT_UINT( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__STRING_INT_POINTER( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__UINT_POINTER_UINT_UINT_ENUM( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; function marshal_VOID__UINT_STRING( closure: GObject.Closure, return_value: GObject.Value | any, n_param_values: number, param_values: GObject.Value | any, invocation_hint?: any | null, marshal_data?: any | null, ): void; /** * Draws an arrow in the given rectangle on `window` using the given * parameters. `arrow_type` determines the direction of the arrow. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param arrow_type the type of arrow to draw * @param fill %TRUE if the arrow tip should be filled * @param x x origin of the rectangle to draw the arrow in * @param y y origin of the rectangle to draw the arrow in * @param width width of the rectangle to draw the arrow in * @param height height of the rectangle to draw the arrow in */ function paint_arrow( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, arrow_type: ArrowType | null, fill: boolean, x: number, y: number, width: number, height: number, ): void; /** * Draws a box on `window` with the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the box * @param y y origin of the box * @param width the width of the box * @param height the height of the box */ function paint_box( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a box in `window` using the given style and state and shadow type, * leaving a gap in one side. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle * @param gap_side side in which to leave the gap * @param gap_x starting position of the gap * @param gap_width width of the gap */ function paint_box_gap( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, gap_side: PositionType | null, gap_x: number, gap_width: number, ): void; /** * Draws a check button indicator in the given rectangle on `window` with * the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle to draw the check in * @param y y origin of the rectangle to draw the check in * @param width the width of the rectangle to draw the check in * @param height the height of the rectangle to draw the check in */ function paint_check( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a diamond in the given rectangle on `window` using the given * parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle to draw the diamond in * @param y y origin of the rectangle to draw the diamond in * @param width width of the rectangle to draw the diamond in * @param height height of the rectangle to draw the diamond in */ function paint_diamond( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, ): void; /** * Draws an expander as used in #GtkTreeView. `x` and `y` specify the * center the expander. The size of the expander is determined by the * "expander-size" style property of `widget`. (If widget is not * specified or doesn't have an "expander-size" property, an * unspecified default size will be used, since the caller doesn't * have sufficient information to position the expander, this is * likely not useful.) The expander is expander_size pixels tall * in the collapsed position and expander_size pixels wide in the * expanded position. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x the x position to draw the expander at * @param y the y position to draw the expander at * @param expander_style the style to draw the expander in; determines whether the expander is collapsed, expanded, or in an intermediate state. */ function paint_expander( style: Style, window: Gdk.Window, state_type: StateType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, expander_style: ExpanderStyle | null, ): void; /** * Draws an extension, i.e. a notebook tab. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the extension * @param y y origin of the extension * @param width width of the extension * @param height width of the extension * @param gap_side the side on to which the extension is attached */ function paint_extension( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, gap_side: PositionType | null, ): void; /** * Draws a flat box on `window` with the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the box * @param y y origin of the box * @param width the width of the box * @param height the height of the box */ function paint_flat_box( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a focus indicator around the given rectangle on `window` using the * given style. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x the x origin of the rectangle around which to draw a focus indicator * @param y the y origin of the rectangle around which to draw a focus indicator * @param width the width of the rectangle around which to draw a focus indicator * @param height the height of the rectangle around which to draw a focus indicator */ function paint_focus( style: Style, window: Gdk.Window, state_type: StateType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a handle as used in #GtkHandleBox and #GtkPaned. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the handle * @param y y origin of the handle * @param width with of the handle * @param height height of the handle * @param orientation the orientation of the handle */ function paint_handle( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, orientation: Orientation | null, ): void; /** * Draws a horizontal line from (`x1`, `y)` to (`x2`, `y)` in `window` * using the given style and state. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param area rectangle to which the output is clipped, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x1 the starting x coordinate * @param x2 the ending x coordinate * @param y the y coordinate */ function paint_hline( style: Style, window: Gdk.Window, state_type: StateType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x1: number, x2: number, y: number, ): void; /** * Draws a layout on `window` using the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param use_text whether to use the text or foreground graphics context of @style * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin * @param y y origin * @param layout the layout to draw */ function paint_layout( style: Style, window: Gdk.Window, state_type: StateType | null, use_text: boolean, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, layout: Pango.Layout, ): void; /** * Draws a radio button indicator in the given rectangle on `window` with * the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle to draw the option in * @param y y origin of the rectangle to draw the option in * @param width the width of the rectangle to draw the option in * @param height the height of the rectangle to draw the option in */ function paint_option( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a polygon on `window` with the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param points an array of #GdkPoints * @param n_points length of @points * @param fill %TRUE if the polygon should be filled */ function paint_polygon( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, points: Gdk.Point, n_points: number, fill: boolean, ): void; /** * Draws a resize grip in the given rectangle on `window` using the given * parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param edge the edge in which to draw the resize grip * @param x the x origin of the rectangle in which to draw the resize grip * @param y the y origin of the rectangle in which to draw the resize grip * @param width the width of the rectangle in which to draw the resize grip * @param height the height of the rectangle in which to draw the resize grip */ function paint_resize_grip( style: Style, window: Gdk.Window, state_type: StateType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, edge: Gdk.WindowEdge | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a shadow around the given rectangle in `window` * using the given style and state and shadow type. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param area clip rectangle or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle */ function paint_shadow( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a shadow around the given rectangle in `window` * using the given style and state and shadow type, leaving a * gap in one side. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle * @param y y origin of the rectangle * @param width width of the rectangle * @param height width of the rectangle * @param gap_side side in which to leave the gap * @param gap_x starting position of the gap * @param gap_width width of the gap */ function paint_shadow_gap( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, gap_side: PositionType | null, gap_x: number, gap_width: number, ): void; /** * Draws a slider in the given rectangle on `window` using the * given style and orientation. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type a shadow * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x the x origin of the rectangle in which to draw a slider * @param y the y origin of the rectangle in which to draw a slider * @param width the width of the rectangle in which to draw a slider * @param height the height of the rectangle in which to draw a slider * @param orientation the orientation to be used */ function paint_slider( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, orientation: Orientation | null, ): void; /** * Draws a spinner on `window` using the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget (may be %NULL) * @param detail a style detail (may be %NULL) * @param step the nth step, a value between 0 and #GtkSpinner:num-steps * @param x the x origin of the rectangle in which to draw the spinner * @param y the y origin of the rectangle in which to draw the spinner * @param width the width of the rectangle in which to draw the spinner * @param height the height of the rectangle in which to draw the spinner */ function paint_spinner( style: Style, window: Gdk.Window, state_type: StateType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, step: number, x: number, y: number, width: number, height: number, ): void; /** * Draws a text string on `window` with the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin * @param y y origin * @param string the string to draw */ function paint_string( style: Style, window: Gdk.Window, state_type: StateType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, string: string, ): void; /** * Draws an option menu tab (i.e. the up and down pointing arrows) * in the given rectangle on `window` using the given parameters. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param shadow_type the type of shadow to draw * @param area clip rectangle, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param x x origin of the rectangle to draw the tab in * @param y y origin of the rectangle to draw the tab in * @param width the width of the rectangle to draw the tab in * @param height the height of the rectangle to draw the tab in */ function paint_tab( style: Style, window: Gdk.Window, state_type: StateType | null, shadow_type: ShadowType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, x: number, y: number, width: number, height: number, ): void; /** * Draws a vertical line from (`x,` `y1`_) to (`x,` `y2`_) in `window` * using the given style and state. * @param style a #GtkStyle * @param window a #GdkWindow * @param state_type a state * @param area rectangle to which the output is clipped, or %NULL if the output should not be clipped * @param widget the widget * @param detail a style detail * @param y1_ the starting y coordinate * @param y2_ the ending y coordinate * @param x the x coordinate */ function paint_vline( style: Style, window: Gdk.Window, state_type: StateType | null, area: Gdk.Rectangle | null, widget: Widget | null, detail: string | null, y1_: number, y2_: number, x: number, ): void; /** * Returns the name of the default paper size, which * depends on the current locale. * @returns the name of the default paper size. The string is owned by GTK+ and should not be modified. */ 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 #GtkPaperSize objects */ function paper_size_get_paper_sizes(include_custom: boolean): PaperSize[]; /** * Parses command line arguments, and initializes global * attributes of GTK+, but does not actually open a connection * to a display. (See gdk_display_open(), gdk_get_display_arg_name()) * * Any arguments used by GTK+ or GDK are removed from the array and * `argc` and `argv` are updated accordingly. * * There is no need to call this function explicitely if you are using * gtk_init(), or gtk_init_check(). * @param argv a pointer to the array of command line arguments * @returns %TRUE if initialization succeeded, otherwise %FALSE. */ function parse_args(argv: string[]): [boolean, string[]]; /** * Registers an error quark for #GtkPrintOperation if necessary. * @returns The error quark used for #GtkPrintOperation 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 #GtkPageSetup * is identical to the passed in `page_setup,` otherwise it contains the * modifications done in the dialog. * * Note that this function may use a recursive mainloop to show the page * setup dialog. See gtk_print_run_page_setup_dialog_async() if this is * a problem. * @param parent transient parent * @param page_setup an existing #GtkPageSetup * @param settings a #GtkPrintSettings * @returns a new #GtkPageSetup */ function print_run_page_setup_dialog( parent: Window | null, page_setup: PageSetup | null, settings: PrintSettings, ): PageSetup; /** * Sends an event to a widget, propagating the event to parent widgets * if the event remains unhandled. Events received by GTK+ from GDK * normally begin in gtk_main_do_event(). Depending on the type of * event, existence of modal dialogs, grabs, etc., the event may be * propagated; if so, this function is used. gtk_propagate_event() * calls gtk_widget_event() on each widget it decides to send the * event to. So gtk_widget_event() is the lowest-level function; it * simply emits the "event" and possibly an event-specific signal on a * widget. gtk_propagate_event() is a bit higher-level, and * gtk_main_do_event() is the highest level. * * All that said, you most likely don't want to use any of these * functions; synthesizing events is rarely needed. Consider asking on * the mailing list for better ways to achieve your goals. For * example, use gdk_window_invalidate_rect() or * gtk_widget_queue_draw() instead of making up expose events. * @param widget a #GtkWidget * @param event an event */ function propagate_event(widget: Widget, event: Gdk.Event): void; function quit_add_destroy(main_level: number, object: Object): void; function quit_remove(quit_handler_id: number): void; function quit_remove_by_data(data?: any | null): void; function rc_add_class_style(rc_style: RcStyle, pattern: string): void; /** * Adds a file to the list of files to be parsed at the * end of gtk_init(). * @param filename the pathname to the file. If @filename is not absolute, it is searched in the current directory. */ function rc_add_default_file(filename: string): void; function rc_add_widget_class_style(rc_style: RcStyle, pattern: string): void; function rc_add_widget_name_style(rc_style: RcStyle, pattern: string): void; /** * Searches for a theme engine in the GTK+ search path. This function * is not useful for applications and should not be used. * @param module_file name of a theme engine * @returns The filename, if found (must be freed with g_free()), otherwise %NULL. */ function rc_find_module_in_path(module_file: string): string; /** * Looks up a file in pixmap path for the specified #GtkSettings. * If the file is not found, it outputs a warning message using * g_warning() and returns %NULL. * @param settings a #GtkSettings * @param scanner Scanner used to get line number information for the warning message, or %NULL * @param pixmap_file name of the pixmap file to locate. * @returns the filename. */ function rc_find_pixmap_in_path(settings: Settings, scanner: GLib.Scanner, pixmap_file: string): string; /** * Retrieves the current list of RC files that will be parsed * at the end of gtk_init(). * @returns A %NULL-terminated array of filenames. This memory is owned by GTK+ and must not be freed by the application. If you want to store this information, you should make a copy. */ function rc_get_default_files(): string[]; /** * Obtains the path to the IM modules file. See the documentation * of the GTK_IM_MODULE_FILE * environment variable for more details. * @returns a newly-allocated string containing the name of the file listing the IM modules available for loading */ function rc_get_im_module_file(): string; /** * Obtains the path in which to look for IM modules. See the documentation * of the GTK_PATH * environment variable for more details about looking up modules. This * function is useful solely for utilities supplied with GTK+ and should * not be used by applications under normal circumstances. * @returns a newly-allocated string containing the path in which to look for IM modules. */ function rc_get_im_module_path(): string; /** * Returns a directory in which GTK+ looks for theme engines. * For full information about the search for theme engines, * see the docs for GTK_PATH in * . * @returns the directory. (Must be freed with g_free()) */ function rc_get_module_dir(): string; /** * Finds all matching RC styles for a given widget, * composites them together, and then creates a * #GtkStyle representing the composite appearance. * (GTK+ actually keeps a cache of previously * created styles, so a new style may not be * created.) * @param widget a #GtkWidget * @returns the resulting style. No refcount is added to the returned style, so if you want to save this style around, you should add a reference yourself. */ function rc_get_style(widget: Widget): Style; /** * Creates up a #GtkStyle from styles defined in a RC file by providing * the raw components used in matching. This function may be useful * when creating pseudo-widgets that should be themed like widgets but * don't actually have corresponding GTK+ widgets. An example of this * would be items inside a GNOME canvas widget. * * The action of gtk_rc_get_style() is similar to: * * ``` * gtk_widget_path (widget, NULL, &path, NULL); * gtk_widget_class_path (widget, NULL, &class_path, NULL); * gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget), * path, class_path, * G_OBJECT_TYPE (widget)); * ``` * * @param settings a #GtkSettings object * @param widget_path the widget path to use when looking up the style, or %NULL if no matching against the widget path should be done * @param class_path the class path to use when looking up the style, or %NULL if no matching against the class path should be done. * @param type a type that will be used along with parent types of this type when matching against class styles, or #G_TYPE_NONE * @returns A style created by matching with the supplied paths, or %NULL if nothing matching was specified and the default style should be used. The returned value is owned by GTK+ as part of an internal cache, so you must call g_object_ref() on the returned value if you want to keep a reference to it. */ function rc_get_style_by_paths( settings: Settings, widget_path: string | null, class_path: string | null, type: GObject.GType, ): Style; function rc_get_theme_dir(): string; function rc_parse(filename: string): void; /** * Parses a color in the format expected * in a RC file. * * Note that theme engines should use gtk_rc_parse_color_full() in * order to support symbolic colors. * @param scanner a #GScanner * @returns %G_TOKEN_NONE if parsing succeeded, otherwise the token that was expected but not found */ function rc_parse_color(scanner: GLib.Scanner): [number, Gdk.Color]; /** * Parses a color in the format expected * in a RC file. If `style` is not %NULL, it will be consulted to resolve * references to symbolic colors. * @param scanner a #GScanner * @param style a #GtkRcStyle, or %NULL * @returns %G_TOKEN_NONE if parsing succeeded, otherwise the token that was expected but not found */ function rc_parse_color_full(scanner: GLib.Scanner, style: RcStyle | null): [number, Gdk.Color]; function rc_parse_priority(scanner: GLib.Scanner, priority: PathPriorityType | null): number; function rc_parse_state(scanner: GLib.Scanner, state: StateType | null): number; function rc_parse_string(rc_string: string): void; /** * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser() * or gtk_widget_class_install_style_property_parser() which parses * borders in the form * "{ left, right, top, bottom }" for integers * %left, %right, %top and %bottom. * @param pspec a #GParamSpec * @param gstring the #GString to be parsed * @param property_value a #GValue which must hold boxed values. * @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting #GtkBorder. */ function rc_property_parse_border( pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any, ): boolean; /** * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser() * or gtk_widget_class_install_style_property_parser() which parses a * color given either by its name or in the form * { red, green, blue } where %red, %green and * %blue are integers between 0 and 65535 or floating-point numbers * between 0 and 1. * @param pspec a #GParamSpec * @param gstring the #GString to be parsed * @param property_value a #GValue which must hold #GdkColor values. * @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting #GdkColor. */ function rc_property_parse_color( pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any, ): boolean; /** * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser() * or gtk_widget_class_install_style_property_parser() which parses a single * enumeration value. * * The enumeration value can be specified by its name, its nickname or * its numeric value. For consistency with flags parsing, the value * may be surrounded by parentheses. * @param pspec a #GParamSpec * @param gstring the #GString to be parsed * @param property_value a #GValue which must hold enum values. * @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting #GEnumValue. */ function rc_property_parse_enum( pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any, ): boolean; /** * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser() * or gtk_widget_class_install_style_property_parser() which parses flags. * * Flags can be specified by their name, their nickname or * numerically. Multiple flags can be specified in the form * "( flag1 | flag2 | ... )". * @param pspec a #GParamSpec * @param gstring the #GString to be parsed * @param property_value a #GValue which must hold flags values. * @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting flags value. */ function rc_property_parse_flags( pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any, ): boolean; /** * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser() * or gtk_widget_class_install_style_property_parser() which parses a * requisition in the form * "{ width, height }" for integers %width and %height. * @param pspec a #GParamSpec * @param gstring the #GString to be parsed * @param property_value a #GValue which must hold boxed values. * @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting #GtkRequisition. */ function rc_property_parse_requisition( pspec: GObject.ParamSpec, gstring: GLib.String, property_value: GObject.Value | any, ): boolean; /** * If the modification time on any previously read file for the * default #GtkSettings has changed, discard all style information * and then reread all previously read RC files. * @returns %TRUE if the files were reread. */ function rc_reparse_all(): boolean; /** * If the modification time on any previously read file * for the given #GtkSettings has changed, discard all style information * and then reread all previously read RC files. * @param settings a #GtkSettings * @param force_load load whether or not anything changed * @returns %TRUE if the files were reread. */ function rc_reparse_all_for_settings(settings: Settings, force_load: boolean): boolean; /** * This function recomputes the styles for all widgets that use a * particular #GtkSettings object. (There is one #GtkSettings object * per #GdkScreen, see gtk_settings_get_for_screen()); It is useful * when some global parameter has changed that affects the appearance * of all widgets, because when a widget gets a new style, it will * both redraw and recompute any cached information about its * appearance. As an example, it is used when the default font size * set by the operating system changes. Note that this function * doesn't affect widgets that have a style set explicitely on them * with gtk_widget_set_style(). * @param settings a #GtkSettings */ function rc_reset_styles(settings: Settings): void; /** * Sets the list of files that GTK+ will read at the * end of gtk_init(). * @param filenames A %NULL-terminated list of filenames. */ function rc_set_default_files(filenames: string): void; function recent_chooser_error_quark(): GLib.Quark; function recent_manager_error_quark(): GLib.Quark; /** * 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]; /** * Appends a specified target to the list of supported targets for a * given widget and selection. * @param widget a #GtkTarget * @param selection the selection * @param target target to add. * @param info A unsigned integer which will be passed back to the application. */ function selection_add_target(widget: Widget, selection: Gdk.Atom, target: Gdk.Atom, info: number): void; /** * Prepends a table of targets to the list of supported targets * for a given widget and selection. * @param widget a #GtkWidget * @param selection the selection * @param targets a table of targets to add */ function selection_add_targets(widget: Widget, selection: Gdk.Atom, targets: TargetEntry[]): void; /** * The default handler for the #GtkWidget::selection-clear-event * signal. * @param widget a #GtkWidget * @param event the event * @returns %TRUE if the event was handled, otherwise false */ function selection_clear(widget: Widget, event: Gdk.EventSelection): boolean; /** * Remove all targets registered for the given selection for the * widget. * @param widget a #GtkWidget * @param selection an atom representing a selection */ function selection_clear_targets(widget: Widget, selection: Gdk.Atom): void; /** * Requests the contents of a selection. When received, * a "selection-received" signal will be generated. * @param widget The widget which acts as requestor * @param selection Which selection to get * @param target Form of information desired (e.g., STRING) * @param time_ Time of request (usually of triggering event) In emergency, you could use #GDK_CURRENT_TIME * @returns %TRUE if requested succeeded. %FALSE if we could not process request. (e.g., there was already a request in process for this widget). */ function selection_convert(widget: Widget, selection: Gdk.Atom, target: Gdk.Atom, time_: number): boolean; /** * Claims ownership of a given selection for a particular widget, * or, if `widget` is %NULL, release ownership of the selection. * @param widget a #GtkWidget, or %NULL. * @param selection an interned atom representing the selection to claim * @param time_ timestamp with which to claim the selection * @returns %TRUE if the operation succeeded */ function selection_owner_set(widget: Widget | null, selection: Gdk.Atom, time_: number): boolean; /** * Claim ownership of a given selection for a particular widget, or, * if `widget` is %NULL, release ownership of the selection. * @param display the #Gdkdisplay where the selection is set * @param widget new selection owner (a #GdkWidget), or %NULL. * @param selection an interned atom representing the selection to claim. * @param time_ timestamp with which to claim the selection * @returns TRUE if the operation succeeded */ function selection_owner_set_for_display( display: Gdk.Display, widget: Widget | null, selection: Gdk.Atom, time_: number, ): boolean; /** * Removes all handlers and unsets ownership of all * selections for a widget. Called when widget is being * destroyed. This function will not generally be * called by applications. * @param widget a #GtkWidget */ function selection_remove_all(widget: Widget): void; /** * Initializes internationalization support for GTK+. gtk_init() * automatically does this, so there is typically no point * in calling this function. * * If you are calling this function because you changed the locale * after GTK+ is was initialized, then calling this function * may help a bit. (Note, however, that changing the locale * after GTK+ is initialized may produce inconsistent results and * is not really supported.) * * In detail - sets the current locale according to the * program environment. This is the same as calling the C library function * setlocale (LC_ALL, "") but also takes care of the * locale specific setup of the windowing system used by GDK. * @returns a string corresponding to the locale set, typically in the form lang_COUNTRY, where lang is an ISO-639 language code, and COUNTRY is an ISO-3166 country code. On Unix, this form matches the result of the setlocale(); it is also used on other machines, such as Windows, where the C library returns a different result. The string is owned by GTK+ and should not be modified or freed. */ function set_locale(): string; /** * This is a convenience function for launching the default application * to show the uri. The uri must be of a form understood by GIO (i.e. you * need to install gvfs to get support for uri schemes such as http:// * or ftp://, as only local files are handled by GIO itself). * Typical examples are * * file:///home/gnome/pict.jpg * http://www.gnome.org * mailto:me@gnome.org * * Ideally the timestamp is taken from the event triggering * the gtk_show_uri() call. If timestamp is not known you can take * %GDK_CURRENT_TIME. * * This function can be used as a replacement for gnome_vfs_url_show() * and gnome_url_show(). * @param screen screen to show the uri on or %NULL for the default screen * @param uri the uri to show * @param timestamp a timestamp to prevent focus stealing. * @returns %TRUE on success, %FALSE on error. */ function show_uri(screen: Gdk.Screen | null, uri: string, timestamp: number): boolean; function signal_emit_stop_by_name(object: Object, name: string): void; function signal_emitv(object: Object, signal_id: number, args: Arg): void; function signal_emitv_by_name(object: Object, name: string, args: Arg): void; function signal_newv( name: string, signal_flags: SignalRunType | null, object_type: GObject.GType, function_offset: number, marshaller: GObject.SignalCMarshaller, return_val: GObject.GType, n_args: number, args: GObject.GType, ): number; /** * Registers each of the stock items in `items`. If an item already * exists with the same stock ID as one of the `items,` the old item * gets replaced. The stock items are copied, so GTK+ does not hold * any pointer into `items` and `items` can be freed. Use * gtk_stock_add_static() if `items` is persistent and GTK+ need not * copy the array. * @param items a #GtkStockItem or array of items */ function stock_add(items: StockItem[]): void; /** * Same as gtk_stock_add(), but doesn't copy `items,` so * `items` must persist until application exit. * @param items a #GtkStockItem or array of #GtkStockItem */ function stock_add_static(items: StockItem[]): void; /** * Retrieves a list of all known stock IDs added to a #GtkIconFactory * or registered with gtk_stock_add(). The list must be freed with g_slist_free(), * and each string in the list must be freed with g_free(). * @returns a list of known stock IDs */ function stock_list_ids(): string[]; /** * Fills `item` with the registered values for `stock_id,` returning %TRUE * if `stock_id` was known. * @param stock_id a stock item name * @returns %TRUE if @item was initialized */ function stock_lookup(stock_id: string): [boolean, StockItem]; /** * Sets a function to be used for translating the `label` of * a stock item. * * If no function is registered for a translation domain, * g_dgettext() is used. * * The function is used for all stock items whose * `translation_domain` matches `domain`. Note that it is possible * to use strings different from the actual gettext translation domain * of your application for this, as long as your #GtkTranslateFunc uses * the correct domain when calling dgettext(). This can be useful, e.g. * when dealing with message contexts: * * * ``` * GtkStockItem items[] = { * { MY_ITEM1, NC_("odd items", "Item 1"), 0, 0, "odd-item-domain" }, * { MY_ITEM2, NC_("even items", "Item 2"), 0, 0, "even-item-domain" }, * }; * * gchar * * my_translate_func (const gchar *msgid, * gpointer data) * { * gchar *msgctxt = data; * * return (gchar*)g_dpgettext2 (GETTEXT_PACKAGE, msgctxt, msgid); * } * * /* ... */ * * gtk_stock_add (items, G_N_ELEMENTS (items)); * gtk_stock_set_translate_func ("odd-item-domain", my_translate_func, "odd items"); * gtk_stock_set_translate_func ("even-item-domain", my_translate_func, "even items"); * ``` * * @param domain the translation domain for which @func shall be used * @param func a #GtkTranslateFunc */ function stock_set_translate_func(domain: string, func: TranslateFunc): void; /** * This function frees a target table as returned by * gtk_target_table_new_from_list() * @param targets a #GtkTargetEntry array */ function target_table_free(targets: TargetEntry[]): void; /** * This function creates an #GtkTargetEntry array that contains the * same targets as the passed %list. The returned table is newly * allocated and should be freed using gtk_target_table_free() when no * longer needed. * @param list a #GtkTargetList * @returns the new table. */ function target_table_new_from_list(list: TargetList): TargetEntry[]; /** * Determines if any of the targets in `targets` can be used to * provide a #GdkPixbuf. * @param targets an array of #GdkAtoms * @param writable whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format * @returns %TRUE if @targets include a suitable target for images, otherwise %FALSE. */ function targets_include_image(targets: Gdk.Atom[], writable: boolean): boolean; /** * Determines if any of the targets in `targets` can be used to * provide rich text. * @param targets an array of #GdkAtoms * @param buffer a #GtkTextBuffer * @returns %TRUE if @targets include a suitable target for rich text, otherwise %FALSE. */ function targets_include_rich_text(targets: Gdk.Atom[], buffer: TextBuffer): boolean; /** * Determines if any of the targets in `targets` can be used to * provide text. * @param targets an array of #GdkAtoms * @returns %TRUE if @targets include a suitable target for text, otherwise %FALSE. */ function targets_include_text(targets: Gdk.Atom[]): boolean; /** * Determines if any of the targets in `targets` can be used to * provide an uri list. * @param targets an array of #GdkAtoms * @returns %TRUE if @targets include a suitable target for uri lists, otherwise %FALSE. */ function targets_include_uri(targets: Gdk.Atom[]): boolean; /** * Create a simple window with window title `window_title` and * text contents `dialog_text`. * The window will quit any running gtk_main()-loop when destroyed, and it * will automatically be destroyed upon test function teardown. * @param window_title Title of the window to be displayed. * @param dialog_text Text inside the window to be displayed. * @returns a widget pointer to the newly created GtkWindow. */ function test_create_simple_window(window_title: string, dialog_text: string): Widget; /** * This function will search `widget` and all its descendants for a GtkLabel * widget with a text string matching `label_pattern`. * The `label_pattern` may contain asterisks '*' and question marks '?' as * placeholders, g_pattern_match() is used for the matching. * Note that locales other than "C" tend to alter (translate" label strings, * so this function is genrally only useful in test programs with * predetermined locales, see gtk_test_init() for more details. * @param widget Valid label or container widget. * @param label_pattern Shell-glob pattern to match a label string. * @returns a GtkLabel widget if any is found. */ function test_find_label(widget: Widget, label_pattern: string): Widget; /** * This function will search siblings of `base_widget` and siblings of its * ancestors for all widgets matching `widget_type`. * Of the matching widgets, the one that is geometrically closest to * `base_widget` will be returned. * The general purpose of this function is to find the most likely "action" * widget, relative to another labeling widget. Such as finding a * button or text entry widget, given it's corresponding label widget. * @param base_widget Valid widget, part of a widget hierarchy * @param widget_type Type of a aearched for sibling widget * @returns a widget of type @widget_type if any is found. */ function test_find_sibling(base_widget: Widget, widget_type: GObject.GType): Widget; /** * This function will search the descendants of `widget` for a widget * of type `widget_type` that has a label matching `label_pattern` next * to it. This is most useful for automated GUI testing, e.g. to find * the "OK" button in a dialog and synthesize clicks on it. * However see gtk_test_find_label(), gtk_test_find_sibling() and * gtk_test_widget_click() for possible caveats involving the search of * such widgets and synthesizing widget events. * @param widget Container widget, usually a GtkWindow. * @param label_pattern Shell-glob pattern to match a label string. * @param widget_type Type of a aearched for label sibling widget. * @returns a valid widget if any is found or %NULL. */ function test_find_widget(widget: Widget, label_pattern: string, widget_type: GObject.GType): Widget; /** * 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+ and Gdk object types. * This allowes to refer to any of those object types via * g_type_from_name() after calling this function. */ function test_register_all_types(): void; /** * Retrive the literal adjustment value for GtkRange based * widgets and spin buttons. Note that the value returned by * this function is anything between the lower and upper bounds * of the adjustment belonging to `widget,` and is not a percentage * as passed in to gtk_test_slider_set_perc(). * @param widget valid widget pointer. * @returns adjustment->value for an adjustment belonging to @widget. */ function test_slider_get_value(widget: Widget): number; /** * This function will adjust the slider position of all GtkRange * based widgets, such as scrollbars or scales, it'll also adjust * spin buttons. The adjustment value of these widgets is set to * a value between the lower and upper limits, according to the * `percentage` argument. * @param widget valid widget pointer. * @param percentage value between 0 and 100. */ function test_slider_set_perc(widget: Widget, percentage: number): void; /** * This function will generate a `button` click in the upwards or downwards * spin button arrow areas, usually leading to an increase or decrease of * spin button's value. * @param spinner valid GtkSpinButton widget. * @param button Number of the pointer button for the event, usually 1, 2 or 3. * @param upwards %TRUE for upwards arrow click, %FALSE for downwards arrow click. * @returns wether all actions neccessary for the button click simulation were carried out successfully. */ function test_spin_button_click(spinner: SpinButton, button: number, upwards: boolean): boolean; /** * Retrive the text string of `widget` if it is a GtkLabel, * GtkEditable (entry and text widgets) or GtkTextView. * @param widget valid widget pointer. * @returns new 0-terminated C string, needs to be released with g_free(). */ function test_text_get(widget: Widget): string; /** * Set the text string of `widget` to `string` if it is a GtkLabel, * GtkEditable (entry and text widgets) or GtkTextView. * @param widget valid widget pointer. * @param string a 0-terminated C string */ function test_text_set(widget: Widget, string: string): void; /** * This function will generate a `button` click (button press and button * release event) in the middle of the first GdkWindow found that belongs * to `widget`. * For %GTK_NO_WINDOW widgets like GtkButton, this will often be an * input-only event window. For other widgets, this is usually widget->window. * Certain caveats should be considered when using this function, in * particular because the mouse pointer is warped to the button click * location, see gdk_test_simulate_button() for details. * @param widget Widget to generate a button click on. * @param button Number of the pointer button for the event, usually 1, 2 or 3. * @param modifiers Keyboard modifiers the event is setup with. * @returns wether all actions neccessary for the button click simulation were carried out successfully. */ function test_widget_click(widget: Widget, button: number, modifiers: Gdk.ModifierType | null): boolean; /** * This function will generate keyboard press and release events in * the middle of the first GdkWindow found that belongs to `widget`. * For %GTK_NO_WINDOW widgets like GtkButton, this will often be an * input-only event window. For other widgets, this is usually widget->window. * Certain caveats should be considered when using this function, in * particular because the mouse pointer is warped to the key press * location, see gdk_test_simulate_key() for details. * @param widget Widget to generate a key press and release on. * @param keyval A Gdk keyboard value. * @param modifiers Keyboard modifiers the event is setup with. * @returns wether all actions neccessary for the key event simulation were carried out successfully. */ function test_widget_send_key(widget: Widget, keyval: number, modifiers: Gdk.ModifierType | null): boolean; function text_anchored_child_set_layout(child: Widget, layout: TextLayout): void; function timeout_remove(timeout_handler_id: number): void; /** * Obtains a `tree_model` and `path` from selection data of target type * %GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler. * This function can only be used if `selection_data` originates from the same * process that's calling this function, because a pointer to the tree model * is being passed around. If you aren't in the same process, then you'll * get memory corruption. In the #GtkTreeDragDest drag_data_received handler, * you can assume that selection data of type %GTK_TREE_MODEL_ROW is * in from the current process. The returned path must be freed with * gtk_tree_path_free(). * @param selection_data a #GtkSelectionData * @returns %TRUE if @selection_data had target type %GTK_TREE_MODEL_ROW and is otherwise valid */ function tree_get_row_drag_data(selection_data: SelectionData): [boolean, TreeModel, TreePath]; /** * 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 #GObject * @param path The path position that was deleted */ function tree_row_reference_deleted(proxy: GObject.Object, path: TreePath): void; /** * Lets a set of row reference created by gtk_tree_row_reference_new_proxy() * know that the model emitted the "row_inserted" signal. * @param proxy A #GObject * @param path The row position that was inserted */ function tree_row_reference_inserted(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 "rows_reordered" signal. * @param proxy A #GObject * @param path The parent path of the reordered signal * @param iter The iter pointing to the parent of the reordered * @param new_order The new order of rows */ function tree_row_reference_reordered( proxy: GObject.Object, path: TreePath, iter: TreeIter, new_order: number, ): void; /** * Sets selection data of target type %GTK_TREE_MODEL_ROW. Normally used * in a drag_data_get handler. * @param selection_data some #GtkSelectionData * @param tree_model a #GtkTreeModel * @param path a row in @tree_model * @returns %TRUE if the #GtkSelectionData had the proper target type to allow us to set a tree row */ function tree_set_row_drag_data(selection_data: SelectionData, tree_model: TreeModel, path: TreePath): boolean; function __true(): boolean; /** * Returns a pointer pointing to the class of `type` or %NULL if there * was any trouble identifying `type`. Initializes the class if * necessary. * @param type a #GtkType. * @returns pointer to the class. */ function type_class(type: Type): any | null; function type_init(debug_flags: GObject.TypeDebugFlags | null): void; function type_new(type: Type): any | null; function type_unique(parent_type: Type, gtkinfo: TypeInfo): Type; interface AboutDialogActivateLinkFunc { (about: AboutDialog, link_: string, data?: any | null): void; } interface AccelGroupActivate { (accel_group: AccelGroup, acceleratable: A, keyval: number, modifier: Gdk.ModifierType): boolean; } interface AccelGroupFindFunc { (key: AccelKey, closure: GObject.Closure, data?: any | null): boolean; } interface AccelMapForeach { ( data: any | null, accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType, changed: boolean, ): void; } interface AssistantPageFunc { (current_page: number, data?: any | null): number; } interface BuilderConnectFunc { ( builder: Builder, object: A, signal_name: string, handler_name: string, connect_object: B, flags: GObject.ConnectFlags, ): void; } interface CListCompareFunc { (clist: CList, ptr1?: any | null, ptr2?: any | null): number; } interface CTreeCompareDragFunc { (ctree: CTree, source_node: CTreeNode, new_parent: CTreeNode, new_sibling: CTreeNode): boolean; } interface CTreeFunc { (ctree: CTree, node: CTreeNode, data?: any | null): void; } interface CTreeGNodeFunc { (ctree: CTree, depth: number, gnode: GLib.Node, cnode: CTreeNode, data?: any | null): boolean; } interface CalendarDetailFunc { (calendar: Calendar, year: number, month: number, day: number): string; } interface Callback { (widget: Widget, data?: any | null): void; } interface CallbackMarshal { (object: Object, data: any | null, n_args: number, args: Arg): void; } interface CellLayoutDataFunc { ( cell_layout: CellLayout, cell: CellRenderer, tree_model: TreeModel, iter: TreeIter, data?: any | null, ): void; } interface ClipboardClearFunc { (clipboard: Clipboard, user_data_or_owner?: any | null): void; } interface ClipboardGetFunc { (clipboard: Clipboard, selection_data: SelectionData, info: number, user_data_or_owner?: any | null): void; } interface ClipboardImageReceivedFunc { (clipboard: Clipboard, pixbuf: GdkPixbuf.Pixbuf, data?: any | null): void; } interface ClipboardReceivedFunc { (clipboard: Clipboard, selection_data: SelectionData, data?: any | null): void; } interface ClipboardRichTextReceivedFunc { (clipboard: Clipboard, format: Gdk.Atom, text: number, length: number, data?: any | null): void; } interface ClipboardTargetsReceivedFunc { (clipboard: Clipboard, atoms: Gdk.Atom, n_atoms: number, data?: any | null): void; } interface ClipboardTextReceivedFunc { (clipboard: Clipboard, text: string, data?: any | null): void; } interface ClipboardURIReceivedFunc { (clipboard: Clipboard, uris: string, data?: any | null): void; } interface ColorSelectionChangePaletteFunc { (colors: Gdk.Color, n_colors: number): void; } interface ColorSelectionChangePaletteWithScreenFunc { (screen: Gdk.Screen, colors: Gdk.Color, n_colors: number): void; } interface DestroyNotify { (data?: any | null): void; } interface EntryCompletionMatchFunc { (completion: EntryCompletion, key: string, iter: TreeIter): boolean; } interface FileFilterFunc { (filter_info: FileFilterInfo, data?: any | null): boolean; } interface Function { (data?: any | null): boolean; } interface IconViewForeachFunc { (icon_view: IconView, path: TreePath, data?: any | null): void; } interface ItemFactoryCallback { (): void; } interface ItemFactoryCallback1 { (callback_data: any | null, callback_action: number, widget: Widget): void; } interface ItemFactoryCallback2 { (widget: Widget, callback_data: any | null, callback_action: number): void; } interface KeySnoopFunc { (grab_widget: Widget, event: Gdk.EventKey, func_data?: any | null): number; } interface LinkButtonUriFunc { (button: LinkButton, link_: string): void; } interface MenuCallback { (widget: Widget): void; } interface MenuDetachFunc { (attach_widget: Widget, menu: Menu): void; } interface MenuPositionFunc { (menu: Menu, x: number, y: number, push_in: boolean): void; } interface ModuleDisplayInitFunc { (display: Gdk.Display): void; } interface ModuleInitFunc { (argc: number, argv: string): void; } interface PageSetupDoneFunc { (page_setup: PageSetup, data?: any | null): void; } interface PrintFunc { (func_data: any | null, str: string): void; } interface PrintSettingsFunc { (key: string, value: string): void; } interface RcPropertyParser { (pspec: GObject.ParamSpec, rc_string: GLib.String, property_value: GObject.Value | any): boolean; } interface RecentFilterFunc { (filter_info: RecentFilterInfo): boolean; } interface RecentSortFunc { (a: RecentInfo, b: RecentInfo): number; } interface SignalFunc { (): void; } interface TextBufferDeserializeFunc { ( register_buffer: TextBuffer, content_buffer: TextBuffer, iter: TextIter, data: number, length: number, create_tags: boolean, ): boolean; } interface TextBufferSerializeFunc { ( register_buffer: TextBuffer, content_buffer: TextBuffer, start: TextIter, end: TextIter, length: number, ): number; } interface TextCharPredicate { (ch: number): boolean; } interface TextFunction { (editable: OldEditable, time_: number): void; } interface TextTagTableForeach { (tag: TextTag, data?: any | null): void; } interface TranslateFunc { (path: string, func_data?: any | null): string; } interface TreeCellDataFunc { ( tree_column: TreeViewColumn, cell: CellRenderer, tree_model: TreeModel, iter: TreeIter, data?: any | null, ): void; } interface TreeDestroyCountFunc { (tree_view: TreeView, path: TreePath, children: number): void; } interface TreeIterCompareFunc { (model: TreeModel, a: TreeIter, b: TreeIter): number; } interface TreeModelFilterModifyFunc { (model: TreeModel, iter: TreeIter, value: GObject.Value | any, column: number, data?: any | null): void; } interface TreeModelFilterVisibleFunc { (model: TreeModel, iter: TreeIter, data?: any | null): boolean; } interface TreeModelForeachFunc { (model: TreeModel, path: TreePath, iter: TreeIter, data?: any | null): boolean; } interface TreeSelectionForeachFunc { (model: TreeModel, path: TreePath, iter: TreeIter, data?: any | null): void; } interface TreeSelectionFunc { ( selection: TreeSelection, model: TreeModel, path: TreePath, path_currently_selected: boolean, data?: any | null, ): boolean; } interface TreeViewColumnDropFunc { ( tree_view: TreeView, column: TreeViewColumn, prev_column: TreeViewColumn, next_column: TreeViewColumn, data?: any | null, ): boolean; } interface TreeViewMappingFunc { (tree_view: TreeView, path: TreePath): void; } interface TreeViewRowSeparatorFunc { (model: TreeModel, iter: TreeIter, data?: any | null): boolean; } interface TreeViewSearchEqualFunc { (model: TreeModel, column: number, key: string, iter: TreeIter, search_data?: any | null): boolean; } interface TreeViewSearchPositionFunc { (tree_view: TreeView, search_dialog: Widget): void; } interface WindowKeysForeachFunc { ( window: Window, keyval: number, modifiers: Gdk.ModifierType, is_mnemonic: boolean, data?: any | null, ): void; } export namespace AccelFlags { export const $gtype: GObject.GType; } enum AccelFlags { VISIBLE, LOCKED, MASK, } export namespace ArgFlags { export const $gtype: GObject.GType; } enum ArgFlags { READABLE, WRITABLE, CONSTRUCT, CONSTRUCT_ONLY, CHILD_ARG, } export namespace AttachOptions { export const $gtype: GObject.GType; } enum AttachOptions { EXPAND, SHRINK, FILL, } export namespace ButtonAction { export const $gtype: GObject.GType; } enum ButtonAction { IGNORED, SELECTS, DRAGS, EXPANDS, } /** * These options can be used to influence the display and behaviour of a #GtkCalendar. */ /** * These options can be used to influence the display and behaviour of a #GtkCalendar. */ export namespace CalendarDisplayOptions { export const $gtype: GObject.GType; } enum CalendarDisplayOptions { /** * Specifies that the month and year should be displayed. */ SHOW_HEADING, /** * Specifies that three letter day descriptions should be present. */ SHOW_DAY_NAMES, /** * Prevents the user from switching months with the calendar. */ NO_MONTH_CHANGE, /** * Displays each week numbers of the current year, down the * left side of the calendar. */ SHOW_WEEK_NUMBERS, /** * Since GTK+ 2.4, this option is deprecated and ignored by GTK+. * The information on which day the calendar week starts is derived from the locale. */ WEEK_START_MONDAY, /** * Just show an indicator, not the full details * text when details are provided. See gtk_calendar_set_detail_func(). */ SHOW_DETAILS, } export namespace CellRendererState { export const $gtype: GObject.GType; } enum CellRendererState { SELECTED, PRELIT, INSENSITIVE, SORTED, FOCUSED, } export namespace DebugFlag { export const $gtype: GObject.GType; } enum DebugFlag { MISC, PLUGSOCKET, TEXT, TREE, UPDATES, KEYBINDINGS, MULTIHEAD, MODULES, GEOMETRY, ICONTHEME, PRINTING, BUILDER, } export namespace DestDefaults { export const $gtype: GObject.GType; } enum DestDefaults { MOTION, HIGHLIGHT, DROP, ALL, } export namespace DialogFlags { export const $gtype: GObject.GType; } enum DialogFlags { MODAL, DESTROY_WITH_PARENT, NO_SEPARATOR, } export namespace FileFilterFlags { export const $gtype: GObject.GType; } enum FileFilterFlags { FILENAME, URI, DISPLAY_NAME, MIME_TYPE, } /** * Used to specify options for gtk_icon_theme_lookup_icon() */ /** * Used to specify options for gtk_icon_theme_lookup_icon() */ export namespace IconLookupFlags { export const $gtype: GObject.GType; } enum IconLookupFlags { /** * Never return SVG icons, even if gdk-pixbuf * supports them. Cannot be used together with %GTK_ICON_LOOKUP_FORCE_SVG. */ NO_SVG, /** * Return SVG icons, even if gdk-pixbuf * doesn't support them. * Cannot be used together with %GTK_ICON_LOOKUP_NO_SVG. */ FORCE_SVG, /** * When passed to * gtk_icon_theme_lookup_icon() includes builtin icons * as well as files. For a builtin icon, gtk_icon_info_get_filename() * returns %NULL and you need to call gtk_icon_info_get_builtin_pixbuf(). */ USE_BUILTIN, /** * Try to shorten icon name at '-' * characters before looking at inherited themes. For more general * fallback, see gtk_icon_theme_choose_icon(). Since 2.12. */ GENERIC_FALLBACK, /** * Always return the icon scaled to the * requested size. Since 2.14. */ FORCE_SIZE, } export namespace ObjectFlags { export const $gtype: GObject.GType; } enum ObjectFlags { IN_DESTRUCTION, FLOATING, RESERVED_1, RESERVED_2, } export namespace PrivateFlags { export const $gtype: GObject.GType; } enum PrivateFlags { USER_STYLE, RESIZE_PENDING, HAS_POINTER, SHADOWED, HAS_SHAPE_MASK, IN_REPARENT, DIRECTION_SET, DIRECTION_LTR, ANCHORED, CHILD_VISIBLE, REDRAW_ON_ALLOC, ALLOC_NEEDED, REQUEST_NEEDED, } export namespace RcFlags { export const $gtype: GObject.GType; } enum RcFlags { FG, BG, TEXT, BASE, } export namespace RecentFilterFlags { export const $gtype: GObject.GType; } enum RecentFilterFlags { URI, DISPLAY_NAME, MIME_TYPE, APPLICATION, GROUP, AGE, } export namespace SignalRunType { export const $gtype: GObject.GType; } enum SignalRunType { FIRST, LAST, BOTH, NO_RECURSE, ACTION, NO_HOOKS, } export namespace TargetFlags { export const $gtype: GObject.GType; } enum TargetFlags { SAME_APP, SAME_WIDGET, OTHER_APP, OTHER_WIDGET, } export namespace TextSearchFlags { export const $gtype: GObject.GType; } enum TextSearchFlags { VISIBLE_ONLY, TEXT_ONLY, } /** * Flags used to specify the supported drag targets. */ /** * Flags used to specify the supported drag targets. */ export namespace ToolPaletteDragTargets { export const $gtype: GObject.GType; } enum ToolPaletteDragTargets { /** * Support drag of items. */ ITEMS, /** * Support drag of groups. */ GROUPS, } export namespace TreeModelFlags { export const $gtype: GObject.GType; } enum TreeModelFlags { ITERS_PERSIST, LIST_ONLY, } export namespace UIManagerItemType { export const $gtype: GObject.GType; } enum UIManagerItemType { AUTO, MENUBAR, MENU, TOOLBAR, PLACEHOLDER, POPUP, MENUITEM, TOOLITEM, SEPARATOR, ACCELERATOR, POPUP_WITH_ACCELS, } /** * Tells about certain properties of the widget. */ /** * Tells about certain properties of the widget. */ export namespace WidgetFlags { export const $gtype: GObject.GType; } enum WidgetFlags { /** * widgets without a real parent, as there are #GtkWindows and * #GtkMenus have this flag set throughout their lifetime. * Toplevel widgets always contain their own #GdkWindow. */ TOPLEVEL, /** * Indicative for a widget that does not provide its own #GdkWindow. * Visible action (e.g. drawing) is performed on the parent's #GdkWindow. */ NO_WINDOW, /** * Set by gtk_widget_realize(), unset by gtk_widget_unrealize(). * A realized widget has an associated #GdkWindow. */ REALIZED, /** * Set by gtk_widget_map(), unset by gtk_widget_unmap(). * Only realized widgets can be mapped. It means that gdk_window_show() * has been called on the widgets window(s). */ MAPPED, /** * Set by gtk_widget_show(), unset by gtk_widget_hide(). Implies that a * widget will be mapped as soon as its parent is mapped. */ VISIBLE, /** * Set and unset by gtk_widget_set_sensitive(). * The sensitivity of a widget determines whether it will receive * certain events (e.g. button or key presses). One premise for * the widget's sensitivity is to have this flag set. */ SENSITIVE, /** * Set and unset by gtk_widget_set_sensitive() operations on the * parents of the widget. * This is the second premise for the widget's sensitivity. Once * it has %GTK_SENSITIVE and %GTK_PARENT_SENSITIVE set, its state is * effectively sensitive. This is expressed (and can be examined) by * the #GTK_WIDGET_IS_SENSITIVE macro. */ PARENT_SENSITIVE, /** * Determines whether a widget is able to handle focus grabs. */ CAN_FOCUS, /** * Set by gtk_widget_grab_focus() for widgets that also * have %GTK_CAN_FOCUS set. The flag will be unset once another widget * grabs the focus. */ HAS_FOCUS, /** * The widget is allowed to receive the default action via * gtk_widget_grab_default() and will reserve space to draw the default if possible */ CAN_DEFAULT, /** * The widget currently is receiving the default action and * should be drawn appropriately if possible */ HAS_DEFAULT, /** * Set by gtk_grab_add(), unset by gtk_grab_remove(). It means that the * widget is in the grab_widgets stack, and will be the preferred one for * receiving events other than ones of cosmetic value. */ HAS_GRAB, /** * Indicates that the widget's style has been looked up through the rc * mechanism. It does not imply that the widget actually had a style * defined through the rc mechanism. */ RC_STYLE, /** * Indicates that the widget is a composite child of its parent; see * gtk_widget_push_composite_child(), gtk_widget_pop_composite_child(). */ COMPOSITE_CHILD, /** * Unused since before GTK+ 1.2, will be removed in a future version. */ NO_REPARENT, /** * Set and unset by gtk_widget_set_app_paintable(). * Must be set on widgets whose window the application directly draws on, * in order to keep GTK+ from overwriting the drawn stuff. See * for a detailed * description of this flag. */ APP_PAINTABLE, /** * The widget when focused will receive the default action and have * %GTK_HAS_DEFAULT set even if there is a different widget set as default. */ RECEIVES_DEFAULT, /** * Set and unset by gtk_widget_set_double_buffered(). * Indicates that exposes done on the widget should be * double-buffered. See for a * detailed discussion of how double-buffering works in GTK+ and * why you may want to disable it for special cases. */ DOUBLE_BUFFERED, NO_SHOW_ALL, } namespace AboutDialog { // Signal callback interfaces interface ActivateLink { (uri: string): boolean; } // Constructor properties interface interface ConstructorProps extends Dialog.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { artists: string[]; authors: string[]; comments: string; copyright: string; documenters: string[]; license: string; logo: GdkPixbuf.Pixbuf; logo_icon_name: string; logoIconName: string; program_name: string; programName: string; translator_credits: string; translatorCredits: string; version: string; website: string; website_label: string; websiteLabel: string; wrap_license: boolean; wrapLicense: boolean; } } /** * The #GtkAboutDialog offers a simple way to display information about * a program like its logo, name, copyright, website and license. It is * also possible to give credits to the authors, documenters, translators * and artists who have worked on the program. An about dialog is typically * opened when the user selects the About option from * the Help menu. All parts of the dialog are optional. * * About dialog often contain links and email addresses. #GtkAboutDialog * supports this by offering global hooks, which are called when the user * clicks on a link or email address, see gtk_about_dialog_set_email_hook() * and gtk_about_dialog_set_url_hook(). Email addresses in the * authors, documenters and artists properties are recognized by looking for * <user`<`!-- -->host>, URLs are * recognized by looking for http://url, with * url extending to the next space, tab or line break. * * * Since 2.18 #GtkAboutDialog provides default website and email hooks that * use gtk_show_uri(). * * * If you want provide your own hooks overriding the default ones, it is * important to do so before setting the website and email URL properties, * like this: * * gtk_about_dialog_set_url_hook (GTK_ABOUT_DIALOG (dialog), launch_url, NULL, NULL); * gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), app_url); * * To disable the default hooks, you can pass %NULL as the hook func. Then, * the #GtkAboutDialog widget will not display the website or the * email addresses as clickable. * * To make constructing a #GtkAboutDialog as convenient as possible, you can * use the function gtk_show_about_dialog() which constructs and shows a dialog * and keeps it around so that it can be shown again. * * Note that GTK+ sets a default title of _("About %s") * on the dialog window (where %s is replaced by the name of the * application, but in order to ensure proper translation of the title, * applications should set the title property explicitly when constructing * a #GtkAboutDialog, as shown in the following example: * * gtk_show_about_dialog (NULL, * "program-name", "ExampleCode", * "logo", example_logo, * "title" _("About ExampleCode"), * NULL); * * Note that prior to GTK+ 2.12, the #GtkAboutDialog:program-name property * was called "name". This was changed to avoid the conflict with the * #GtkWidget:name property. */ class AboutDialog extends Dialog implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties /** * The people who contributed artwork to the program, as a %NULL-terminated * array of strings. Each string may contain email addresses and URLs, which * will be displayed as links, see the introduction for more details. */ get artists(): string[]; set artists(val: string[]); /** * The authors of the program, as a %NULL-terminated array of strings. * Each string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. */ 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. */ get comments(): string; set comments(val: string); /** * Copyright information for the program. */ get copyright(): string; set copyright(val: string); /** * The people documenting the program, as a %NULL-terminated array of strings. * Each string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. */ get documenters(): string[]; set documenters(val: string[]); /** * The license of the program. This string is displayed in a * text view in a secondary dialog, therefore it is fine to use * a long multi-paragraph text. Note that the text is only wrapped * in the text view if the "wrap-license" property is set to %TRUE; * otherwise the text itself must contain the intended linebreaks. */ get license(): string; set license(val: string); /** * A logo for the about box. If this is not set, it defaults to * gtk_window_get_default_icon_list(). */ get logo(): GdkPixbuf.Pixbuf; set logo(val: GdkPixbuf.Pixbuf); /** * A named icon to use as the logo for the about box. This property * overrides the #GtkAboutDialog:logo property. */ get logo_icon_name(): string; set logo_icon_name(val: string); /** * A named icon to use as the logo for the about box. This property * overrides the #GtkAboutDialog:logo property. */ get logoIconName(): string; set logoIconName(val: string); /** * The name of the program. * If this is not set, it defaults to g_get_application_name(). */ get program_name(): string; set program_name(val: string); /** * The name of the program. * If this is not set, it defaults to g_get_application_name(). */ get programName(): string; set programName(val: string); /** * Credits to the translators. This string should be marked as translatable. * The string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. */ get translator_credits(): string; set translator_credits(val: string); /** * Credits to the translators. This string should be marked as translatable. * The string may contain email addresses and URLs, which will be displayed * as links, see the introduction for more details. */ get translatorCredits(): string; set translatorCredits(val: string); /** * The version of the program. */ get version(): string; set version(val: string); /** * The URL for the link to the website of the program. * This should be a string starting with "http://. */ get website(): string; set website(val: string); /** * The label for the link to the website of the program. If this is not set, * it defaults to the URL specified in the #GtkAboutDialog:website property. */ get website_label(): string; set website_label(val: string); /** * The label for the link to the website of the program. If this is not set, * it defaults to the URL specified in the #GtkAboutDialog:website property. */ get websiteLabel(): string; set websiteLabel(val: string); /** * Whether to wrap the text in the license dialog. */ get wrap_license(): boolean; set wrap_license(val: boolean); /** * Whether to wrap the text in the license dialog. */ get wrapLicense(): boolean; set wrapLicense(val: boolean); // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](): AboutDialog; // Signals connect(id: string, callback: (...args: any[]) => any): number; connect_after(id: string, callback: (...args: any[]) => any): number; emit(id: string, ...args: any[]): void; connect(signal: 'activate-link', callback: (_source: this, uri: string) => boolean): number; connect_after(signal: 'activate-link', callback: (_source: this, uri: string) => boolean): number; emit(signal: 'activate-link', uri: string): void; // Virtual methods vfunc_activate_link(uri: string): boolean; // Methods /** * Returns the string which are displayed in the artists tab * of the secondary credits dialog. * @returns A %NULL-terminated string array containing the artists. The array is owned by the about dialog and must not be modified. */ get_artists(): string[]; /** * Returns the string which are displayed in the authors tab * of the secondary credits dialog. * @returns A %NULL-terminated string array containing the authors. The array is owned by the about dialog and must not be modified. */ get_authors(): string[]; /** * Returns the comments string. * @returns The comments. The string is owned by the about dialog and must not be modified. */ get_comments(): string; /** * Returns the copyright string. * @returns The copyright string. The string is owned by the about dialog and must not be modified. */ get_copyright(): string; /** * Returns the string which are displayed in the documenters * tab of the secondary credits dialog. * @returns A %NULL-terminated string array containing the documenters. The array is owned by the about dialog and must not be modified. */ get_documenters(): string[]; /** * Returns the license information. * @returns The license information. The string is owned by the about dialog and must not be modified. */ get_license(): string; /** * Returns the pixbuf displayed as logo in the about dialog. * @returns the pixbuf displayed as logo. The pixbuf is owned by the about dialog. If you want to keep a reference to it, you have to call g_object_ref() on it. */ get_logo(): GdkPixbuf.Pixbuf; /** * Returns the icon name displayed as logo in the about dialog. * @returns the icon name displayed as logo. The string is owned by the dialog. If you want to keep a reference to it, you have to call g_strdup() on it. */ get_logo_icon_name(): string; /** * Returns the program name displayed in the about dialog. * @returns The program name. The string is owned by the about dialog and must not be modified. */ get_name(): string; /** * Returns the program name displayed in the about dialog. * @returns The program name. The string is owned by the about dialog and must not be modified. */ get_program_name(): string; /** * Returns the translator credits string which is displayed * in the translators tab of the secondary credits dialog. * @returns The translator credits string. The string is owned by the about dialog and must not be modified. */ get_translator_credits(): string; /** * Returns the version string. * @returns The version string. The string is owned by the about dialog and must not be modified. */ get_version(): string; /** * Returns the website URL. * @returns The website URL. The string is owned by the about dialog and must not be modified. */ get_website(): string; /** * Returns the label used for the website link. * @returns The label used for the website link. The string is owned by the about dialog and must not be modified. */ get_website_label(): string; /** * Returns whether the license text in `about` is * automatically wrapped. * @returns %TRUE if the license text is wrapped */ get_wrap_license(): boolean; /** * Sets the strings which are displayed in the artists tab * of the secondary credits dialog. * @param artists a %NULL-terminated array of strings */ set_artists(artists: string): void; /** * Sets the strings which are displayed in the authors tab * of the secondary credits dialog. * @param authors a %NULL-terminated array of strings */ set_authors(authors: string): void; /** * Sets the comments string to display in the about dialog. * This should be a short string of one or two lines. * @param comments a comments string */ set_comments(comments?: string | null): void; /** * Sets the copyright string to display in the about dialog. * This should be a short string of one or two lines. * @param copyright the copyright string */ set_copyright(copyright?: string | null): void; /** * Sets the strings which are displayed in the documenters tab * of the secondary credits dialog. * @param documenters a %NULL-terminated array of strings */ set_documenters(documenters: string): void; /** * Sets the license information to be displayed in the secondary * license dialog. If `license` is %NULL, the license button is * hidden. * @param license the license information or %NULL */ set_license(license?: string | null): void; /** * Sets the pixbuf to be displayed as logo in the about dialog. * If it is %NULL, the default window icon set with * gtk_window_set_default_icon() will be used. * @param logo a #GdkPixbuf, or %NULL */ set_logo(logo?: GdkPixbuf.Pixbuf | null): void; /** * Sets the pixbuf to be displayed as logo in the about dialog. * If it is %NULL, the default window icon set with * gtk_window_set_default_icon() will be used. * @param icon_name an icon name, or %NULL */ set_logo_icon_name(icon_name?: string | null): void; /** * Sets the name to display in the about dialog. * If this is not set, it defaults to g_get_application_name(). * @param name the program name */ set_name(name?: string | null): void; // Conflicted with Gtk.Widget.set_name set_name(...args: never[]): any; /** * Sets the name to display in the about dialog. * If this is not set, it defaults to g_get_application_name(). * @param name the program name */ set_program_name(name: string): void; /** * Sets the translator credits string which is displayed in * the translators tab of the secondary credits dialog. * * The intended use for this string is to display the translator * of the language which is currently used in the user interface. * Using gettext(), a simple way to achieve that is to mark the * string for translation: * * ``` * gtk_about_dialog_set_translator_credits (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 #GtkAboutDialog will detect if "translator-credits" is untranslated * and hide the tab. * @param translator_credits the translator credits */ set_translator_credits(translator_credits?: string | null): void; /** * Sets the version string to display in the about dialog. * @param version the version string */ set_version(version?: string | null): void; /** * Sets the URL to use for the website link. * * Note that that the hook functions need to be set up * before calling this function. * @param website a URL string starting with "http://" */ set_website(website?: string | null): void; /** * Sets the label to be used for the website link. * It defaults to the website URL. * @param website_label the label used for the website link */ set_website_label(website_label: string): void; /** * Sets whether the license text in `about` is * automatically wrapped. * @param wrap_license whether to wrap the license */ set_wrap_license(wrap_license: boolean): void; // Inherited methods /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. * @param properties Object containing the properties to set */ set(properties: { [key: string]: any }): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace AccelGroup { // Signal callback interfaces interface AccelActivate { (acceleratable: GObject.Object, keyval: number, modifier: Gdk.ModifierType): boolean; } interface AccelChanged { (keyval: number, modifier: Gdk.ModifierType, accel_closure: GObject.Closure): void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { is_locked: boolean; isLocked: boolean; modifier_mask: Gdk.ModifierType; modifierMask: Gdk.ModifierType; } } /** * A #GtkAccelGroup represents a group of keyboard accelerators, * typically attached to a toplevel #GtkWindow (with * gtk_window_add_accel_group()). Usually you won't need to create a * #GtkAccelGroup directly; instead, when using #GtkItemFactory, GTK+ * automatically sets up the accelerators for your menus in the item * factory's #GtkAccelGroup. * * * Note that accelerators are different from * mnemonics. Accelerators are shortcuts for * activating a menu item; they appear alongside the menu item they're a * shortcut for. For example "Ctrl+Q" might appear alongside the "Quit" * menu item. Mnemonics are shortcuts for GUI elements such as text * entries or buttons; they appear as underlined characters. See * gtk_label_new_with_mnemonic(). Menu items can have both accelerators * and mnemonics, of course. */ class AccelGroup extends GObject.Object { static $gtype: GObject.GType; // Properties get is_locked(): boolean; get isLocked(): boolean; get modifier_mask(): Gdk.ModifierType; get modifierMask(): Gdk.ModifierType; // Fields lock_count: number; acceleratables: any[]; n_accels: number; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](): AccelGroup; // Signals connect_after(id: string, callback: (...args: any[]) => any): number; emit(id: string, ...args: any[]): void; connect_after( signal: 'accel-activate', callback: ( _source: this, acceleratable: GObject.Object, keyval: number, modifier: Gdk.ModifierType, ) => boolean, ): number; emit( signal: 'accel-activate', acceleratable: GObject.Object, keyval: number, modifier: Gdk.ModifierType, ): void; connect_after( signal: 'accel-changed', callback: ( _source: this, keyval: number, modifier: Gdk.ModifierType, accel_closure: GObject.Closure, ) => void, ): number; emit( signal: 'accel-changed', keyval: number, modifier: Gdk.ModifierType, accel_closure: GObject.Closure, ): void; // Static methods /** * Finds the #GtkAccelGroup to which `closure` is connected; * see gtk_accel_group_connect(). * @param closure a #GClosure */ static from_accel_closure(closure: GObject.Closure): AccelGroup; // Virtual methods vfunc_accel_changed(keyval: number, modifier: Gdk.ModifierType, accel_closure: GObject.Closure): void; // Methods /** * Finds the first accelerator in `accel_group` * that matches `accel_key` and `accel_mods,` and * activates it. * @param accel_quark the quark for the accelerator name * @param acceleratable the #GObject, usually a #GtkWindow, on which to activate the accelerator. * @param accel_key accelerator keyval from a key event * @param accel_mods keyboard state mask from a key event * @returns %TRUE if an accelerator was activated and handled this keypress */ activate( accel_quark: GLib.Quark, acceleratable: GObject.Object, accel_key: number, accel_mods: Gdk.ModifierType | null, ): boolean; /** * Installs an accelerator in this group. When `accel_group` is being activated * in response to a call to gtk_accel_groups_activate(), `closure` will be * invoked if the `accel_key` and `accel_mods` from gtk_accel_groups_activate() * match those of this connection. * * The signature used for the `closure` is that of #GtkAccelGroupActivate. * * Note that, due to implementation details, a single closure can only be * connected to one accelerator group. * @param accel_key key value of the accelerator * @param accel_mods modifier combination of the accelerator * @param accel_flags a flag mask to configure this accelerator * @param closure closure to be executed upon accelerator activation */ connect( accel_key: number, accel_mods: Gdk.ModifierType | null, accel_flags: AccelFlags | null, closure: GObject.Closure, ): void; connect(...args: never[]): any; /** * Installs an accelerator in this group, using an accelerator path to look * up the appropriate key and modifiers (see gtk_accel_map_add_entry()). * When `accel_group` is being activated in response to a call to * gtk_accel_groups_activate(), `closure` will be invoked if the `accel_key` and * `accel_mods` from gtk_accel_groups_activate() match the key and modifiers * for the path. * * The signature used for the `closure` is that of #GtkAccelGroupActivate. * * Note that `accel_path` string will be stored in a #GQuark. Therefore, if you * pass a static string, you can save some memory by interning it first with * g_intern_static_string(). * @param accel_path path used for determining key and modifiers. * @param closure closure to be executed upon accelerator activation */ connect_by_path(accel_path: string, closure: GObject.Closure): void; /** * Removes an accelerator previously installed through * gtk_accel_group_connect(). * * Since 2.20 `closure` can be %NULL. * @param closure the closure to remove from this accelerator group, or %NULL to remove all closures * @returns %TRUE if the closure was found and got disconnected */ disconnect(closure?: GObject.Closure | null): boolean; // Conflicted with GObject.Object.disconnect disconnect(...args: never[]): any; /** * Removes an accelerator previously installed through * gtk_accel_group_connect(). * @param accel_key key value of the accelerator * @param accel_mods modifier combination of the accelerator * @returns %TRUE if there was an accelerator which could be removed, %FALSE otherwise */ disconnect_key(accel_key: number, accel_mods: Gdk.ModifierType | null): boolean; /** * Locks are added and removed using gtk_accel_group_lock() and * gtk_accel_group_unlock(). * @returns %TRUE if there are 1 or more locks on the @accel_group, %FALSE otherwise. */ get_is_locked(): boolean; /** * Gets a #GdkModifierType representing the mask for this * `accel_group`. For example, #GDK_CONTROL_MASK, #GDK_SHIFT_MASK, etc. * @returns the modifier mask for this accel group. */ get_modifier_mask(): Gdk.ModifierType; /** * Locks the given accelerator group. * * Locking an acelerator group prevents the accelerators contained * within it to be changed during runtime. Refer to * gtk_accel_map_change_entry() about runtime accelerator changes. * * If called more than once, `accel_group` remains locked until * gtk_accel_group_unlock() has been called an equivalent number * of times. */ lock(): void; /** * Undoes the last call to gtk_accel_group_lock() on this `accel_group`. */ unlock(): void; } namespace AccelLabel { // Constructor properties interface interface ConstructorProps extends Label.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { accel_closure: GObject.Closure; accelClosure: GObject.Closure; accel_widget: Widget; accelWidget: Widget; } } /** * The #GtkAccelLabel widget is a subclass of #GtkLabel that also displays an * accelerator key on the right of the label text, e.g. 'Ctl+S'. * It is commonly used in menus to show the keyboard short-cuts for commands. * * The accelerator key to display is not set explicitly. * Instead, the #GtkAccelLabel displays the accelerators which have been added to * a particular widget. This widget is set by calling * gtk_accel_label_set_accel_widget(). * * For example, a #GtkMenuItem widget may have an accelerator added to emit the * "activate" signal when the 'Ctl+S' key combination is pressed. * A #GtkAccelLabel is created and added to the #GtkMenuItem, and * gtk_accel_label_set_accel_widget() is called with the #GtkMenuItem as the * second argument. The #GtkAccelLabel will now display 'Ctl+S' after its label. * * Note that creating a #GtkMenuItem with gtk_menu_item_new_with_label() (or * one of the similar functions for #GtkCheckMenuItem and #GtkRadioMenuItem) * automatically adds a #GtkAccelLabel to the #GtkMenuItem and calls * gtk_accel_label_set_accel_widget() to set it up for you. * * A #GtkAccelLabel will only display accelerators which have %GTK_ACCEL_VISIBLE * set (see #GtkAccelFlags). * A #GtkAccelLabel can display multiple accelerators and even signal names, * though it is almost always used to display just one accelerator key. * * Creating a simple menu item with an accelerator key. * * GtkWidget *save_item; * GtkAccelGroup *accel_group; * * /* Create a GtkAccelGroup and add it to the window. */ * accel_group = gtk_accel_group_new (); * gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); * * /* Create the menu item using the convenience function. */ * save_item = gtk_menu_item_new_with_label ("Save"); * gtk_widget_show (save_item); * gtk_container_add (GTK_CONTAINER (menu), save_item); * * /* Now add the accelerator to the GtkMenuItem. Note that since we called * gtk_menu_item_new_with_label() to create the GtkMenuItem the * GtkAccelLabel is automatically set up to display the GtkMenuItem * accelerators. We just need to make sure we use GTK_ACCEL_VISIBLE here. */ * gtk_widget_add_accelerator (save_item, "activate", accel_group, * GDK_s, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); * * */ class AccelLabel extends Label implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties get accel_closure(): GObject.Closure; set accel_closure(val: GObject.Closure); get accelClosure(): GObject.Closure; set accelClosure(val: GObject.Closure); get accel_widget(): Widget; set accel_widget(val: Widget); get accelWidget(): Widget; set accelWidget(val: Widget); // Fields // @ts-expect-error This property conflicts with an accessor in a parent class or interface. label: Label; gtk_reserved: number; accel_padding: number; accel_group: AccelGroup; accel_string: string; accel_string_width: number; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](string: string): AccelLabel; // Methods /** * Fetches the widget monitored by this accelerator label. See * gtk_accel_label_set_accel_widget(). * @returns the object monitored by the accelerator label, or %NULL. */ get_accel_widget(): Widget; /** * Returns the width needed to display the accelerator key(s). * This is used by menus to align all of the #GtkMenuItem widgets, and shouldn't * be needed by applications. * @returns the width needed to display the accelerator key(s). */ get_accel_width(): number; /** * Recreates the string representing the accelerator keys. * This should not be needed since the string is automatically updated whenever * accelerators are added or removed from the associated widget. * @returns always returns %FALSE. */ refetch(): boolean; /** * Sets the closure to be monitored by this accelerator label. The closure * must be connected to an accelerator group; see gtk_accel_group_connect(). * @param accel_closure the closure to monitor for accelerator changes. */ set_accel_closure(accel_closure: GObject.Closure): void; /** * Sets the widget to be monitored by this accelerator label. * @param accel_widget the widget to be monitored. */ set_accel_widget(accel_widget: Widget): void; // Inherited methods /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. * @param properties Object containing the properties to set */ set(properties: { [key: string]: any }): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace AccelMap { // Signal callback interfaces interface Changed { (accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType): void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } class AccelMap extends GObject.Object { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Signals connect(id: string, callback: (...args: any[]) => any): number; connect_after(id: string, callback: (...args: any[]) => any): number; emit(id: string, ...args: any[]): void; connect( signal: 'changed', callback: (_source: this, accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType) => void, ): number; connect_after( signal: 'changed', callback: (_source: this, accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType) => void, ): number; emit(signal: 'changed', accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType): void; // Static methods /** * Registers a new accelerator with the global accelerator map. * This function should only be called once per `accel_path` * with the canonical `accel_key` and `accel_mods` for this path. * To change the accelerator during runtime programatically, use * gtk_accel_map_change_entry(). * The accelerator path must consist of "<WINDOWTYPE>/Category1/Category2/.../Action", * where <WINDOWTYPE> should be a unique application-specific identifier, that * corresponds to the kind of window the accelerator is being used in, e.g. "Gimp-Image", * "Abiword-Document" or "Gnumeric-Settings". * The Category1/.../Action portion is most appropriately chosen by the action the * accelerator triggers, i.e. for accelerators on menu items, choose the item's menu path, * e.g. "File/Save As", "Image/View/Zoom" or "Edit/Select All". * So a full valid accelerator path may look like: * "<Gimp-Toolbox>/File/Dialogs/Tool Options...". * * Note that `accel_path` string will be stored in a #GQuark. Therefore, if you * pass a static string, you can save some memory by interning it first with * g_intern_static_string(). * @param accel_path valid accelerator path * @param accel_key the accelerator key * @param accel_mods the accelerator modifiers */ static add_entry(accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType): void; /** * Adds a filter to the global list of accel path filters. * * Accel map entries whose accel path matches one of the filters * are skipped by gtk_accel_map_foreach(). * * This function is intended for GTK+ modules that create their own * menus, but don't want them to be saved into the applications accelerator * map dump. * @param filter_pattern a pattern (see #GPatternSpec) */ static add_filter(filter_pattern: string): void; /** * Changes the `accel_key` and `accel_mods` currently associated with `accel_path`. * Due to conflicts with other accelerators, a change may not always be possible, * `replace` indicates whether other accelerators may be deleted to resolve such * conflicts. A change will only occur if all conflicts could be resolved (which * might not be the case if conflicting accelerators are locked). Successful * changes are indicated by a %TRUE return value. * * Note that `accel_path` string will be stored in a #GQuark. Therefore, if you * pass a static string, you can save some memory by interning it first with * g_intern_static_string(). * @param accel_path a valid accelerator path * @param accel_key the new accelerator key * @param accel_mods the new accelerator modifiers * @param replace %TRUE if other accelerators may be deleted upon conflicts */ static change_entry( accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType, replace: boolean, ): boolean; /** * Parses a file previously saved with gtk_accel_map_save() for * accelerator specifications, and propagates them accordingly. * @param file_name a file containing accelerator specifications, in the GLib file name encoding */ static load(file_name: string): void; /** * Filedescriptor variant of gtk_accel_map_load(). * * Note that the file descriptor will not be closed by this function. * @param fd a valid readable file descriptor */ static load_fd(fd: number): void; /** * #GScanner variant of gtk_accel_map_load(). * @param scanner a #GScanner which has already been provided with an input file */ static load_scanner(scanner: GLib.Scanner): void; /** * Locks the given accelerator path. If the accelerator map doesn't yet contain * an entry for `accel_path,` a new one is created. * * Locking an accelerator path prevents its accelerator from being changed * during runtime. A locked accelerator path can be unlocked by * gtk_accel_map_unlock_path(). Refer to gtk_accel_map_change_entry() * for information about runtime accelerator changes. * * If called more than once, `accel_path` remains locked until * gtk_accel_map_unlock_path() has been called an equivalent number * of times. * * Note that locking of individual accelerator paths is independent from * locking the #GtkAccelGroup containing them. For runtime accelerator * changes to be possible both the accelerator path and its #GtkAccelGroup * have to be unlocked. * @param accel_path a valid accelerator path */ static lock_path(accel_path: string): void; /** * Looks up the accelerator entry for `accel_path` and fills in `key`. * @param accel_path a valid accelerator path * @param key the accelerator key to be filled in (optional) */ static lookup_entry(accel_path: string, key: AccelKey): boolean; /** * Saves current accelerator specifications (accelerator path, key * and modifiers) to `file_name`. * The file is written in a format suitable to be read back in by * gtk_accel_map_load(). * @param file_name the name of the file to contain accelerator specifications, in the GLib file name encoding */ static save(file_name: string): void; /** * Filedescriptor variant of gtk_accel_map_save(). * * Note that the file descriptor will not be closed by this function. * @param fd a valid writable file descriptor */ static save_fd(fd: number): void; /** * Undoes the last call to gtk_accel_map_lock_path() on this `accel_path`. * Refer to gtk_accel_map_lock_path() for information about accelerator path locking. * @param accel_path a valid accelerator path */ static unlock_path(accel_path: string): void; } namespace Accessible { // Constructor properties interface interface ConstructorProps extends Atk.Object.ConstructorProps {} } class Accessible extends Atk.Object { static $gtype: GObject.GType; // Fields widget: Widget; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Virtual methods /** * This function specifies the callback function to be called when the widget * corresponding to a GtkAccessible is destroyed. */ vfunc_connect_widget_destroyed(): void; // Methods /** * This function specifies the callback function to be called when the widget * corresponding to a GtkAccessible is destroyed. */ connect_widget_destroyed(): void; /** * Gets the #GtkWidget corresponding to the #GtkAccessible. The returned widget * does not have a reference added, so you do not need to unref it. * @returns pointer to the #GtkWidget corresponding to the #GtkAccessible, or %NULL. */ get_widget(): Widget; /** * Sets the #GtkWidget corresponding to the #GtkAccessible. * @param widget a #GtkWidget */ set_widget(widget: Widget): void; } namespace Action { // Signal callback interfaces interface Activate { (): void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps { action_group: ActionGroup; actionGroup: ActionGroup; always_show_image: boolean; alwaysShowImage: boolean; gicon: Gio.Icon; hide_if_empty: boolean; hideIfEmpty: boolean; icon_name: string; iconName: string; is_important: boolean; isImportant: boolean; label: string; name: string; sensitive: boolean; short_label: string; shortLabel: string; stock_id: string; stockId: string; tooltip: string; visible: boolean; visible_horizontal: boolean; visibleHorizontal: boolean; visible_overflown: boolean; visibleOverflown: boolean; visible_vertical: boolean; visibleVertical: boolean; } } /** * Actions represent operations that the user can be perform, along with * some information how it should be presented in the interface. Each action * provides methods to create icons, menu items and toolbar items * representing itself. * * As well as the callback that is called when the action gets activated, * the following also gets associated with the action: * * a name (not translated, for path lookup) * a label (translated, for display) * an accelerator * whether label indicates a stock id * a tooltip (optional, translated) * a toolbar label (optional, shorter than label) * * The action will also have some state information: * * visible (shown/hidden) * sensitive (enabled/disabled) * * Apart from regular actions, there are toggle * actions, which can be toggled between two states and radio actions, of which only one in a group * can be in the "active" state. Other actions can be implemented as #GtkAction * subclasses. * * Each action can have one or more proxy menu item, toolbar button or * other proxy widgets. Proxies mirror the state of the action (text * label, tooltip, icon, visible, sensitive, etc), and should change when * the action's state changes. When the proxy is activated, it should * activate its action. */ class Action extends GObject.Object implements Buildable { static $gtype: GObject.GType; // Properties get action_group(): ActionGroup; set action_group(val: ActionGroup); get actionGroup(): ActionGroup; set actionGroup(val: ActionGroup); /** * If %TRUE, the action's menu item proxies will ignore the #GtkSettings:gtk-menu-images * setting and always show their image, if available. * * Use this property if the menu item would be useless or hard to use * without their image. */ get always_show_image(): boolean; set always_show_image(val: boolean); /** * If %TRUE, the action's menu item proxies will ignore the #GtkSettings:gtk-menu-images * setting and always show their image, if available. * * Use this property if the menu item would be useless or hard to use * without their image. */ get alwaysShowImage(): boolean; set alwaysShowImage(val: boolean); /** * The #GIcon displayed in the #GtkAction. * * Note that the stock icon is preferred, if the #GtkAction:stock-id * property holds the id of an existing stock icon. * * This is an appearance property and thus only applies if * #GtkActivatable:use-action-appearance is %TRUE. */ get gicon(): Gio.Icon; set gicon(val: Gio.Icon); get hide_if_empty(): boolean; set hide_if_empty(val: boolean); get hideIfEmpty(): boolean; set hideIfEmpty(val: boolean); /** * The name of the icon from the icon theme. * * Note that the stock icon is preferred, if the #GtkAction:stock-id * property holds the id of an existing stock icon, and the #GIcon is * preferred if the #GtkAction:gicon property is set. * * This is an appearance property and thus only applies if * #GtkActivatable:use-action-appearance is %TRUE. */ get icon_name(): string; set icon_name(val: string); /** * The name of the icon from the icon theme. * * Note that the stock icon is preferred, if the #GtkAction:stock-id * property holds the id of an existing stock icon, and the #GIcon is * preferred if the #GtkAction:gicon property is set. * * This is an appearance property and thus only applies if * #GtkActivatable:use-action-appearance is %TRUE. */ get iconName(): string; set iconName(val: string); get is_important(): boolean; set is_important(val: boolean); get isImportant(): boolean; set isImportant(val: boolean); /** * The label used for menu items and buttons that activate * this action. If the label is %NULL, GTK+ uses the stock * label specified via the stock-id property. * * This is an appearance property and thus only applies if * #GtkActivatable:use-action-appearance is %TRUE. */ get label(): string; set label(val: string); get name(): string; get sensitive(): boolean; set sensitive(val: boolean); /** * A shorter label that may be used on toolbar buttons. * * This is an appearance property and thus only applies if * #GtkActivatable:use-action-appearance is %TRUE. */ get short_label(): string; set short_label(val: string); /** * A shorter label that may be used on toolbar buttons. * * This is an appearance property and thus only applies if * #GtkActivatable:use-action-appearance is %TRUE. */ get shortLabel(): string; set shortLabel(val: string); /** * The stock icon displayed in widgets representing this action. * * This is an appearance property and thus only applies if * #GtkActivatable:use-action-appearance is %TRUE. */ get stock_id(): string; set stock_id(val: string); /** * The stock icon displayed in widgets representing this action. * * This is an appearance property and thus only applies if * #GtkActivatable:use-action-appearance is %TRUE. */ get stockId(): string; set stockId(val: string); get tooltip(): string; set tooltip(val: string); get visible(): boolean; set visible(val: boolean); get visible_horizontal(): boolean; set visible_horizontal(val: boolean); get visibleHorizontal(): boolean; set visibleHorizontal(val: boolean); /** * When %TRUE, toolitem proxies for this action are represented in the * toolbar overflow menu. */ get visible_overflown(): boolean; set visible_overflown(val: boolean); /** * When %TRUE, toolitem proxies for this action are represented in the * toolbar overflow menu. */ get visibleOverflown(): boolean; set visibleOverflown(val: boolean); get visible_vertical(): boolean; set visible_vertical(val: boolean); get visibleVertical(): boolean; set visibleVertical(val: boolean); // Fields object: GObject.Object; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](name: string, label: string | null, tooltip: string | null, stock_id: string): Action; // Signals connect(id: string, callback: (...args: any[]) => any): number; connect_after(id: string, callback: (...args: any[]) => any): number; emit(id: string, ...args: any[]): void; connect(signal: 'activate', callback: (_source: this) => void): number; connect_after(signal: 'activate', callback: (_source: this) => void): number; emit(signal: 'activate'): void; // Virtual methods /** * Emits the "activate" signal on the specified action, if it isn't * insensitive. This gets called by the proxy widgets when they get * activated. * * It can also be used to manually activate an action. */ vfunc_activate(): void; /** * Connects a widget to an action object as a proxy. Synchronises * various properties of the action with the widget (such as label * text, icon, tooltip, etc), and attaches a callback so that the * action gets activated when the proxy widget does. * * If the widget is already connected to an action, it is disconnected * first. * @param proxy the proxy widget */ vfunc_connect_proxy(proxy: Widget): void; /** * If `action` provides a #GtkMenu widget as a submenu for the menu * item or the toolbar item it creates, this function returns an * instance of that menu. */ vfunc_create_menu(): Widget; /** * Creates a menu item widget that proxies for the given action. */ vfunc_create_menu_item(): Widget; /** * Creates a toolbar item widget that proxies for the given action. */ vfunc_create_tool_item(): Widget; /** * Disconnects a proxy widget from an action. * Does not destroy the widget, however. * @param proxy the proxy widget */ vfunc_disconnect_proxy(proxy: Widget): void; // Methods /** * Emits the "activate" signal on the specified action, if it isn't * insensitive. This gets called by the proxy widgets when they get * activated. * * It can also be used to manually activate an action. */ activate(): void; /** * Disable activation signals from the action * * This is needed when updating the state of your proxy * #GtkActivatable widget could result in calling gtk_action_activate(), * this is a convenience function to avoid recursing in those * cases (updating toggle state for instance). */ block_activate(): void; /** * Disables calls to the gtk_action_activate() * function by signals on the given proxy widget. This is used to * break notification loops for things like check or radio actions. * * This function is intended for use by action implementations. * @param proxy a proxy widget */ block_activate_from(proxy: Widget): void; /** * Installs the accelerator for `action` if `action` has an * accel path and group. See gtk_action_set_accel_path() and * gtk_action_set_accel_group() * * Since multiple proxies may independently trigger the installation * of the accelerator, the `action` counts the number of times this * function has been called and doesn't remove the accelerator until * gtk_action_disconnect_accelerator() has been called as many times. */ connect_accelerator(): void; /** * Connects a widget to an action object as a proxy. Synchronises * various properties of the action with the widget (such as label * text, icon, tooltip, etc), and attaches a callback so that the * action gets activated when the proxy widget does. * * If the widget is already connected to an action, it is disconnected * first. * @param proxy the proxy widget */ connect_proxy(proxy: Widget): void; /** * This function is intended for use by action implementations to * create icons displayed in the proxy widgets. * @param icon_size the size of the icon that should be created. * @returns a widget that displays the icon for this action. */ create_icon(icon_size: number): Widget; /** * If `action` provides a #GtkMenu widget as a submenu for the menu * item or the toolbar item it creates, this function returns an * instance of that menu. * @returns the menu item provided by the action, or %NULL. */ create_menu(): Widget; /** * Creates a menu item widget that proxies for the given action. * @returns a menu item connected to the action. */ create_menu_item(): Widget; /** * Creates a toolbar item widget that proxies for the given action. * @returns a toolbar item connected to the action. */ create_tool_item(): Widget; /** * Undoes the effect of one call to gtk_action_connect_accelerator(). */ disconnect_accelerator(): void; /** * Disconnects a proxy widget from an action. * Does not destroy the widget, however. * @param proxy the proxy widget */ disconnect_proxy(proxy: Widget): void; /** * Returns the accel closure for this action. * @returns the accel closure for this action. The returned closure is owned by GTK+ and must not be unreffed or modified. */ get_accel_closure(): GObject.Closure; /** * Returns the accel path for this action. * @returns the accel path for this action, or %NULL if none is set. The returned string is owned by GTK+ and must not be freed or modified. */ get_accel_path(): string; /** * Returns whether `action<`!-- -->'s menu item proxies will ignore the * #GtkSettings:gtk-menu-images setting and always show their image, * if available. * @returns %TRUE if the menu item proxies will always show their image */ get_always_show_image(): boolean; /** * Gets the gicon of `action`. * @returns The action's #GIcon if one is set. */ get_gicon(): Gio.Icon; /** * Gets the icon name of `action`. * @returns the icon name */ get_icon_name(): string; /** * Checks whether `action` is important or not * @returns whether @action is important */ get_is_important(): boolean; /** * Gets the label text of `action`. * @returns the label text */ get_label(): string; /** * Returns the name of the action. * @returns the name of the action. The string belongs to GTK+ and should not be freed. */ get_name(): string; /** * Returns the proxy widgets for an action. * See also gtk_widget_get_action(). * @returns a #GSList of proxy widgets. The list is owned by GTK+ and must not be modified. */ get_proxies(): Widget[]; /** * Returns whether the action itself is sensitive. Note that this doesn't * necessarily mean effective sensitivity. See gtk_action_is_sensitive() * for that. * @returns %TRUE if the action itself is sensitive. */ get_sensitive(): boolean; /** * Gets the short label text of `action`. * @returns the short label text. */ get_short_label(): string; /** * Gets the stock id of `action`. * @returns the stock id */ get_stock_id(): string; /** * Gets the tooltip text of `action`. * @returns the tooltip text */ get_tooltip(): string; /** * Returns whether the action itself is visible. Note that this doesn't * necessarily mean effective visibility. See gtk_action_is_sensitive() * for that. * @returns %TRUE if the action itself is visible. */ get_visible(): boolean; /** * Checks whether `action` is visible when horizontal * @returns whether @action is visible when horizontal */ get_visible_horizontal(): boolean; /** * Checks whether `action` is visible when horizontal * @returns whether @action is visible when horizontal */ get_visible_vertical(): boolean; /** * Returns whether the action is effectively sensitive. * @returns %TRUE if the action and its associated action group are both sensitive. */ is_sensitive(): boolean; /** * Returns whether the action is effectively visible. * @returns %TRUE if the action and its associated action group are both visible. */ is_visible(): boolean; /** * Sets the #GtkAccelGroup in which the accelerator for this action * will be installed. * @param accel_group a #GtkAccelGroup or %NULL */ set_accel_group(accel_group?: AccelGroup | null): void; /** * Sets the accel path for this action. All proxy widgets associated * with the action will have this accel path, so that their * accelerators are consistent. * * Note that `accel_path` string will be stored in a #GQuark. Therefore, if you * pass a static string, you can save some memory by interning it first with * g_intern_static_string(). * @param accel_path the accelerator path */ set_accel_path(accel_path: string): void; /** * Sets whether `action<`!-- -->'s menu item proxies will ignore the * #GtkSettings:gtk-menu-images setting and always show their image, if available. * * Use this if the menu item would be useless or hard to use * without their image. * @param always_show %TRUE if menuitem proxies should always show their image */ set_always_show_image(always_show: boolean): void; /** * Sets the icon of `action`. * @param icon the #GIcon to set */ set_gicon(icon: Gio.Icon): void; /** * Sets the icon name on `action` * @param icon_name the icon name to set */ set_icon_name(icon_name: string): void; /** * Sets whether the action is important, this attribute is used * primarily by toolbar items to decide whether to show a label * or not. * @param is_important %TRUE to make the action important */ set_is_important(is_important: boolean): void; /** * Sets the label of `action`. * @param label the label text to set */ set_label(label: string): void; /** * Sets the ::sensitive property of the action to `sensitive`. Note that * this doesn't necessarily mean effective sensitivity. See * gtk_action_is_sensitive() * for that. * @param sensitive %TRUE to make the action sensitive */ set_sensitive(sensitive: boolean): void; /** * Sets a shorter label text on `action`. * @param short_label the label text to set */ set_short_label(short_label: string): void; /** * Sets the stock id on `action` * @param stock_id the stock id */ set_stock_id(stock_id: string): void; /** * Sets the tooltip text on `action` * @param tooltip the tooltip text */ set_tooltip(tooltip: string): void; /** * Sets the ::visible property of the action to `visible`. Note that * this doesn't necessarily mean effective visibility. See * gtk_action_is_visible() * for that. * @param visible %TRUE to make the action visible */ set_visible(visible: boolean): void; /** * Sets whether `action` is visible when horizontal * @param visible_horizontal whether the action is visible horizontally */ set_visible_horizontal(visible_horizontal: boolean): void; /** * Sets whether `action` is visible when vertical * @param visible_vertical whether the action is visible vertically */ set_visible_vertical(visible_vertical: boolean): void; /** * Reenable activation signals from the action */ unblock_activate(): void; /** * Re-enables calls to the gtk_action_activate() * function by signals on the given proxy widget. This undoes the * blocking done by gtk_action_block_activate_from(). * * This function is intended for use by action implementations. * @param proxy a proxy widget */ unblock_activate_from(proxy: Widget): void; // Inherited methods /** * Adds a child to `buildable`. `type` is an optional string * describing how the child should be added. * @param builder a #GtkBuilder * @param child child to add * @param type kind of child or %NULL */ add_child(builder: Builder, child: GObject.Object, type?: string | null): void; /** * Constructs a child of `buildable` with the name `name`. * * #GtkBuilder calls this function if a "constructor" has been * specified in the UI definition. * @param builder #GtkBuilder used to construct this object * @param name name of child to construct * @returns the constructed child */ construct_child(builder: Builder, name: string): T; /** * This is similar to gtk_buildable_parser_finished() but is * called once for each custom tag handled by the `buildable`. * @param builder a #GtkBuilder * @param child child object or %NULL for non-child tags * @param tagname the name of the tag * @param data user data created in custom_tag_start */ custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void; /** * This is called at the end of each custom element handled by * the buildable. * @param builder #GtkBuilder used to construct this object * @param child child object or %NULL for non-child tags * @param tagname name of tag * @param data user data that will be passed in to parser functions */ custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void; /** * This is called for each unknown element under <child>. * @param builder a #GtkBuilder used to construct this object * @param child child object or %NULL for non-child tags * @param tagname name of tag * @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't. */ custom_tag_start( builder: Builder, child: GObject.Object | null, tagname: string, ): [boolean, GLib.MarkupParser, any]; /** * Get the internal child called `childname` of the `buildable` object. * @param builder a #GtkBuilder * @param childname name of child * @returns the internal child of the buildable object */ get_internal_child(builder: Builder, childname: string): T; /** * Called when the builder finishes the parsing of a * GtkBuilder UI definition. * Note that this will be called once for each time * gtk_builder_add_from_file() or gtk_builder_add_from_string() * is called on a builder. * @param builder a #GtkBuilder */ parser_finished(builder: Builder): void; /** * Sets the property name `name` to `value` on the `buildable` object. * @param builder a #GtkBuilder * @param name name of property * @param value value of property */ set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void; /** * Sets the name of the `buildable` object. * @param name name to set */ set_name(name: string): void; /** * Adds a child to `buildable`. `type` is an optional string * describing how the child should be added. * @param builder a #GtkBuilder * @param child child to add * @param type kind of child or %NULL */ vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void; /** * Constructs a child of `buildable` with the name `name`. * * #GtkBuilder calls this function if a "constructor" has been * specified in the UI definition. * @param builder #GtkBuilder used to construct this object * @param name name of child to construct */ vfunc_construct_child(builder: Builder, name: string): T; /** * This is similar to gtk_buildable_parser_finished() but is * called once for each custom tag handled by the `buildable`. * @param builder a #GtkBuilder * @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 */ vfunc_custom_finished( builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null, ): void; /** * This is called at the end of each custom element handled by * the buildable. * @param builder #GtkBuilder 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 */ vfunc_custom_tag_end( builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null, ): void; /** * This is called for each unknown element under <child>. * @param builder a #GtkBuilder used to construct this object * @param child child object or %NULL for non-child tags * @param tagname name of tag */ vfunc_custom_tag_start( builder: Builder, child: GObject.Object | null, tagname: string, ): [boolean, GLib.MarkupParser, any]; /** * Get the internal child called `childname` of the `buildable` object. * @param builder a #GtkBuilder * @param childname name of child */ vfunc_get_internal_child(builder: Builder, childname: string): T; /** * Gets the name of the `buildable` object. * * #GtkBuilder sets the name based on the the * GtkBuilder UI definition * used to construct the `buildable`. */ vfunc_get_name(): string; /** * Called when the builder finishes the parsing of a * GtkBuilder UI definition. * Note that this will be called once for each time * gtk_builder_add_from_file() or gtk_builder_add_from_string() * is called on a builder. * @param builder a #GtkBuilder */ vfunc_parser_finished(builder: Builder): void; /** * Sets the property name `name` to `value` on the `buildable` object. * @param builder a #GtkBuilder * @param name name of property * @param value value of property */ vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void; /** * Sets the name of the `buildable` object. * @param name name to set */ vfunc_set_name(name: string): void; /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. * @param properties Object containing the properties to set */ set(properties: { [key: string]: any }): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace ActionGroup { // Signal callback interfaces interface ConnectProxy { (action: Action, proxy: Widget): void; } interface DisconnectProxy { (action: Action, proxy: Widget): void; } interface PostActivate { (action: Action): void; } interface PreActivate { (action: Action): void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps { name: string; sensitive: boolean; visible: boolean; } } class ActionGroup extends GObject.Object implements Buildable { static $gtype: GObject.GType; // Properties get name(): string; get sensitive(): boolean; set sensitive(val: boolean); get visible(): boolean; set visible(val: boolean); // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](name: string): ActionGroup; // Signals connect(id: string, callback: (...args: any[]) => any): number; connect_after(id: string, callback: (...args: any[]) => any): number; emit(id: string, ...args: any[]): void; connect(signal: 'connect-proxy', callback: (_source: this, action: Action, proxy: Widget) => void): number; connect_after( signal: 'connect-proxy', callback: (_source: this, action: Action, proxy: Widget) => void, ): number; emit(signal: 'connect-proxy', action: Action, proxy: Widget): void; connect( signal: 'disconnect-proxy', callback: (_source: this, action: Action, proxy: Widget) => void, ): number; connect_after( signal: 'disconnect-proxy', callback: (_source: this, action: Action, proxy: Widget) => void, ): number; emit(signal: 'disconnect-proxy', action: Action, proxy: Widget): void; connect(signal: 'post-activate', callback: (_source: this, action: Action) => void): number; connect_after(signal: 'post-activate', callback: (_source: this, action: Action) => void): number; emit(signal: 'post-activate', action: Action): void; connect(signal: 'pre-activate', callback: (_source: this, action: Action) => void): number; connect_after(signal: 'pre-activate', callback: (_source: this, action: Action) => void): number; emit(signal: 'pre-activate', action: Action): void; // Virtual methods /** * Looks up an action in the action group by name. * @param action_name the name of the action */ vfunc_get_action(action_name: string): Action; // Methods /** * Adds an action object to the action group. Note that this function * does not set up the accel path of the action, which can lead to problems * if a user tries to modify the accelerator of a menuitem associated with * the action. Therefore you must either set the accel path yourself with * gtk_action_set_accel_path(), or use * gtk_action_group_add_action_with_accel (..., NULL). * @param action an action */ add_action(action: Action): void; /** * Adds an action object to the action group and sets up the accelerator. * * If `accelerator` is %NULL, attempts to use the accelerator associated * with the stock_id of the action. * * Accel paths are set to * <Actions>/group-name/action-name. * @param action the action to add * @param accelerator the accelerator for the action, in the format understood by gtk_accelerator_parse(), or "" for no accelerator, or %NULL to use the stock accelerator */ add_action_with_accel(action: Action, accelerator?: string | null): void; /** * This is a convenience function to create a number of actions and add them * to the action group. * * The "activate" signals of the actions are connected to the callbacks and * their accel paths are set to * <Actions>/group-name/action-name. * @param entries an array of action descriptions * @param n_entries the number of entries * @param user_data data to pass to the action callbacks */ add_actions(entries: ActionEntry, n_entries: number, user_data?: any | null): void; /** * This variant of gtk_action_group_add_actions() adds a #GDestroyNotify * callback for `user_data`. * @param entries an array of action descriptions * @param n_entries the number of entries * @param user_data data to pass to the action callbacks */ add_actions_full(entries: ActionEntry, n_entries: number, user_data?: any | null): void; /** * This variant of gtk_action_group_add_radio_actions() adds a * #GDestroyNotify callback for `user_data`. * @param entries an array of radio action descriptions * @param n_entries the number of entries * @param value the value of the action to activate initially, or -1 if no action should be activated * @param on_change the callback to connect to the changed signal */ add_radio_actions_full( entries: RadioActionEntry, n_entries: number, value: number, on_change: GObject.Callback, ): void; /** * This is a convenience function to create a number of toggle actions and add them * to the action group. * * The "activate" signals of the actions are connected to the callbacks and * their accel paths are set to * <Actions>/group-name/action-name. * @param entries an array of toggle action descriptions * @param n_entries the number of entries * @param user_data data to pass to the action callbacks */ add_toggle_actions(entries: ToggleActionEntry, n_entries: number, user_data?: any | null): void; /** * This variant of gtk_action_group_add_toggle_actions() adds a * #GDestroyNotify callback for `user_data`. * @param entries an array of toggle action descriptions * @param n_entries the number of entries * @param user_data data to pass to the action callbacks */ add_toggle_actions_full(entries: ToggleActionEntry, n_entries: number, user_data?: any | null): void; /** * Looks up an action in the action group by name. * @param action_name the name of the action * @returns the action, or %NULL if no action by that name exists */ get_action(action_name: string): Action; /** * Gets the name of the action group. * @returns the name of the action group. */ get_name(): string; /** * Returns %TRUE if the group is sensitive. The constituent actions * can only be logically sensitive (see gtk_action_is_sensitive()) if * they are sensitive (see gtk_action_get_sensitive()) and their group * is sensitive. * @returns %TRUE if the group is sensitive. */ get_sensitive(): boolean; /** * Returns %TRUE if the group is visible. The constituent actions * can only be logically visible (see gtk_action_is_visible()) if * they are visible (see gtk_action_get_visible()) and their group * is visible. * @returns %TRUE if the group is visible. */ get_visible(): boolean; /** * Lists the actions in the action group. * @returns an allocated list of the action objects in the action group */ list_actions(): Action[]; /** * Removes an action object from the action group. * @param action an action */ remove_action(action: Action): void; /** * Changes the sensitivity of `action_group` * @param sensitive new sensitivity */ set_sensitive(sensitive: boolean): void; /** * Sets a function to be used for translating the `label` and `tooltip` of * #GtkActionGroupEntrys added by gtk_action_group_add_actions(). * * If you're using gettext(), it is enough to set the translation domain * with gtk_action_group_set_translation_domain(). * @param func a #GtkTranslateFunc */ set_translate_func(func: TranslateFunc): void; /** * Sets the translation domain and uses g_dgettext() for translating the * `label` and `tooltip` of #GtkActionEntrys added by * gtk_action_group_add_actions(). * * If you're not using gettext() for localization, see * gtk_action_group_set_translate_func(). * @param domain the translation domain to use for g_dgettext() calls */ set_translation_domain(domain: string): void; /** * Changes the visible of `action_group`. * @param visible new visiblity */ set_visible(visible: boolean): void; /** * Translates a string using the specified translate_func(). This * is mainly intended for language bindings. * @param string a string * @returns the translation of @string */ translate_string(string: string): string; // Inherited methods /** * Adds a child to `buildable`. `type` is an optional string * describing how the child should be added. * @param builder a #GtkBuilder * @param child child to add * @param type kind of child or %NULL */ add_child(builder: Builder, child: GObject.Object, type?: string | null): void; /** * Constructs a child of `buildable` with the name `name`. * * #GtkBuilder calls this function if a "constructor" has been * specified in the UI definition. * @param builder #GtkBuilder used to construct this object * @param name name of child to construct * @returns the constructed child */ construct_child(builder: Builder, name: string): T; /** * This is similar to gtk_buildable_parser_finished() but is * called once for each custom tag handled by the `buildable`. * @param builder a #GtkBuilder * @param child child object or %NULL for non-child tags * @param tagname the name of the tag * @param data user data created in custom_tag_start */ custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void; /** * This is called at the end of each custom element handled by * the buildable. * @param builder #GtkBuilder used to construct this object * @param child child object or %NULL for non-child tags * @param tagname name of tag * @param data user data that will be passed in to parser functions */ custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void; /** * This is called for each unknown element under <child>. * @param builder a #GtkBuilder used to construct this object * @param child child object or %NULL for non-child tags * @param tagname name of tag * @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't. */ custom_tag_start( builder: Builder, child: GObject.Object | null, tagname: string, ): [boolean, GLib.MarkupParser, any]; /** * Get the internal child called `childname` of the `buildable` object. * @param builder a #GtkBuilder * @param childname name of child * @returns the internal child of the buildable object */ get_internal_child(builder: Builder, childname: string): T; /** * Called when the builder finishes the parsing of a * GtkBuilder UI definition. * Note that this will be called once for each time * gtk_builder_add_from_file() or gtk_builder_add_from_string() * is called on a builder. * @param builder a #GtkBuilder */ parser_finished(builder: Builder): void; /** * Sets the property name `name` to `value` on the `buildable` object. * @param builder a #GtkBuilder * @param name name of property * @param value value of property */ set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void; /** * Sets the name of the `buildable` object. * @param name name to set */ set_name(name: string): void; /** * Adds a child to `buildable`. `type` is an optional string * describing how the child should be added. * @param builder a #GtkBuilder * @param child child to add * @param type kind of child or %NULL */ vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void; /** * Constructs a child of `buildable` with the name `name`. * * #GtkBuilder calls this function if a "constructor" has been * specified in the UI definition. * @param builder #GtkBuilder used to construct this object * @param name name of child to construct */ vfunc_construct_child(builder: Builder, name: string): T; /** * This is similar to gtk_buildable_parser_finished() but is * called once for each custom tag handled by the `buildable`. * @param builder a #GtkBuilder * @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 */ vfunc_custom_finished( builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null, ): void; /** * This is called at the end of each custom element handled by * the buildable. * @param builder #GtkBuilder 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 */ vfunc_custom_tag_end( builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null, ): void; /** * This is called for each unknown element under <child>. * @param builder a #GtkBuilder used to construct this object * @param child child object or %NULL for non-child tags * @param tagname name of tag */ vfunc_custom_tag_start( builder: Builder, child: GObject.Object | null, tagname: string, ): [boolean, GLib.MarkupParser, any]; /** * Get the internal child called `childname` of the `buildable` object. * @param builder a #GtkBuilder * @param childname name of child */ vfunc_get_internal_child(builder: Builder, childname: string): T; /** * Gets the name of the `buildable` object. * * #GtkBuilder sets the name based on the the * GtkBuilder UI definition * used to construct the `buildable`. */ vfunc_get_name(): string; /** * Called when the builder finishes the parsing of a * GtkBuilder UI definition. * Note that this will be called once for each time * gtk_builder_add_from_file() or gtk_builder_add_from_string() * is called on a builder. * @param builder a #GtkBuilder */ vfunc_parser_finished(builder: Builder): void; /** * Sets the property name `name` to `value` on the `buildable` object. * @param builder a #GtkBuilder * @param name name of property * @param value value of property */ vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void; /** * Sets the name of the `buildable` object. * @param name name to set */ vfunc_set_name(name: string): void; /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. * @param properties Object containing the properties to set */ set(properties: { [key: string]: any }): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace Adjustment { // Signal callback interfaces interface Changed { (): void; } interface ValueChanged { (): void; } // Constructor properties interface interface ConstructorProps extends Object.ConstructorProps { lower: number; page_increment: number; pageIncrement: number; page_size: number; pageSize: number; step_increment: number; stepIncrement: number; upper: number; value: number; } } class Adjustment extends Object { static $gtype: GObject.GType; // Properties /** * The minimum value of the adjustment. */ get lower(): number; set lower(val: number); /** * The page increment of the adjustment. */ get page_increment(): number; set page_increment(val: number); /** * The page increment of the adjustment. */ 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 * #GtkSpinButton. */ 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 * #GtkSpinButton. */ get pageSize(): number; set pageSize(val: number); /** * The step increment of the adjustment. */ get step_increment(): number; set step_increment(val: number); /** * The step increment of the adjustment. */ 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. */ get upper(): number; set upper(val: number); /** * The value of the adjustment. */ get value(): number; set value(val: number); // 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 connect(id: string, callback: (...args: any[]) => any): number; connect_after(id: string, callback: (...args: any[]) => any): number; emit(id: string, ...args: any[]): void; connect(signal: 'changed', callback: (_source: this) => void): number; connect_after(signal: 'changed', callback: (_source: this) => void): number; emit(signal: 'changed'): void; connect(signal: 'value-changed', callback: (_source: this) => void): number; connect_after(signal: 'value-changed', callback: (_source: this) => void): number; emit(signal: 'value-changed'): void; // Virtual methods vfunc_changed(): void; vfunc_value_changed(): void; // Methods changed(): void; clamp_page(lower: number, upper: number): void; /** * Sets all properties of the adjustment at once. * * Use this function to avoid multiple emissions of the "changed" * signal. See gtk_adjustment_set_lower() for an alternative way * of compressing multiple emissions of "changed" into one. * @param value the new value * @param lower the new minimum value * @param upper the new maximum value * @param step_increment the new step increment * @param page_increment the new page increment * @param page_size the new page size */ configure( value: number, lower: number, upper: number, step_increment: number, page_increment: number, page_size: number, ): void; /** * Retrieves the minimum value of the adjustment. * @returns The current minimum value of the adjustment. */ get_lower(): number; /** * Retrieves the page increment of the adjustment. * @returns The current page increment of the adjustment. */ get_page_increment(): number; /** * Retrieves the page size of the adjustment. * @returns The current page size of the adjustment. */ get_page_size(): number; /** * Retrieves the step increment of the adjustment. * @returns The current step increment of the adjustment. */ get_step_increment(): number; /** * Retrieves the maximum value of the adjustment. * @returns The current maximum value of the adjustment. */ get_upper(): number; /** * Gets the current value of the adjustment. See * gtk_adjustment_set_value (). * @returns The current value of the adjustment. */ get_value(): number; /** * Sets the minimum value of the adjustment. * * When setting multiple adjustment properties via their individual * setters, multiple "changed" signals will be emitted. However, since * the emission of the "changed" signal is tied to the emission of the * "GObject::notify" signals of the changed properties, it's possible * to compress the "changed" signals into one by calling * g_object_freeze_notify() and g_object_thaw_notify() around the * calls to the individual setters. * * Alternatively, using a single g_object_set() for all the properties * to change, or using gtk_adjustment_configure() has the same effect * of compressing "changed" emissions. * @param lower the new minimum value */ set_lower(lower: number): void; /** * Sets the page increment of the adjustment. * * See gtk_adjustment_set_lower() about how to compress multiple * emissions of the "changed" signal when setting multiple adjustment * properties. * @param page_increment the new page increment */ set_page_increment(page_increment: number): void; /** * Sets the page size of the adjustment. * * See gtk_adjustment_set_lower() about how to compress multiple * emissions of the "changed" signal when setting multiple adjustment * properties. * @param page_size the new page size */ set_page_size(page_size: number): void; /** * Sets the step increment of the adjustment. * * See gtk_adjustment_set_lower() about how to compress multiple * emissions of the "changed" signal when setting multiple adjustment * properties. * @param step_increment the new step increment */ set_step_increment(step_increment: number): void; /** * Sets the maximum value of the adjustment. * * Note that values will be restricted by * upper - page-size if the page-size * property is nonzero. * * See gtk_adjustment_set_lower() about how to compress multiple * emissions of the "changed" signal when setting multiple adjustment * properties. * @param upper the new maximum value */ set_upper(upper: number): void; set_value(value: number): void; value_changed(): void; } namespace Alignment { // Constructor properties interface interface ConstructorProps extends Bin.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { bottom_padding: number; bottomPadding: number; left_padding: number; leftPadding: number; right_padding: number; rightPadding: number; top_padding: number; topPadding: number; xalign: number; xscale: number; yalign: number; yscale: number; } } /** * The #GtkAlignment widget controls the alignment and size of its child widget. * It has four settings: xscale, yscale, xalign, and yalign. * * The scale settings are used to specify how much the child widget should * expand to fill the space allocated to the #GtkAlignment. * The values can range from 0 (meaning the child doesn't expand at all) to * 1 (meaning the child expands to fill all of the available space). * * The align settings are used to place the child widget within the available * area. The values range from 0 (top or left) to 1 (bottom or right). * Of course, if the scale settings are both set to 1, the alignment settings * have no effect. */ class Alignment extends Bin implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties /** * The padding to insert at the bottom of the widget. */ get bottom_padding(): number; set bottom_padding(val: number); /** * The padding to insert at the bottom of the widget. */ get bottomPadding(): number; set bottomPadding(val: number); /** * The padding to insert at the left of the widget. */ get left_padding(): number; set left_padding(val: number); /** * The padding to insert at the left of the widget. */ get leftPadding(): number; set leftPadding(val: number); /** * The padding to insert at the right of the widget. */ get right_padding(): number; set right_padding(val: number); /** * The padding to insert at the right of the widget. */ get rightPadding(): number; set rightPadding(val: number); /** * The padding to insert at the top of the widget. */ get top_padding(): number; set top_padding(val: number); /** * The padding to insert at the top of the widget. */ get topPadding(): number; set topPadding(val: number); get xalign(): number; set xalign(val: number); get xscale(): number; set xscale(val: number); get yalign(): number; set yalign(val: number); get yscale(): number; set yscale(val: number); // Fields bin: Bin; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](xalign: number, yalign: number, xscale: number, yscale: number): Alignment; // Methods /** * Gets the padding on the different sides of the widget. * See gtk_alignment_set_padding (). */ get_padding(): [number, number, number, number]; /** * Sets the #GtkAlignment values. * @param xalign the horizontal alignment of the child widget, from 0 (left) to 1 (right). * @param yalign the vertical alignment of the child widget, from 0 (top) to 1 (bottom). * @param xscale the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the #GtkAlignment. * @param yscale the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to @xscale. */ set(xalign: number, yalign: number, xscale: number, yscale: number): void; // Conflicted with GObject.Object.set set(...args: never[]): any; /** * Sets the padding on the different sides of the widget. * The padding adds blank space to the sides of the widget. For instance, * this can be used to indent the child widget towards the right by adding * padding on the left. * @param padding_top the padding at the top of the widget * @param padding_bottom the padding at the bottom of the widget * @param padding_left the padding at the left of the widget * @param padding_right the padding at the right of the widget. */ set_padding(padding_top: number, padding_bottom: number, padding_left: number, padding_right: number): void; // Inherited methods /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace Arrow { // Constructor properties interface interface ConstructorProps extends Misc.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { arrow_type: ArrowType; arrowType: ArrowType; shadow_type: ShadowType; shadowType: ShadowType; } } /** * GtkArrow should be used to draw simple arrows that need to point in * one of the four cardinal directions (up, down, left, or right). The * style of the arrow can be one of shadow in, shadow out, etched in, or * etched out. Note that these directions and style types may be * ammended in versions of GTK+ to come. * * GtkArrow will fill any space alloted to it, but since it is inherited * from #GtkMisc, it can be padded and/or aligned, to fill exactly the * space the programmer desires. * * Arrows are created with a call to gtk_arrow_new(). The direction or * style of an arrow can be changed after creation by using gtk_arrow_set(). */ class Arrow extends Misc implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties get arrow_type(): ArrowType; set arrow_type(val: ArrowType); get arrowType(): ArrowType; set arrowType(val: ArrowType); get shadow_type(): ShadowType; set shadow_type(val: ShadowType); get shadowType(): ShadowType; set shadowType(val: ShadowType); // Fields misc: Misc; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](arrow_type: ArrowType, shadow_type: ShadowType): Arrow; // Methods /** * Sets the direction and style of the #GtkArrow, `arrow`. * @param arrow_type a valid #GtkArrowType. * @param shadow_type a valid #GtkShadowType. */ set(arrow_type: ArrowType | null, shadow_type: ShadowType | null): void; // Conflicted with GObject.Object.set set(...args: never[]): any; // Inherited methods /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace AspectFrame { // Constructor properties interface interface ConstructorProps extends Frame.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps { obey_child: boolean; obeyChild: boolean; ratio: number; xalign: number; yalign: number; } } /** * The #GtkAspectFrame is useful when you want * pack a widget so that it can resize but always retains * the same aspect ratio. For instance, one might be * drawing a small preview of a larger image. #GtkAspectFrame * derives from #GtkFrame, so it can draw a label and * a frame around the child. The frame will be * "shrink-wrapped" to the size of the child. */ class AspectFrame extends Frame implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Properties get obey_child(): boolean; set obey_child(val: boolean); get obeyChild(): boolean; set obeyChild(val: boolean); get ratio(): number; set ratio(val: number); get xalign(): number; set xalign(val: number); get yalign(): number; set yalign(val: number); // Fields frame: Frame; center_allocation: Allocation; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( label: string, xalign: number, yalign: number, ratio: number, obey_child: boolean, ): AspectFrame; // Conflicted with Gtk.Frame.new static ['new'](...args: never[]): any; // Methods /** * Set parameters for an existing #GtkAspectFrame. * @param xalign Horizontal alignment of the child within the allocation of the #GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned) * @param yalign Vertical alignment of the child within the allocation of the #GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned) * @param ratio The desired aspect ratio. * @param obey_child If %TRUE, @ratio is ignored, and the aspect ratio is taken from the requistion of the child. */ set(xalign: number, yalign: number, ratio: number, obey_child: boolean): void; // Conflicted with GObject.Object.set set(...args: never[]): any; // Inherited methods /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace Assistant { // Signal callback interfaces interface Apply { (): void; } interface Cancel { (): void; } interface Close { (): void; } interface Prepare { (page: Widget): void; } // Constructor properties interface interface ConstructorProps extends Window.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps {} } /** * A #GtkAssistant is a widget used to represent a generally complex * operation splitted in several steps, guiding the user through its pages * and controlling the page flow to collect the necessary data. * * * GtkAssistant as GtkBuildable * * The GtkAssistant implementation of the GtkBuildable interface exposes the * `action_area` as internal children with the name "action_area". * * To add pages to an assistant in GtkBuilder, simply add it as a * <child> to the GtkAssistant object, and set its child properties * as necessary. * * */ class Assistant extends Window implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Fields cancel: Widget; forward: Widget; back: Widget; apply: Widget; close: Widget; last: Widget; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](): Assistant; // Signals connect(id: string, callback: (...args: any[]) => any): number; connect_after(id: string, callback: (...args: any[]) => any): number; emit(id: string, ...args: any[]): void; connect(signal: 'apply', callback: (_source: this) => void): number; connect_after(signal: 'apply', callback: (_source: this) => void): number; emit(signal: 'apply'): void; connect(signal: 'cancel', callback: (_source: this) => void): number; connect_after(signal: 'cancel', callback: (_source: this) => void): number; emit(signal: 'cancel'): void; connect(signal: 'close', callback: (_source: this) => void): number; connect_after(signal: 'close', callback: (_source: this) => void): number; emit(signal: 'close'): void; connect(signal: 'prepare', callback: (_source: this, page: Widget) => void): number; connect_after(signal: 'prepare', callback: (_source: this, page: Widget) => void): number; emit(signal: 'prepare', page: Widget): void; // Virtual methods vfunc_apply(): void; vfunc_cancel(): void; vfunc_close(): void; vfunc_prepare(page: Widget): void; // Methods /** * Adds a widget to the action area of a #GtkAssistant. * @param child a #GtkWidget */ add_action_widget(child: Widget): void; /** * Appends a page to the `assistant`. * @param page a #GtkWidget * @returns the index (starting at 0) of the inserted page */ append_page(page: Widget): number; /** * Erases the visited page history so the back button is not * shown on the current page, and removes the cancel button * from subsequent pages. * * Use this when the information provided up to the current * page is hereafter deemed permanent and cannot be modified * or undone. For example, showing a progress page to track * a long-running, unreversible operation after the user has * clicked apply on a confirmation page. */ commit(): void; /** * Returns the page number of the current page * @returns The index (starting from 0) of the current page in the @assistant, if the @assistant has no pages, -1 will be returned */ 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; /** * 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 header image for `page`. * @param page a page of @assistant * @returns the header image for @page, or %NULL if there's no header image for the page. */ get_page_header_image(page: Widget): GdkPixbuf.Pixbuf; /** * Gets the header image for `page`. * @param page a page of @assistant * @returns the side image for @page, or %NULL if there's no side image for the page. */ get_page_side_image(page: Widget): GdkPixbuf.Pixbuf; /** * Gets the title for `page`. * @param page a page of @assistant * @returns the title for @page. */ get_page_title(page: Widget): string; /** * Gets the page type of `page`. * @param page a page of @assistant * @returns the page type of @page. */ get_page_type(page: Widget): AssistantPageType; /** * Inserts a page in the `assistant` at a given position. * @param page a #GtkWidget * @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; /** * Prepends a page to the `assistant`. * @param page a #GtkWidget * @returns the index (starting at 0) of the inserted page */ prepend_page(page: Widget): number; /** * Removes a widget from the action area of a #GtkAssistant. * @param child a #GtkWidget */ remove_action_widget(child: Widget): 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 #GtkAssistantPageFunc, 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 header image for `page`. This image is displayed in the header * area of the assistant when `page` is the current page. * @param page a page of @assistant * @param pixbuf the new header image @page */ set_page_header_image(page: Widget, pixbuf?: GdkPixbuf.Pixbuf | null): void; /** * Sets a header image for `page`. This image is displayed in the side * area of the assistant when `page` is the current page. * @param page a page of @assistant * @param pixbuf the new header image @page */ set_page_side_image(page: Widget, pixbuf?: GdkPixbuf.Pixbuf | null): void; /** * Sets a title for `page`. The title is displayed in the header * area of the assistant when `page` is the current page. * @param page a page of @assistant * @param title the new title for @page */ set_page_title(page: Widget, title: string): void; /** * Sets the page type for `page`. The page type determines the page * behavior in the `assistant`. * @param page a page of @assistant * @param type the new type for @page */ set_page_type(page: Widget, type: AssistantPageType | null): 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; // Inherited methods /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. * @param properties Object containing the properties to set */ set(properties: { [key: string]: any }): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace Bin { // Constructor properties interface interface ConstructorProps extends Container.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps {} } /** * The #GtkBin widget is a container with just one child. * It is not very useful itself, but it is useful for deriving subclasses, * since it provides common code needed for handling a single child widget. * * Many GTK+ widgets are subclasses of #GtkBin, including #GtkWindow, * #GtkButton, #GtkFrame, #GtkHandleBox or #GtkScrolledWindow. */ abstract class Bin extends Container implements Atk.ImplementorIface, Buildable { static $gtype: GObject.GType; // Fields container: Container; // @ts-expect-error This property conflicts with an accessor in a parent class or interface. child: Widget; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Methods /** * Gets the child of the #GtkBin, or %NULL if the bin contains * no child widget. The returned widget does not have a reference * added, so you do not need to unref it. * @returns pointer to child of the #GtkBin */ get_child(): Widget; // Inherited methods /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. * @param properties Object containing the properties to set */ set(properties: { [key: string]: any }): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace Box { // Constructor properties interface interface ConstructorProps extends Container.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Buildable.ConstructorProps, Orientable.ConstructorProps { homogeneous: boolean; spacing: number; } } abstract class Box extends Container implements Atk.ImplementorIface, Buildable, Orientable { static $gtype: GObject.GType; // Properties get homogeneous(): boolean; set homogeneous(val: boolean); get spacing(): number; set spacing(val: number); // Fields container: Container; children: any[]; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Methods /** * Returns whether the box is homogeneous (all children are the * same size). See gtk_box_set_homogeneous(). * @returns %TRUE if the box is homogeneous. */ get_homogeneous(): boolean; /** * Gets the value set by gtk_box_set_spacing(). * @returns spacing between children */ get_spacing(): number; /** * Adds `child` to `box,` packed with reference to the end of `box`. * The `child` is packed after (away from end of) any other child * packed with reference to the end of `box`. * @param child the #GtkWidget to be added to @box * @param expand %TRUE if the new child is to be given extra space allocated to @box. The extra space will be divided evenly between all children of @box that use this option * @param fill %TRUE if space given to @child by the @expand option is actually allocated to @child, rather than just padding it. This parameter has no effect if @expand is set to %FALSE. A child is always allocated the full height of a #GtkHBox and the full width of a #GtkVBox. This option affects the other dimension * @param padding extra space in pixels to put between this child and its neighbors, over and above the global amount specified by #GtkBox:spacing property. If @child is a widget at one of the reference ends of @box, then @padding pixels are also put between @child and the reference edge of @box */ pack_end(child: Widget, expand: boolean, fill: boolean, padding: number): void; /** * Adds `widget` to `box,` packed with reference to the end of `box`. * The child is packed after any other child packed with reference * to the start of `box`. * * Parameters for how to pack the child `widget,` #GtkBox:expand, * #GtkBox:fill and #GtkBox:padding, are given their default * values, %TRUE, %TRUE, and 0, respectively. * @param widget the #GtkWidget to be added to @box */ pack_end_defaults(widget: Widget): void; /** * Adds `child` to `box,` packed with reference to the start of `box`. * The `child` is packed after any other child packed with reference * to the start of `box`. * @param child the #GtkWidget to be added to @box * @param expand %TRUE if the new child is to be given extra space allocated to @box. The extra space will be divided evenly between all children of @box that use this option * @param fill %TRUE if space given to @child by the @expand option is actually allocated to @child, rather than just padding it. This parameter has no effect if @expand is set to %FALSE. A child is always allocated the full height of a #GtkHBox and the full width of a #GtkVBox. This option affects the other dimension * @param padding extra space in pixels to put between this child and its neighbors, over and above the global amount specified by #GtkBox:spacing property. If @child is a widget at one of the reference ends of @box, then @padding pixels are also put between @child and the reference edge of @box */ pack_start(child: Widget, expand: boolean, fill: boolean, padding: number): void; /** * Adds `widget` to `box,` packed with reference to the start of `box`. * The child is packed after any other child packed with reference * to the start of `box`. * * Parameters for how to pack the child `widget,` #GtkBox:expand, * #GtkBox:fill and #GtkBox:padding, are given their default * values, %TRUE, %TRUE, and 0, respectively. * @param widget the #GtkWidget to be added to @box */ pack_start_defaults(widget: Widget): void; /** * Obtains information about how `child` is packed into `box`. * @param child the #GtkWidget of the child to query * @param expand pointer to return location for #GtkBox:expand child property * @param fill pointer to return location for #GtkBox:fill child property * @param padding pointer to return location for #GtkBox:padding child property * @param pack_type pointer to return location for #GtkBox:pack-type child property */ query_child_packing( child: Widget, expand: boolean, fill: boolean, padding: number, pack_type: PackType | null, ): void; /** * Moves `child` to a new `position` in the list of `box` children. * The list is the children field of * #GtkBox-struct, and contains both widgets packed #GTK_PACK_START * as well as widgets packed #GTK_PACK_END, in the order that these * widgets were added to `box`. * * A widget's position in the `box` children list determines where * the widget is packed into `box`. A child widget at some position * in the list will be packed just after all other widgets of the * same packing type that appear earlier in the list. * @param child the #GtkWidget to move * @param position the new position for @child in the list of children of @box, starting from 0. If negative, indicates the end of the list */ reorder_child(child: Widget, position: number): void; /** * Sets the way `child` is packed into `box`. * @param child the #GtkWidget of the child to set * @param expand the new value of the #GtkBox:expand child property * @param fill the new value of the #GtkBox:fill child property * @param padding the new value of the #GtkBox:padding child property * @param pack_type the new value of the #GtkBox:pack-type child property */ set_child_packing( child: Widget, expand: boolean, fill: boolean, padding: number, pack_type: PackType | null, ): void; /** * Sets the #GtkBox:homogeneous property of `box,` controlling * whether or not all children of `box` are given equal space * in the box. * @param homogeneous a boolean value, %TRUE to create equal allotments, %FALSE for variable allotments */ set_homogeneous(homogeneous: boolean): void; /** * Sets the #GtkBox:spacing property of `box,` which is the * number of pixels to place between children of `box`. * @param spacing the number of pixels to put between children */ set_spacing(spacing: number): void; // Inherited properties /** * The orientation of the orientable. */ get orientation(): Orientation; set orientation(val: Orientation); // Inherited methods /** * 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 | null): void; /** * Creates a binding between `source_property` on `source` and `target_property` * on `target`. * * Whenever the `source_property` is changed the `target_property` is * updated using the same value. For instance: * * * ```c * g_object_bind_property (action, "active", widget, "sensitive", 0); * ``` * * * Will result in the "sensitive" property of the widget #GObject instance to be * updated with the same value of the "active" property of the action #GObject * instance. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. To remove the binding without affecting the * `source` and the `target` you can just call g_object_unref() on the returned * #GBinding instance. * * Removing the binding by calling g_object_unref() on it must only be done if * the binding, `source` and `target` are only used from a single thread and it * is clear that both `source` and `target` outlive the binding. Especially it * is not safe to rely on this if the binding, `source` or `target` can be * finalized from different threads. Keep another reference to the binding and * use g_binding_unbind() instead to be on the safe side. * * A #GObject can have multiple bindings. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, ): GObject.Binding; /** * Complete version of g_object_bind_property(). * * Creates a binding between `source_property` on `source` and `target_property` * on `target,` allowing you to set the transformation functions to be used by * the binding. * * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: * if `target_property` on `target` changes then the `source_property` on `source` * will be updated as well. The `transform_from` function is only used in case * of bidirectional bindings, otherwise it will be ignored * * The binding will automatically be removed when either the `source` or the * `target` instances are finalized. This will release the reference that is * being held on the #GBinding instance; if you want to hold on to the * #GBinding instance, you will need to hold a reference to it. * * To remove the binding, call g_binding_unbind(). * * A #GObject can have multiple bindings. * * The same `user_data` parameter will be used for both `transform_to` * and `transform_from` transformation functions; the `notify` function will * be called once, when the binding is removed. If you need different data * for each transformation function, please use * g_object_bind_property_with_closures() instead. * @param source_property the property on @source to bind * @param target the target #GObject * @param target_property the property on @target to bind * @param flags flags to pass to #GBinding * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. */ bind_property_full( source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags | null, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null, ): GObject.Binding; // Conflicted with GObject.Object.bind_property_full bind_property_full(...args: never[]): any; /** * This function is intended for #GObject implementations to re-enforce * a [floating][floating-ref] object reference. Doing this is seldom * required: all #GInitiallyUnowneds are created with a floating reference * which usually just needs to be sunken by calling g_object_ref_sink(). */ force_floating(): void; /** * Increases the freeze count on `object`. If the freeze count is * non-zero, the emission of "notify" signals on `object` is * stopped. The signals are queued until the freeze count is decreased * to zero. Duplicate notifications are squashed so that at most one * #GObject::notify signal is emitted for each property modified while the * object is frozen. * * This is necessary for accessors that modify multiple properties to prevent * premature notification while the object is still being modified. */ freeze_notify(): void; /** * Gets a named field from the objects table of associations (see g_object_set_data()). * @param key name of the key for that association * @returns the data if found, or %NULL if no such data exists. */ get_data(key: string): any | null; /** * Gets a property of an object. * * The value can be: * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) * - a GObject.Value initialized with the expected type of the property * - a GObject.Value initialized with a type to which the expected type of the property can be transformed * * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. * * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. * @param property_name The name of the property to get * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type */ get_property(property_name: string, value: GObject.Value | any): any; /** * This function gets back user data pointers stored via * g_object_set_qdata(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ get_qdata(quark: GLib.Quark): any | null; /** * Gets `n_properties` properties for an `object`. * Obtained properties will be set to `values`. All properties must be valid. * Warnings will be emitted and undefined behaviour may result if invalid * properties are passed in. * @param names the names of each property to get * @param values the values of each property to get */ getv(names: string[], values: (GObject.Value | any)[]): void; /** * Checks whether `object` has a [floating][floating-ref] reference. * @returns %TRUE if @object has a floating reference */ is_floating(): boolean; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param property_name the name of a property installed on the class of @object. */ notify(property_name: string): void; /** * Emits a "notify" signal for the property specified by `pspec` on `object`. * * This function omits the property name lookup, hence it is faster than * g_object_notify(). * * One way to avoid using g_object_notify() from within the * class that registered the properties, and using g_object_notify_by_pspec() * instead, is to store the GParamSpec used with * g_object_class_install_property() inside a static array, e.g.: * * * ```c * typedef enum * { * PROP_FOO = 1, * PROP_LAST * } MyObjectProperty; * * static GParamSpec *properties[PROP_LAST]; * * static void * my_object_class_init (MyObjectClass *klass) * { * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, * 0, 100, * 50, * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); * g_object_class_install_property (gobject_class, * PROP_FOO, * properties[PROP_FOO]); * } * ``` * * * and then notify a change on the "foo" property with: * * * ```c * g_object_notify_by_pspec (self, properties[PROP_FOO]); * ``` * * @param pspec the #GParamSpec of a property installed on the class of @object. */ notify_by_pspec(pspec: GObject.ParamSpec): void; /** * Increases the reference count of `object`. * * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type * of `object` will be propagated to the return type (using the GCC typeof() * extension), so any casting the caller needs to do on the return type must be * explicit. * @returns the same @object */ ref(): GObject.Object; /** * Increase the reference count of `object,` and possibly remove the * [floating][floating-ref] reference, if `object` has a floating reference. * * In other words, if the object is floating, then this call "assumes * ownership" of the floating reference, converting it to a normal * reference by clearing the floating flag while leaving the reference * count unchanged. If the object is not floating, then this call * adds a new normal reference increasing the reference count by one. * * Since GLib 2.56, the type of `object` will be propagated to the return type * under the same conditions as for g_object_ref(). * @returns @object */ ref_sink(): GObject.Object; /** * Releases all references to other objects. This can be used to break * reference cycles. * * This function should only be called from object system implementations. */ run_dispose(): void; /** * Each object carries around a table of associations from * strings to pointers. This function lets you set an association. * * If the object already had an association with that name, * the old association will be destroyed. * * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). * This means a copy of `key` is kept permanently (even after `object` has been * finalized) — so it is recommended to only use a small, bounded set of values * for `key` in your program, to avoid the #GQuark storage growing unbounded. * @param key name of the key * @param data data to associate with that key */ set_data(key: string, data?: any | null): void; /** * Sets a property on an object. * @param property_name The name of the property to set * @param value The value to set the property to */ set_property(property_name: string, value: GObject.Value | any): void; /** * Remove a specified datum from the object's data associations, * without invoking the association's destroy handler. * @param key name of the key * @returns the data if found, or %NULL if no such data exists. */ steal_data(key: string): any | null; /** * This function gets back user data pointers stored via * g_object_set_qdata() and removes the `data` from object * without invoking its destroy() function (if any was * set). * Usually, calling this function is only required to update * user data pointers with a destroy notifier, for example: * * ```c * void * object_add_to_user_list (GObject *object, * const gchar *new_string) * { * // the quark, naming the object data * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); * // retrieve the old string list * GList *list = g_object_steal_qdata (object, quark_string_list); * * // prepend new string * list = g_list_prepend (list, g_strdup (new_string)); * // this changed 'list', so we need to set it again * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); * } * static void * free_string_list (gpointer data) * { * GList *node, *list = data; * * for (node = list; node; node = node->next) * g_free (node->data); * g_list_free (list); * } * ``` * * Using g_object_get_qdata() in the above example, instead of * g_object_steal_qdata() would have left the destroy function set, * and thus the partial string list would have been freed upon * g_object_set_qdata_full(). * @param quark A #GQuark, naming the user data pointer * @returns The user data pointer set, or %NULL */ steal_qdata(quark: GLib.Quark): any | null; /** * Reverts the effect of a previous call to * g_object_freeze_notify(). The freeze count is decreased on `object` * and when it reaches zero, queued "notify" signals are emitted. * * Duplicate notifications for each property are squashed so that at most one * #GObject::notify signal is emitted for each property, in the reverse order * in which they have been queued. * * It is an error to call this function when the freeze count is zero. */ thaw_notify(): void; /** * Decreases the reference count of `object`. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). * * If the pointer to the #GObject may be reused in future (for example, if it is * an instance variable of another object), it is recommended to clear the * pointer to %NULL rather than retain a dangling pointer to a potentially * invalid #GObject instance. Use g_clear_object() for this. */ unref(): void; /** * This function essentially limits the life time of the `closure` to * the life time of the object. That is, when the object is finalized, * the `closure` is invalidated by calling g_closure_invalidate() on * it, in order to prevent invocations of the closure with a finalized * (nonexisting) object. Also, g_object_ref() and g_object_unref() are * added as marshal guards to the `closure,` to ensure that an extra * reference count is held on `object` during invocation of the * `closure`. Usually, this function will be called on closures that * use this `object` as closure data. * @param closure #GClosure to watch */ watch_closure(closure: GObject.Closure): void; /** * the `constructed` function is called by g_object_new() as the * final step of the object creation process. At the point of the call, all * construction properties have been set on the object. The purpose of this * call is to allow for object initialisation steps that can only be performed * after construction properties have been set. `constructed` implementors * should chain up to the `constructed` call of their parent class to allow it * to complete its initialisation. */ vfunc_constructed(): void; /** * emits property change notification for a bunch * of properties. Overriding `dispatch_properties_changed` should be rarely * needed. * @param n_pspecs * @param pspecs */ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; /** * the `dispose` function is supposed to drop all references to other * objects, but keep the instance otherwise intact, so that client method * invocations still work. It may be run multiple times (due to reference * loops). Before returning, `dispose` should chain up to the `dispose` method * of the parent class. */ vfunc_dispose(): void; /** * instance finalization function, should finish the finalization of * the instance begun in `dispose` and chain up to the `finalize` method of the * parent class. */ vfunc_finalize(): void; /** * the generic getter for all properties of this type. Should be * overridden for every type with properties. * @param property_id * @param value * @param pspec */ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Emits a "notify" signal for the property `property_name` on `object`. * * When possible, eg. when signaling a property change from within the class * that registered the property, you should use g_object_notify_by_pspec() * instead. * * Note that emission of the notify signal may be blocked with * g_object_freeze_notify(). In this case, the signal emissions are queued * and will be emitted (in reverse order) when g_object_thaw_notify() is * called. * @param pspec */ vfunc_notify(pspec: GObject.ParamSpec): void; /** * the generic setter for all properties of this type. Should be * overridden for every type with properties. If implementations of * `set_property` don't emit property change notification explicitly, this will * be done implicitly by the type system. However, if the notify signal is * emitted explicitly, the type system will not emit it a second time. * @param property_id * @param value * @param pspec */ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; /** * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. * @param id Handler ID of the handler to be disconnected */ disconnect(id: number): void; /** * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. * @param properties Object containing the properties to set */ set(properties: { [key: string]: any }): void; /** * Blocks a handler of an instance so it will not be called during any signal emissions * @param id Handler ID of the handler to be blocked */ block_signal_handler(id: number): void; /** * Unblocks a handler so it will be called again during any signal emissions * @param id Handler ID of the handler to be unblocked */ unblock_signal_handler(id: number): void; /** * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. * @param detailedName Name of the signal to stop emission of */ stop_emission_by_name(detailedName: string): void; } namespace Builder { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { translation_domain: string; translationDomain: string; } } class Builder extends GObject.Object { static $gtype: GObject.GType; // Properties /** * The translation domain used when translating property values that * have been marked as translatable in interface descriptions. * If the translation domain is %NULL, #GtkBuilder uses gettext(), * otherwise g_dgettext(). */ get translation_domain(): string; set translation_domain(val: string); /** * The translation domain used when translating property values that * have been marked as translatable in interface descriptions. * If the translation domain is %NULL, #GtkBuilder uses gettext(), * otherwise g_dgettext(). */ get translationDomain(): string; set translationDomain(val: string); // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](): Builder; // Virtual methods /** * Looks up a type by name, using the virtual function that * #GtkBuilder has for that purpose. This is mainly used when * implementing the #GtkBuildable interface on a type. * @param type_name type name to lookup */ vfunc_get_type_from_name(type_name: string): GObject.GType; // Methods /** * Parses a file containing a GtkBuilder * UI definition and merges it with the current contents of `builder`. * * Upon errors 0 will be returned and `error` will be assigned a * #GError from the #GTK_BUILDER_ERROR, #G_MARKUP_ERROR or #G_FILE_ERROR * domain. * @param filename the name of the file to parse * @returns A positive value on success, 0 if an error occurred */ add_from_file(filename: string): number; /** * Parses a string containing a GtkBuilder * UI definition and merges it with the current contents of `builder`. * * Upon errors 0 will be returned and `error` will be assigned a * #GError from the #GTK_BUILDER_ERROR or #G_MARKUP_ERROR domain. * @param buffer the string to parse * @param length the length of @buffer (may be -1 if @buffer is nul-terminated) * @returns A positive value on success, 0 if an error occurred */ add_from_string(buffer: string, length: number): number; /** * Parses a file containing a GtkBuilder * UI definition building only the requested objects and merges * them with the current contents of `builder`. * * Upon errors 0 will be returned and `error` will be assigned a * #GError from the #GTK_BUILDER_ERROR, #G_MARKUP_ERROR or #G_FILE_ERROR * domain. * * * If you are adding an object that depends on an object that is not * its child (for instance a #GtkTreeView that depends on its * #GtkTreeModel), you have to explicitely list all of them in `object_ids`. * * @param filename the name of the file to parse * @param object_ids nul-terminated array of objects to build * @returns A positive value on success, 0 if an error occurred */ add_objects_from_file(filename: string, object_ids: string): number; /** * Parses a string containing a GtkBuilder * UI definition building only the requested objects and merges * them with the current contents of `builder`. * * Upon errors 0 will be returned and `error` will be assigned a * #GError from the #GTK_BUILDER_ERROR or #G_MARKUP_ERROR domain. * * * If you are adding an object that depends on an object that is not * its child (for instance a #GtkTreeView that depends on its * #GtkTreeModel), you have to explicitely list all of them in `object_ids`. * * @param buffer the string to parse * @param length the length of @buffer (may be -1 if @buffer is nul-terminated) * @param object_ids nul-terminated array of objects to build * @returns A positive value on success, 0 if an error occurred */ add_objects_from_string(buffer: string, length: number, object_ids: string): number; /** * This method is a simpler variation of gtk_builder_connect_signals_full(). * It uses #GModule's introspective features (by opening the module %NULL) * to look at the application's symbol table. From here it tries to match * the signal handler names given in the interface description with * symbols in the application and connects the signals. * * Note that this function will not work correctly if #GModule is not * supported on the platform. * * When compiling applications for Windows, you must declare signal callbacks * with #G_MODULE_EXPORT, or they will not be put in the symbol table. * On Linux and Unices, this is not necessary; applications should instead * be compiled with the -Wl,--export-dynamic CFLAGS, and linked against * gmodule-export-2.0. * @param user_data a pointer to a structure sent in as user data to all signals */ connect_signals(user_data?: any | null): void; /** * This function can be thought of the interpreted language binding * version of gtk_builder_connect_signals(), except that it does not * require GModule to function correctly. * @param func the function used to connect the signals */ connect_signals_full(func: BuilderConnectFunc): void; /** * Gets the object named `name`. Note that this function does not * increment the reference count of the returned object. * @param name name of object to get * @returns the object named @name or %NULL if it could not be found in the object tree. */ get_object(name: string): T; /** * Gets all objects that have been constructed by `builder`. Note that * this function does not increment the reference counts of the returned * objects. * @returns a newly-allocated #GSList containing all the objects constructed by the #GtkBuilder instance. It should be freed by g_slist_free() */ get_objects(): GObject.Object[]; /** * Gets the translation domain of `builder`. * @returns the translation domain. This string is owned by the builder object and must not be modified or freed. */ get_translation_domain(): string; /** * Looks up a type by name, using the virtual function that * #GtkBuilder has for that purpose. This is mainly used when * implementing the #GtkBuildable interface on a type. * @param type_name type name to lookup * @returns the #GType found for @type_name or #G_TYPE_INVALID if no type was found */ get_type_from_name(type_name: string): GObject.GType; /** * Sets the translation domain of `builder`. * See #GtkBuilder:translation-domain. * @param domain the translation domain or %NULL */ set_translation_domain(domain?: string | null): void; /** * This function demarshals a value from a string. This function * calls g_value_init() on the `value` argument, so it need not be * initialised beforehand. * * This function can handle char, uchar, boolean, int, uint, long, * ulong, enum, flags, float, double, string, #GdkColor and * #GtkAdjustment type values. Support for #GtkWidget type values is * still to come. * * Upon errors %FALSE will be returned and `error` will be assigned a * #GError from the #GTK_BUILDER_ERROR domain. * @param pspec the #GParamSpec for the property * @param string the string representation of the value * @returns %TRUE on success */ value_from_string(pspec: GObject.ParamSpec, string: string): [boolean, unknown]; /** * Like gtk_builder_value_from_string(), this function demarshals * a value from a string, but takes a #GType instead of #GParamSpec. * This function calls g_value_init() on the `value` argument, so it * need not be initialised beforehand. * * Upon errors %FALSE will be returned and `error` will be assigned a * #GError from the #GTK_BUILDER_ERROR domain. * @param type the #GType of the value * @param string the string representation of the value * @returns %TRUE on success */ value_from_string_type(type: GObject.GType, string: string): [boolean, unknown]; } namespace Button { // Signal callback interfaces interface Activate { (): void; } interface Clicked { (): void; } interface Enter { (): void; } interface Leave { (): void; } interface Pressed { (): void; } interface Released { (): void; } // Constructor properties interface interface ConstructorProps extends Bin.ConstructorProps, Atk.ImplementorIface.ConstructorProps, Activatable.ConstructorProps, Buildable.ConstructorProps { focus_on_click: boolean; focusOnClick: boolean; image: Widget; image_position: PositionType; imagePosition: PositionType; label: string; relief: ReliefStyle; use_stock: boolean; useStock: boolean; use_underline: boolean; useUnderline: boolean; xalign: number; yalign: number; } } class Button extends Bin implements Atk.ImplementorIface, Activatable, Buildable { static $gtype: GObject.GType