///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
/**
* 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://GimpUi?version=3.0' {
// Module dependencies
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 Gtk from 'gi://Gtk?version=3.0';
import type xlib from 'gi://xlib?version=2.0';
import type Gdk from 'gi://Gdk?version=3.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
import type Gimp from 'gi://Gimp?version=3.0';
import type Gegl from 'gi://Gegl?version=0.4';
import type Babl from 'gi://Babl?version=0.1';
export namespace GimpUi {
/**
* GimpUi-3.0
*/
/**
* Aspect ratios.
*/
/**
* Aspect ratios.
*/
export namespace AspectType {
export const $gtype: GObject.GType;
}
enum AspectType {
/**
* it's a 1:1 square
*/
SQUARE,
/**
* it's higher than it's wide
*/
PORTRAIT,
/**
* it's wider than it's high
*/
LANDSCAPE,
}
/**
* Possible chain positions for #GimpChainButton.
*/
/**
* Possible chain positions for #GimpChainButton.
*/
export namespace ChainPosition {
export const $gtype: GObject.GType;
}
enum ChainPosition {
/**
* the chain is on top
*/
TOP,
/**
* the chain is to the left
*/
LEFT,
/**
* the chain is on bottom
*/
BOTTOM,
/**
* the chain is to the right
*/
RIGHT,
}
/**
* The types of transparency display for #GimpColorArea.
*/
/**
* The types of transparency display for #GimpColorArea.
*/
export namespace ColorAreaType {
export const $gtype: GObject.GType;
}
enum ColorAreaType {
/**
* don't display transparency
*/
FLAT,
/**
* display transparency using small checks
*/
SMALL_CHECKS,
/**
* display transparency using large checks
*/
LARGE_CHECKS,
}
/**
* An enum to specify the types of color channels edited in
* #GimpColorSelector widgets.
*/
/**
* An enum to specify the types of color channels edited in
* #GimpColorSelector widgets.
*/
export namespace ColorSelectorChannel {
export const $gtype: GObject.GType;
}
enum ColorSelectorChannel {
/**
* the hue channel
*/
HUE,
/**
* the saturation channel
*/
SATURATION,
/**
* the value channel
*/
VALUE,
/**
* the red channel
*/
RED,
/**
* the green channel
*/
GREEN,
/**
* the blue channel
*/
BLUE,
/**
* the alpha channel
*/
ALPHA,
/**
* the lightness channel
*/
LCH_LIGHTNESS,
/**
* the chroma channel
*/
LCH_CHROMA,
/**
* the hue channel
*/
LCH_HUE,
}
/**
* An enum to specify the types of color spaces edited in
* #GimpColorSelector widgets.
*/
/**
* An enum to specify the types of color spaces edited in
* #GimpColorSelector widgets.
*/
export namespace ColorSelectorModel {
export const $gtype: GObject.GType;
}
enum ColorSelectorModel {
/**
* RGB color model
*/
RGB,
/**
* CIE LCh color model
*/
LCH,
/**
* HSV color model
*/
HSV,
}
/**
* Possible layouts for #GimpIntComboBox.
*/
/**
* Possible layouts for #GimpIntComboBox.
*/
export namespace IntComboBoxLayout {
export const $gtype: GObject.GType;
}
enum IntComboBoxLayout {
/**
* show icons only
*/
ICON_ONLY,
/**
* show icons and abbreviated labels,
* when available
*/
ABBREVIATED,
/**
* show icons and full labels
*/
FULL,
}
/**
* The column types of #GimpIntStore.
*/
/**
* The column types of #GimpIntStore.
*/
export namespace IntStoreColumns {
export const $gtype: GObject.GType;
}
enum IntStoreColumns {
/**
* the integer value
*/
VALUE,
/**
* a human-readable label
*/
LABEL,
/**
* an abbreviated label
*/
ABBREV,
/**
* an icon name
*/
ICON_NAME,
/**
* a #GdkPixbuf
*/
PIXBUF,
/**
* arbitrary user data
*/
USER_DATA,
/**
* the number of columns
*/
NUM_COLUMNS,
}
/**
* Import targets for #GimpPageSelector.
*/
/**
* Import targets for #GimpPageSelector.
*/
export namespace PageSelectorTarget {
export const $gtype: GObject.GType;
}
enum PageSelectorTarget {
/**
* import as layers of one image
*/
LAYERS,
/**
* import as separate images
*/
IMAGES,
}
/**
* Update policies for #GimpSizeEntry.
*/
/**
* Update policies for #GimpSizeEntry.
*/
export namespace SizeEntryUpdatePolicy {
export const $gtype: GObject.GType;
}
enum SizeEntryUpdatePolicy {
/**
* the size entry's meaning is up to the user
*/
NONE,
/**
* the size entry displays values
*/
SIZE,
/**
* the size entry displays resolutions
*/
RESOLUTION,
}
/**
* Types of errors returned by libgimpwidgets functions
*/
class WidgetsError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* A parse error has occurred
*/
static WIDGETS_PARSE_ERROR: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
}
/**
* the zoom types for #GimpZoomModel.
*/
/**
* the zoom types for #GimpZoomModel.
*/
export namespace ZoomType {
export const $gtype: GObject.GType;
}
enum ZoomType {
/**
* zoom in
*/
IN,
/**
* zoom out
*/
OUT,
}
/**
* The suggested width for a color bar in a #GimpColorSelector
* implementation.
*/
const COLOR_SELECTOR_BAR_SIZE: number;
/**
* The suggested size for a color area in a #GimpColorSelector
* implementation.
*/
const COLOR_SELECTOR_SIZE: number;
const ICON_APPLICATION_EXIT: string;
const ICON_ASPECT_LANDSCAPE: string;
const ICON_ASPECT_PORTRAIT: string;
const ICON_ATTACH: string;
const ICON_BUSINESS_CARD: string;
const ICON_CAP_BUTT: string;
const ICON_CAP_ROUND: string;
const ICON_CAP_SQUARE: string;
const ICON_CENTER: string;
const ICON_CENTER_HORIZONTAL: string;
const ICON_CENTER_VERTICAL: string;
const ICON_CHAIN_HORIZONTAL: string;
const ICON_CHAIN_HORIZONTAL_BROKEN: string;
const ICON_CHAIN_VERTICAL: string;
const ICON_CHAIN_VERTICAL_BROKEN: string;
const ICON_CHANNEL: string;
const ICON_CHANNEL_ALPHA: string;
const ICON_CHANNEL_BLUE: string;
const ICON_CHANNEL_GRAY: string;
const ICON_CHANNEL_GREEN: string;
const ICON_CHANNEL_INDEXED: string;
const ICON_CHANNEL_RED: string;
const ICON_CHAR_PICKER: string;
const ICON_CLOSE: string;
const ICON_CLOSE_ALL: string;
const ICON_COLORMAP: string;
const ICON_COLORS_DEFAULT: string;
const ICON_COLORS_SWAP: string;
const ICON_COLOR_PICKER_BLACK: string;
const ICON_COLOR_PICKER_GRAY: string;
const ICON_COLOR_PICKER_WHITE: string;
const ICON_COLOR_PICK_FROM_SCREEN: string;
const ICON_COLOR_SELECTOR_CMYK: string;
const ICON_COLOR_SELECTOR_TRIANGLE: string;
const ICON_COLOR_SELECTOR_WATER: string;
const ICON_COLOR_SPACE_LINEAR: string;
const ICON_COLOR_SPACE_NON_LINEAR: string;
const ICON_COLOR_SPACE_PERCEPTUAL: string;
const ICON_CONTROLLER: string;
const ICON_CONTROLLER_KEYBOARD: string;
const ICON_CONTROLLER_LINUX_INPUT: string;
const ICON_CONTROLLER_MIDI: string;
const ICON_CONTROLLER_WHEEL: string;
const ICON_CONVERT_GRAYSCALE: string;
const ICON_CONVERT_INDEXED: string;
const ICON_CONVERT_RGB: string;
const ICON_CURSOR: string;
const ICON_CURVE_FREE: string;
const ICON_CURVE_SMOOTH: string;
const ICON_DETACH: string;
const ICON_DIALOG_CHANNELS: string;
const ICON_DIALOG_DASHBOARD: string;
const ICON_DIALOG_DEVICE_STATUS: string;
const ICON_DIALOG_ERROR: string;
const ICON_DIALOG_IMAGES: string;
const ICON_DIALOG_INFORMATION: string;
const ICON_DIALOG_LAYERS: string;
const ICON_DIALOG_NAVIGATION: string;
const ICON_DIALOG_PATHS: string;
const ICON_DIALOG_QUESTION: string;
const ICON_DIALOG_RESHOW_FILTER: string;
const ICON_DIALOG_TOOLS: string;
const ICON_DIALOG_TOOL_OPTIONS: string;
const ICON_DIALOG_UNDO_HISTORY: string;
const ICON_DIALOG_WARNING: string;
const ICON_DISPLAY: string;
const ICON_DISPLAY_FILTER: string;
const ICON_DISPLAY_FILTER_CLIP_WARNING: string;
const ICON_DISPLAY_FILTER_COLORBLIND: string;
const ICON_DISPLAY_FILTER_CONTRAST: string;
const ICON_DISPLAY_FILTER_GAMMA: string;
const ICON_DISPLAY_FILTER_LCMS: string;
const ICON_DISPLAY_FILTER_PROOF: string;
const ICON_DOCUMENT_NEW: string;
const ICON_DOCUMENT_OPEN: string;
const ICON_DOCUMENT_OPEN_RECENT: string;
const ICON_DOCUMENT_PAGE_SETUP: string;
const ICON_DOCUMENT_PRINT: string;
const ICON_DOCUMENT_PRINT_RESOLUTION: string;
const ICON_DOCUMENT_PROPERTIES: string;
const ICON_DOCUMENT_REVERT: string;
const ICON_DOCUMENT_SAVE: string;
const ICON_DOCUMENT_SAVE_AS: string;
const ICON_DYNAMICS: string;
const ICON_EDIT: string;
const ICON_EDIT_CLEAR: string;
const ICON_EDIT_COPY: string;
const ICON_EDIT_CUT: string;
const ICON_EDIT_DELETE: string;
const ICON_EDIT_FIND: string;
const ICON_EDIT_PASTE: string;
const ICON_EDIT_PASTE_AS_NEW: string;
const ICON_EDIT_PASTE_INTO: string;
const ICON_EDIT_REDO: string;
const ICON_EDIT_UNDO: string;
const ICON_EFFECT: string;
const ICON_EVEN_HORIZONTAL_GAP: string;
const ICON_EVEN_VERTICAL_GAP: string;
const ICON_FILE_MANAGER: string;
const ICON_FILL_HORIZONTAL: string;
const ICON_FILL_VERTICAL: string;
const ICON_FOLDER_NEW: string;
const ICON_FONT: string;
const ICON_FORMAT_INDENT_LESS: string;
const ICON_FORMAT_INDENT_MORE: string;
const ICON_FORMAT_JUSTIFY_CENTER: string;
const ICON_FORMAT_JUSTIFY_FILL: string;
const ICON_FORMAT_JUSTIFY_LEFT: string;
const ICON_FORMAT_JUSTIFY_RIGHT: string;
const ICON_FORMAT_TEXT_BOLD: string;
const ICON_FORMAT_TEXT_DIRECTION_LTR: string;
const ICON_FORMAT_TEXT_DIRECTION_RTL: string;
const ICON_FORMAT_TEXT_DIRECTION_TTB_LTR: string;
const ICON_FORMAT_TEXT_DIRECTION_TTB_LTR_UPRIGHT: string;
const ICON_FORMAT_TEXT_DIRECTION_TTB_RTL: string;
const ICON_FORMAT_TEXT_DIRECTION_TTB_RTL_UPRIGHT: string;
const ICON_FORMAT_TEXT_ITALIC: string;
const ICON_FORMAT_TEXT_SPACING_LETTER: string;
const ICON_FORMAT_TEXT_SPACING_LINE: string;
const ICON_FORMAT_TEXT_STRIKETHROUGH: string;
const ICON_FORMAT_TEXT_UNDERLINE: string;
const ICON_FRAME: string;
const ICON_GEGL: string;
const ICON_GO_BOTTOM: string;
const ICON_GO_DOWN: string;
const ICON_GO_FIRST: string;
const ICON_GO_HOME: string;
const ICON_GO_LAST: string;
const ICON_GO_NEXT: string;
const ICON_GO_PREVIOUS: string;
const ICON_GO_TOP: string;
const ICON_GO_UP: string;
const ICON_GRADIENT_BILINEAR: string;
const ICON_GRADIENT_CONICAL_ASYMMETRIC: string;
const ICON_GRADIENT_CONICAL_SYMMETRIC: string;
const ICON_GRADIENT_LINEAR: string;
const ICON_GRADIENT_RADIAL: string;
const ICON_GRADIENT_SHAPEBURST_ANGULAR: string;
const ICON_GRADIENT_SHAPEBURST_DIMPLED: string;
const ICON_GRADIENT_SHAPEBURST_SPHERICAL: string;
const ICON_GRADIENT_SPIRAL_ANTICLOCKWISE: string;
const ICON_GRADIENT_SPIRAL_CLOCKWISE: string;
const ICON_GRADIENT_SQUARE: string;
const ICON_GRAVITY_EAST: string;
const ICON_GRAVITY_NORTH: string;
const ICON_GRAVITY_NORTH_EAST: string;
const ICON_GRAVITY_NORTH_WEST: string;
const ICON_GRAVITY_SOUTH: string;
const ICON_GRAVITY_SOUTH_EAST: string;
const ICON_GRAVITY_SOUTH_WEST: string;
const ICON_GRAVITY_WEST: string;
const ICON_GRID: string;
const ICON_HELP: string;
const ICON_HELP_ABOUT: string;
const ICON_HELP_USER_MANUAL: string;
const ICON_HISTOGRAM: string;
const ICON_HISTOGRAM_LINEAR: string;
const ICON_HISTOGRAM_LOGARITHMIC: string;
const ICON_IMAGE: string;
const ICON_IMAGE_OPEN: string;
const ICON_IMAGE_RELOAD: string;
const ICON_INPUT_DEVICE: string;
const ICON_INVERT: string;
const ICON_JOIN_BEVEL: string;
const ICON_JOIN_MITER: string;
const ICON_JOIN_ROUND: string;
const ICON_LAYER: string;
const ICON_LAYER_ANCHOR: string;
const ICON_LAYER_FLOATING_SELECTION: string;
const ICON_LAYER_MASK: string;
const ICON_LAYER_MERGE_DOWN: string;
const ICON_LAYER_TEXT_LAYER: string;
const ICON_LAYER_TO_IMAGESIZE: string;
const ICON_LINKED: string;
const ICON_LIST: string;
const ICON_LIST_ADD: string;
const ICON_LIST_REMOVE: string;
const ICON_LOCK: string;
const ICON_LOCK_ALPHA: string;
const ICON_LOCK_CONTENT: string;
const ICON_LOCK_MULTI: string;
const ICON_LOCK_PATH: string;
const ICON_LOCK_POSITION: string;
const ICON_LOCK_VISIBILITY: string;
const ICON_MARKER: string;
const ICON_MENU_LEFT: string;
const ICON_MENU_RIGHT: string;
const ICON_OBJECT_DUPLICATE: string;
const ICON_OBJECT_FLIP_HORIZONTAL: string;
const ICON_OBJECT_FLIP_VERTICAL: string;
const ICON_OBJECT_RESIZE: string;
const ICON_OBJECT_ROTATE_180: string;
const ICON_OBJECT_ROTATE_270: string;
const ICON_OBJECT_ROTATE_90: string;
const ICON_OBJECT_SCALE: string;
const ICON_PALETTE: string;
const ICON_PATH: string;
const ICON_PATH_STROKE: string;
const ICON_PATTERN: string;
const ICON_PIVOT_CENTER: string;
const ICON_PIVOT_EAST: string;
const ICON_PIVOT_NORTH: string;
const ICON_PIVOT_NORTH_EAST: string;
const ICON_PIVOT_NORTH_WEST: string;
const ICON_PIVOT_SOUTH: string;
const ICON_PIVOT_SOUTH_EAST: string;
const ICON_PIVOT_SOUTH_WEST: string;
const ICON_PIVOT_WEST: string;
const ICON_PLUGIN: string;
const ICON_PREFERENCES_SYSTEM: string;
const ICON_PROCESS_STOP: string;
const ICON_QUICK_MASK_OFF: string;
const ICON_QUICK_MASK_ON: string;
const ICON_RECORD: string;
const ICON_RESET: string;
const ICON_SAMPLE_POINT: string;
const ICON_SELECTION: string;
const ICON_SELECTION_ADD: string;
const ICON_SELECTION_ALL: string;
const ICON_SELECTION_BORDER: string;
const ICON_SELECTION_GROW: string;
const ICON_SELECTION_INTERSECT: string;
const ICON_SELECTION_NONE: string;
const ICON_SELECTION_REPLACE: string;
const ICON_SELECTION_SHRINK: string;
const ICON_SELECTION_STROKE: string;
const ICON_SELECTION_SUBTRACT: string;
const ICON_SELECTION_TO_CHANNEL: string;
const ICON_SELECTION_TO_PATH: string;
const ICON_SHAPE_CIRCLE: string;
const ICON_SHAPE_DIAMOND: string;
const ICON_SHAPE_SQUARE: string;
const ICON_SHRED: string;
const ICON_SMARTPHONE: string;
const ICON_SYMMETRY: string;
const ICON_SYSTEM_RUN: string;
const ICON_TEMPLATE: string;
const ICON_TEXTURE: string;
const ICON_TOOL_AIRBRUSH: string;
const ICON_TOOL_ALIGN: string;
const ICON_TOOL_BLUR: string;
const ICON_TOOL_BRIGHTNESS_CONTRAST: string;
const ICON_TOOL_BUCKET_FILL: string;
const ICON_TOOL_BY_COLOR_SELECT: string;
const ICON_TOOL_CAGE: string;
const ICON_TOOL_CLONE: string;
const ICON_TOOL_COLORIZE: string;
const ICON_TOOL_COLOR_BALANCE: string;
const ICON_TOOL_COLOR_PICKER: string;
const ICON_TOOL_COLOR_TEMPERATURE: string;
const ICON_TOOL_CROP: string;
const ICON_TOOL_CURVES: string;
const ICON_TOOL_DESATURATE: string;
const ICON_TOOL_DODGE: string;
const ICON_TOOL_ELLIPSE_SELECT: string;
const ICON_TOOL_ERASER: string;
const ICON_TOOL_EXPOSURE: string;
const ICON_TOOL_FLIP: string;
const ICON_TOOL_FOREGROUND_SELECT: string;
const ICON_TOOL_FREE_SELECT: string;
const ICON_TOOL_FUZZY_SELECT: string;
const ICON_TOOL_GRADIENT: string;
const ICON_TOOL_HANDLE_TRANSFORM: string;
const ICON_TOOL_HEAL: string;
const ICON_TOOL_HUE_SATURATION: string;
const ICON_TOOL_INK: string;
const ICON_TOOL_ISCISSORS: string;
const ICON_TOOL_LEVELS: string;
const ICON_TOOL_MEASURE: string;
const ICON_TOOL_MOVE: string;
const ICON_TOOL_MYPAINT_BRUSH: string;
const ICON_TOOL_N_POINT_DEFORMATION: string;
const ICON_TOOL_OFFSET: string;
const ICON_TOOL_PAINTBRUSH: string;
const ICON_TOOL_PAINT_SELECT: string;
const ICON_TOOL_PATH: string;
const ICON_TOOL_PENCIL: string;
const ICON_TOOL_PERSPECTIVE: string;
const ICON_TOOL_PERSPECTIVE_CLONE: string;
const ICON_TOOL_POSTERIZE: string;
const ICON_TOOL_PRESET: string;
const ICON_TOOL_RECT_SELECT: string;
const ICON_TOOL_ROTATE: string;
const ICON_TOOL_SCALE: string;
const ICON_TOOL_SEAMLESS_CLONE: string;
const ICON_TOOL_SHADOWS_HIGHLIGHTS: string;
const ICON_TOOL_SHEAR: string;
const ICON_TOOL_SMUDGE: string;
const ICON_TOOL_TEXT: string;
const ICON_TOOL_THRESHOLD: string;
const ICON_TOOL_TRANSFORM_3D: string;
const ICON_TOOL_UNIFIED_TRANSFORM: string;
const ICON_TOOL_WARP: string;
const ICON_TOOL_ZOOM: string;
const ICON_TRANSFORM_3D_CAMERA: string;
const ICON_TRANSFORM_3D_MOVE: string;
const ICON_TRANSFORM_3D_ROTATE: string;
const ICON_TRANSPARENCY: string;
const ICON_VIDEO: string;
const ICON_VIEW_FULLSCREEN: string;
const ICON_VIEW_REFRESH: string;
const ICON_VIEW_SHRINK_WRAP: string;
const ICON_VIEW_ZOOM_FILL: string;
const ICON_VISIBLE: string;
const ICON_WEB: string;
const ICON_WILBER: string;
const ICON_WILBER_EEK: string;
const ICON_WINDOW_CLOSE: string;
const ICON_WINDOW_MOVE_TO_SCREEN: string;
const ICON_WINDOW_NEW: string;
const ICON_ZOOM_FIT_BEST: string;
const ICON_ZOOM_FOLLOW_WINDOW: string;
const ICON_ZOOM_IN: string;
const ICON_ZOOM_ORIGINAL: string;
const ICON_ZOOM_OUT: string;
/**
* Sets color and dash pattern for stroking a focus line on the given
* `cr`. The line pattern is taken from `widget`.
* @param cr Cairo context
* @param widget widget to draw the focus indicator on
* @returns %TRUE if the widget style has a focus line pattern, %FALSE otherwise
*/
function cairo_set_focus_line_pattern(cr: cairo.Context, widget: Gtk.Widget): boolean;
/**
* Sets `color` as the source pattern within `cr,` taking into account the profile
* of the [class`Gdk`.Monitor] which `widget` is displayed on.
*
* If `config` is set, the color configuration as set by the user will be used,
* in particular using any custom monitor profile set in preferences (overriding
* system-set profile). If no such custom profile is set, it will use the
* profile of the monitor `widget` is displayed on and will default to sRGB if
* `widget` is %NULL.
*
* Use [func`Gimp`.get_color_configuration] to retrieve the user
* [class`Gimp`.ColorConfig].
*
* TODO: `softproof` is currently unused.
* @param cr Cairo context.
* @param color the [class@Gegl.Color] to use as source pattern within @cr.
* @param config the color management settings.
* @param softproof whether the color must also be soft-proofed.
* @param widget [class@Gtk.Widget] to draw the focus indicator on.
*/
function cairo_set_source_color(
cr: cairo.Context,
color: Gegl.Color,
config: Gimp.ColorConfig,
softproof: boolean,
widget?: Gtk.Widget | null,
): void;
/**
* Create a Cairo image surface from a GdkPixbuf.
*
* You should avoid calling this function as there are probably more
* efficient ways of achieving the result you are looking for.
* @param pixbuf a #GdkPixbuf
* @returns a #cairo_surface_t.
*/
function cairo_surface_create_from_pixbuf(pixbuf: GdkPixbuf.Pixbuf): cairo.Surface;
/**
* This function invokes the context help inspector.
*
* The mouse cursor will turn turn into a question mark and the user can
* click on any widget of the application which started the inspector.
*
* If the widget the user clicked on has a `help_id` string attached
* (see gimp_help_set_help_data()), the corresponding help page will
* be displayed. Otherwise the help system will ascend the widget hierarchy
* until it finds an attached `help_id` string (which should be the
* case at least for every window/dialog).
* @param widget Any #GtkWidget on the screen.
*/
function context_help(widget: Gtk.Widget): void;
/**
* Convenience function that creates a #GimpSizeEntry with two fields for x/y
* coordinates/sizes with a #GimpChainButton attached to constrain either the
* two fields' values or the ratio between them.
* @param unit The initial unit of the #GimpUnitMenu.
* @param unit_format A printf-like unit-format string as is used with gimp_unit_menu_new().
* @param menu_show_pixels %TRUE if the #GimpUnitMenu should contain an item for GIMP_UNIT_PIXEL.
* @param menu_show_percent %TRUE if the #GimpUnitMenu should contain an item for GIMP_UNIT_PERCENT.
* @param spinbutton_width The horizontal size of the #GimpSizeEntry's #GtkSpinButton's.
* @param update_policy The update policy for the #GimpSizeEntry.
* @param chainbutton_active %TRUE if the attached #GimpChainButton should be active.
* @param chain_constrains_ratio %TRUE if the chainbutton should constrain the fields' aspect ratio. If %FALSE, the values will be constrained.
* @param xlabel The label for the X coordinate.
* @param x The initial value of the X coordinate.
* @param xres The horizontal resolution in DPI.
* @param lower_boundary_x The lower boundary of the X coordinate.
* @param upper_boundary_x The upper boundary of the X coordinate.
* @param xsize_0 The X value which will be treated as 0%.
* @param xsize_100 The X value which will be treated as 100%.
* @param ylabel The label for the Y coordinate.
* @param y The initial value of the Y coordinate.
* @param yres The vertical resolution in DPI.
* @param lower_boundary_y The lower boundary of the Y coordinate.
* @param upper_boundary_y The upper boundary of the Y coordinate.
* @param ysize_0 The Y value which will be treated as 0%.
* @param ysize_100 The Y value which will be treated as 100%.
* @returns The new #GimpSizeEntry.
*/
function coordinates_new(
unit: Gimp.Unit,
unit_format: string,
menu_show_pixels: boolean,
menu_show_percent: boolean,
spinbutton_width: number,
update_policy: SizeEntryUpdatePolicy | null,
chainbutton_active: boolean,
chain_constrains_ratio: boolean,
xlabel: string,
x: number,
xres: number,
lower_boundary_x: number,
upper_boundary_x: number,
xsize_0: number,
xsize_100: number,
ylabel: string,
y: number,
yres: number,
lower_boundary_y: number,
upper_boundary_y: number,
ysize_0: number,
ysize_100: number,
): Gtk.Widget;
function double_adjustment_update(adjustment: Gtk.Adjustment): number;
/**
* Creates a horizontal box of radio buttons with named icons. The
* icon name for each icon is created by appending the enum_value's
* nick to the given `icon_prefix`.
* @param enum_type the #GType of an enum.
* @param icon_prefix the prefix of the group of icon names to use.
* @param icon_size the icon size for the icons
* @param callback a callback to connect to the "toggled" signal of each #GtkRadioButton that is created.
* @returns a new horizontal #GtkBox holding a group of #GtkRadioButtons.
*/
function enum_icon_box_new(
enum_type: GObject.GType,
icon_prefix: string,
icon_size: Gtk.IconSize | null,
callback?: GObject.Callback | null,
): [Gtk.Widget, Gtk.Widget | null];
/**
* Just like gimp_enum_icon_box_new(), this function creates a group
* of radio buttons, but additionally it supports limiting the range
* of available enum values.
* @param enum_type the #GType of an enum.
* @param minimum the minumim enum value
* @param maximum the maximum enum value
* @param icon_prefix the prefix of the group of icon names to use.
* @param icon_size the icon size for the icons
* @param callback a callback to connect to the "toggled" signal of each #GtkRadioButton that is created.
* @returns a new horizontal #GtkBox holding a group of #GtkRadioButtons.
*/
function enum_icon_box_new_with_range(
enum_type: GObject.GType,
minimum: number,
maximum: number,
icon_prefix: string,
icon_size: Gtk.IconSize | null,
callback?: GObject.Callback | null,
): [Gtk.Widget, Gtk.Widget | null];
/**
* Sets the padding of all buttons in a box created by
* gimp_enum_icon_box_new().
* @param icon_box an icon box widget
* @param xpad horizontal padding
* @param ypad vertical padding
*/
function enum_icon_box_set_child_padding(icon_box: Gtk.Widget, xpad: number, ypad: number): void;
/**
* Sets the icon size of all buttons in a box created by
* gimp_enum_icon_box_new().
* @param icon_box an icon box widget
* @param icon_size the #GtkIconSize enum
*/
function enum_icon_box_set_icon_size(icon_box: Gtk.Widget, icon_size: Gtk.IconSize | null): void;
/**
* Creates a new group of #GtkRadioButtons representing the enum
* values. A group of radiobuttons is a good way to represent enums
* with up to three or four values. Often it is better to use a
* #GimpEnumComboBox instead.
* @param enum_type the #GType of an enum.
* @param callback a callback to connect to the "toggled" signal of each #GtkRadioButton that is created.
* @returns a new #GtkBox holding a group of #GtkRadioButtons.
*/
function enum_radio_box_new(
enum_type: GObject.GType,
callback?: GObject.Callback | null,
): [Gtk.Widget, Gtk.Widget | null];
/**
* Just like gimp_enum_radio_box_new(), this function creates a group
* of radio buttons, but additionally it supports limiting the range
* of available enum values.
* @param enum_type the #GType of an enum.
* @param minimum the minimum enum value
* @param maximum the maximum enum value
* @param callback a callback to connect to the "toggled" signal of each #GtkRadioButton that is created.
* @returns a new vertical #GtkBox holding a group of #GtkRadioButtons
*/
function enum_radio_box_new_with_range(
enum_type: GObject.GType,
minimum: number,
maximum: number,
callback?: GObject.Callback | null,
): [Gtk.Widget, Gtk.Widget | null];
/**
* Calls gimp_enum_radio_box_new() and puts the resulting vbox into a
* #GtkFrame.
* @param enum_type the #GType of an enum.
* @param label_widget a #GtkWidget to use as label for the frame that will hold the radio box.
* @param callback a callback to connect to the "toggled" signal of each #GtkRadioButton that is created.
* @returns a new #GtkFrame holding a group of #GtkRadioButtons.
*/
function enum_radio_frame_new(
enum_type: GObject.GType,
label_widget?: Gtk.Widget | null,
callback?: GObject.Callback | null,
): [Gtk.Widget, Gtk.Widget | null];
/**
* Calls gimp_enum_radio_box_new_with_range() and puts the resulting
* vertical box into a #GtkFrame.
* @param enum_type the #GType of an enum.
* @param minimum the minimum enum value
* @param maximum the maximum enum value
* @param label_widget a widget to put into the frame that will hold the radio box.
* @param callback a callback to connect to the "toggled" signal of each #GtkRadioButton that is created.
* @returns a new #GtkFrame holding a group of #GtkRadioButtons.
*/
function enum_radio_frame_new_with_range(
enum_type: GObject.GType,
minimum: number,
maximum: number,
label_widget?: Gtk.Widget | null,
callback?: GObject.Callback | null,
): [Gtk.Widget, Gtk.Widget | null];
/**
* Alternative of gdk_event_triggers_context_menu() with the additional
* feature of allowing a menu triggering to happen on a button release
* event. All the other rules on whether `event` should trigger a
* contextual menu are exactly the same. Only the swapping to release
* state as additional feature is different.
* @param event The #GdkEvent to verify.
* @param on_release Whether a menu is triggered on a button release event instead of a press event.
* @returns %TRUE if the event should trigger a context menu.
*/
function event_triggers_context_menu(event: Gdk.Event, on_release: boolean): boolean;
function float_adjustment_update(adjustment: Gtk.Adjustment): number;
function get_monitor_at_pointer(): Gdk.Monitor;
/**
* Note that the `label_text` can be %NULL and that the widget will be
* attached starting at (`column` + 1) in this case, too.
* @param grid The #GtkGrid the widgets will be attached to.
* @param left The column to start with.
* @param top The row to attach the widgets.
* @param label_text The text for the #GtkLabel which will be attached left of the widget.
* @param label_xalign The horizontal alignment of the #GtkLabel.
* @param label_yalign The vertical alignment of the #GtkLabel.
* @param widget The #GtkWidget to attach right of the label.
* @param widget_columns The number of columns the widget will use.
* @returns The created #GtkLabel.
*/
function grid_attach_aligned(
grid: Gtk.Grid,
left: number,
top: number,
label_text: string,
label_xalign: number,
label_yalign: number,
widget: Gtk.Widget,
widget_columns: number,
): Gtk.Widget;
/**
* Note that this function is automatically called by all libgimp dialog
* constructors. You only have to call it for windows/dialogs you created
* "manually".
*
* Most of the time, what you want to call for non-windows widgets is
* simply [func`GimpUi`.help_set_help_data]. Yet if you need to set up an
* `help_func,` call `gimp_help_connect` instead. Note that `gimp_help_set_help_data`
* is implied, so you don't have to call it too.
* @param widget The widget you want to connect the help accelerator for. Will be a #GtkWindow in most cases.
* @param tooltip The text for this widget's tooltip. For windows, you usually want to set %NULL.
* @param help_func The function which will be called if the user presses "F1".
* @param help_id The @help_id which will be passed to @help_func.
*/
function help_connect(widget: Gtk.Widget, tooltip: string | null, help_func: HelpFunc, help_id: string): void;
/**
* This function returns the #GQuark which should be used as key when
* attaching help IDs to widgets and objects.
* @returns The #GQuark.
*/
function help_id_quark(): GLib.Quark;
/**
* The reason why we don't use gtk_widget_set_tooltip_text() is that
* elements in the GIMP user interface should, if possible, also have
* a `help_id` set for context-sensitive help.
*
* This function can be called with %NULL for `tooltip`. Use this feature
* if you want to set a help link for a widget which shouldn't have
* a visible tooltip.
* @param widget The #GtkWidget you want to set a @tooltip and/or @help_id for.
* @param tooltip The text for this widget's tooltip (or %NULL).
* @param help_id The @help_id for the #GtkTipsQuery tooltips inspector.
*/
function help_set_help_data(widget: Gtk.Widget, tooltip: string | null, help_id: string): void;
/**
* Just like gimp_help_set_help_data(), but supports to pass text
* which is marked up with Pango
* text markup language.
* @param widget The #GtkWidget you want to set a @tooltip and/or @help_id for.
* @param tooltip The markup for this widget's tooltip (or %NULL).
* @param help_id The @help_id for the #GtkTipsQuery tooltips inspector.
*/
function help_set_help_data_with_markup(widget: Gtk.Widget, tooltip: string, help_id: string): void;
/**
* Initializes the GIMP stock icon factory.
*
* You don't need to call this function as gimp_ui_init() already does
* this for you.
*/
function icons_init(): void;
function icons_set_icon_theme(path: Gio.File): boolean;
/**
* This function initializes GTK+ with gtk_init().
* It also initializes Gegl and Babl.
*
* It also sets up various other things so that the plug-in user looks
* and behaves like the GIMP core. This includes selecting the GTK+
* theme and setting up the help system as chosen in the GIMP
* preferences. Any plug-in that provides a user interface should call
* this function.
*
* It can safely be called more than once.
* Calls after the first return quickly with no effect.
* @param prog_name The name of the plug-in which will be passed as argv[0] to gtk_init(). It's a convention to use the name of the executable and _not_ the PDB procedure name.
*/
function init(prog_name: string): void;
/**
* Note that the #GtkAdjustment's value (which is a #gdouble) will be
* rounded with RINT().
* @param adjustment A #GtkAdjustment.
*/
function int_adjustment_update(adjustment: Gtk.Adjustment): number;
/**
* Calls gtk_toggle_button_set_active() with the radio button that was created
* with a matching `item_data`. This function does the same thing as
* gimp_radio_group_set_active(), but takes integers as `item_data` instead
* of pointers.
* @param radio_button Pointer to a #GtkRadioButton.
* @param item_data The @item_data of the radio button you want to select.
*/
function int_radio_group_set_active(radio_button: Gtk.RadioButton, item_data: number): void;
/**
* This function returns the #GimpColorProfile of `monitor`
* or %NULL if there is no profile configured.
* @param monitor a #GdkMonitor
* @returns the monitor's #GimpColorProfile, or %NULL.
*/
function monitor_get_color_profile(monitor: Gdk.Monitor): Gimp.ColorProfile | null;
function proc_view_new(procedure_name: string): Gtk.Widget;
/**
* Creates a #GtkComboBox widget to display and set the specified
* boolean property. The combo box will have two entries, one
* displaying the `true_text` label, the other displaying the
* `false_text` label.
* @param config Object to which property is attached.
* @param property_name Name of boolean property controlled by combo box.
* @param true_text Label used for entry corresponding to %TRUE value.
* @param false_text Label used for entry corresponding to %FALSE value.
* @returns The newly created #GtkComboBox widget.
*/
function prop_boolean_combo_box_new(
config: GObject.Object,
property_name: string,
true_text: string,
false_text: string,
): Gtk.Widget;
/**
* Creates a pair of radio buttons which function to set and display
* the specified boolean property.
* If `title` is %NULL, the `property_name'`s nick will be used as label
* of the returned frame.
* @param config Object to which property is attached.
* @param property_name Name of boolean property controlled by the radio buttons.
* @param title Label for the frame.
* @param true_text Label for the button corresponding to %TRUE.
* @param false_text Label for the button corresponding to %FALSE.
* @returns A #GimpFrame containing the radio buttons.
*/
function prop_boolean_radio_frame_new(
config: GObject.Object,
property_name: string,
title: string | null,
true_text: string,
false_text: string,
): Gtk.Widget;
/**
* Creates a [class`GimpUi`.BrushChooser] controlled by the specified property.
* @param config Object to which property is attached.
* @param property_name Name of a [class@Gimp.Brush] property.
* @param chooser_title title for the poppable dialog.
* @returns A new [class@GimpUi.BrushChooser].
*/
function prop_brush_chooser_new(
config: GObject.Object,
property_name: string,
chooser_title?: string | null,
): Gtk.Widget;
/**
* Creates a #GtkCheckButton that displays and sets the specified
* boolean property.
* If `label` is %NULL, the `property_name'`s nick will be used as label
* of the returned button.
* @param config Object to which property is attached.
* @param property_name Name of boolean property controlled by checkbutton.
* @param label Label to give checkbutton (including mnemonic).
* @returns The newly created #GtkCheckButton widget.
*/
function prop_check_button_new(
config: GObject.Object,
property_name: string,
label?: string | null,
): Gtk.Widget;
/**
* Creates a #GimpStringComboBox widget to display and set the
* specified property.
* @param config Object to which property is attached.
* @param property_name Name of %GimpChoice property controlled by combo box.
* @returns The newly created #GimpStringComboBox widget.
*/
function prop_choice_combo_box_new(config: GObject.Object, property_name: string): Gtk.Widget;
/**
* Creates a [class`GimpUi`.IntRadioFrame] widget to display and set the
* specified [class`Gimp`.Choice] property.
* @param config Object to which property is attached.
* @param property_name Name of %GimpChoice property controlled by radio buttons.
* @returns The newly created #GimpIntRadioFrame widget.
*/
function prop_choice_radio_frame_new(config: GObject.Object, property_name: string): Gtk.Widget;
/**
* Creates a #GimpColorArea to set and display the value of an RGB
* property.
* @param config Object to which property is attached.
* @param property_name Name of %GeglColor property.
* @param width Width of color area.
* @param height Height of color area.
* @param type How transparency is represented.
* @returns A new #GimpColorArea widget.
*/
function prop_color_area_new(
config: GObject.Object,
property_name: string,
width: number,
height: number,
type: ColorAreaType | null,
): Gtk.Widget;
/**
* Creates a #GimpColorButton to set and display the value of a color
* property.
* @param config Object to which property is attached.
* @param property_name Name of [class@Gegl.Color] property.
* @param width Width of the colorpreview in pixels.
* @param height Height of the colorpreview in pixels.
* @param type How transparency is represented.
* @returns A new #GimpColorButton widget.
*/
function prop_color_select_new(
config: GObject.Object,
property_name: string,
width: number,
height: number,
type: ColorAreaType | null,
): Gtk.Widget;
function prop_coordinates_connect(
config: GObject.Object,
x_property_name: string,
y_property_name: string,
unit_property_name: string,
sizeentry: Gtk.Widget,
chainbutton: Gtk.Widget,
xresolution: number,
yresolution: number,
): boolean;
/**
* Creates a #GimpSizeEntry to set and display two double or int
* properties, which will usually represent X and Y coordinates, and
* their associated unit property.
* @param config Object to which property is attached.
* @param x_property_name Name of int or double property for X coordinate.
* @param y_property_name Name of int or double property for Y coordinate.
* @param unit_property_name Name of unit property.
* @param unit_format A printf-like unit-format string as is used with gimp_unit_menu_new().
* @param update_policy How the automatic pixel <-> real-world-unit calculations should be done.
* @param xresolution The resolution (in dpi) for the X coordinate.
* @param yresolution The resolution (in dpi) for the Y coordinate.
* @param has_chainbutton Whether to add a chainbutton to the size entry.
* @returns A new #GimpSizeEntry widget.
*/
function prop_coordinates_new(
config: GObject.Object,
x_property_name: string,
y_property_name: string,
unit_property_name: string,
unit_format: string,
update_policy: SizeEntryUpdatePolicy | null,
xresolution: number,
yresolution: number,
has_chainbutton: boolean,
): Gtk.Widget;
/**
* Creates a [class`GimpUi`.DrawableChooser] controlled by the specified property.
* @param config Object to which property is attached.
* @param property_name Name of a [class@Gimp.Drawable] property.
* @param chooser_title title for the poppable dialog.
* @returns A new [class@GimpUi.DrawableChooser].
*/
function prop_drawable_chooser_new(
config: GObject.Object,
property_name: string,
chooser_title?: string | null,
): Gtk.Widget;
/**
* Creates a #GtkEntry to set and display the value of the specified
* string property.
* @param config Object to which property is attached.
* @param property_name Name of string property.
* @param max_len Maximum allowed length of string.
* @returns A new #GtkEntry widget.
*/
function prop_entry_new(config: GObject.Object, property_name: string, max_len: number): Gtk.Widget;
/**
* Creates a #GtkCheckButton that displays and sets the specified
* property of type Enum. Note that this widget only allows two values
* for the enum, one corresponding to the "checked" state and the
* other to the "unchecked" state.
* If `label` is %NULL, the `property_name'`s nick will be used as label
* of the returned button.
* @param config Object to which property is attached.
* @param property_name Name of enum property controlled by checkbutton.
* @param label Label to give checkbutton (including mnemonic).
* @param false_value Enum value corresponding to unchecked state.
* @param true_value Enum value corresponding to checked state.
* @returns The newly created #GtkCheckButton widget.
*/
function prop_enum_check_button_new(
config: GObject.Object,
property_name: string,
label: string | null,
false_value: number,
true_value: number,
): Gtk.Widget;
/**
* Creates a #GimpIntComboBox widget to display and set the specified
* enum property. The `mimimum_value` and `maximum_value` give the
* possibility of restricting the allowed range to a subset of the
* enum. If the two values are equal (e.g., 0, 0), then the full
* range of the Enum is used.
* @param config Object to which property is attached.
* @param property_name Name of enum property controlled by combo box.
* @param minimum Smallest allowed value of enum.
* @param maximum Largest allowed value of enum.
* @returns The newly created #GimpEnumComboBox widget.
*/
function prop_enum_combo_box_new(
config: GObject.Object,
property_name: string,
minimum: number,
maximum: number,
): Gtk.Widget;
/**
* Creates a horizontal box of radio buttons with named icons, which
* function to set and display the value of the specified Enum
* property. The icon name for each icon is created by appending the
* enum_value's nick to the given `icon_prefix`. See
* gimp_enum_icon_box_new() for more information.
* @param config Object to which property is attached.
* @param property_name Name of enum property controlled by the radio buttons.
* @param icon_prefix The prefix of the group of icon names to use.
* @param minimum Smallest value of enum to be included.
* @param maximum Largest value of enum to be included.
* @returns A #libgimpwidgets-gimpenumiconbox containing the radio buttons.
*/
function prop_enum_icon_box_new(
config: GObject.Object,
property_name: string,
icon_prefix: string,
minimum: number,
maximum: number,
): Gtk.Widget;
function prop_enum_label_new(config: GObject.Object, property_name: string): Gtk.Widget;
/**
* Creates a group of radio buttons which function to set and display
* the specified enum property. The `minimum` and `maximum` arguments
* allow only a subset of the enum to be used. If the two arguments
* are equal (e.g., 0, 0), then the full range of the enum will be used.
* If you want to assign a label to the group of radio buttons, use
* gimp_prop_enum_radio_frame_new() instead of this function.
* @param config Object to which property is attached.
* @param property_name Name of enum property controlled by the radio buttons.
* @param minimum Smallest value of enum to be included.
* @param maximum Largest value of enum to be included.
* @returns A #GtkBox containing the radio buttons.
*/
function prop_enum_radio_box_new(
config: GObject.Object,
property_name: string,
minimum: number,
maximum: number,
): Gtk.Widget;
/**
* Creates a group of radio buttons which function to set and display
* the specified enum property. The `minimum` and `maximum` arguments
* allow only a subset of the enum to be used. If the two arguments
* are equal (e.g., 0, 0), then the full range of the enum will be used.
* If `title` is %NULL, the `property_name'`s nick will be used as label
* of the returned frame.
* @param config Object to which property is attached.
* @param property_name Name of enum property controlled by the radio buttons.
* @param title Label for the frame holding the buttons
* @param minimum Smallest value of enum to be included.
* @param maximum Largest value of enum to be included.
* @returns A #GimpFrame containing the radio buttons.
*/
function prop_enum_radio_frame_new(
config: GObject.Object,
property_name: string,
title: string | null,
minimum: number,
maximum: number,
): Gtk.Widget;
/**
* Creates a #GtkExpander controlled by the specified boolean property.
* A value of %TRUE for the property corresponds to the expanded state
* for the widget.
* If `label` is %NULL, the `property_name'`s nick will be used as label
* of the returned widget.
* @param config Object to which property is attached.
* @param property_name Name of boolean property.
* @param label Label for expander.
* @returns A new #GtkExpander widget.
*/
function prop_expander_new(config: GObject.Object, property_name: string, label?: string | null): Gtk.Widget;
/**
* Creates a #GtkFileChooserButton to edit the specified path property.
* `property_name` must represent either a GIMP_PARAM_SPEC_CONFIG_PATH or
* a G_PARAM_SPEC_OBJECT where `value_type == G_TYPE_FILE`.
*
* Note that #GtkFileChooserButton implements the #GtkFileChooser
* interface; you can use the #GtkFileChooser API with it.
* @param config object to which property is attached.
* @param property_name name of path property.
* @param title the title of the browse dialog.
* @param action the open mode for the widget.
* @returns A new #GtkFileChooserButton.
*/
function prop_file_chooser_button_new(
config: GObject.Object,
property_name: string,
title: string | null,
action: Gtk.FileChooserAction | null,
): Gtk.Widget;
/**
* Creates a #GtkFileChooserButton to edit the specified path property.
*
* The button uses `dialog` as it's file-picking window. Note that `dialog`
* must be a #GtkFileChooserDialog (or subclass) and must not have
* %GTK_DIALOG_DESTROY_WITH_PARENT set.
*
* Note that #GtkFileChooserButton implements the #GtkFileChooser
* interface; you can use the #GtkFileChooser API with it.
* @param config object to which property is attached.
* @param property_name name of path property.
* @param dialog the #GtkFileChooserDialog widget to use.
* @returns A new #GtkFileChooserButton.
*/
function prop_file_chooser_button_new_with_dialog(
config: GObject.Object,
property_name: string,
dialog: Gtk.Widget,
): Gtk.Widget;
/**
* Creates a [class`GimpUi`.FileChooser] to edit the specified file
* property. `property_name` must be a %GimpParamSpecFile with an action
* other than [enum`Gimp`.FileChooserAction.ANY].
*
* If `label` is %NULL, `property_name'`s `nick` text will be used
* instead.
* @param config Object to which property is attached.
* @param property_name Name of a %GimpParamSpecFile property.
* @param label Label of the widget.
* @param title Title of the file dialog.
* @returns A new #GtkFileChooserButton.
*/
function prop_file_chooser_new(
config: GObject.Object,
property_name: string,
label?: string | null,
title?: string | null,
): Gtk.Widget;
/**
* Creates a [class`GimpUi`.FontChooser] controlled by the specified property.
* @param config Object to which property is attached.
* @param property_name Name of a [class@Gimp.Font] property.
* @param chooser_title title for the poppable dialog.
* @returns A new [class@GimpUi.FontChooser].
*/
function prop_font_chooser_new(
config: GObject.Object,
property_name: string,
chooser_title?: string | null,
): Gtk.Widget;
/**
* Creates a [class`GimpUi`.GradientChooser] controlled by the specified property.
* @param config Object to which property is attached.
* @param property_name Name of a [class@Gimp.Gradient] property.
* @param chooser_title title for the poppable dialog.
* @returns A new [class@GimpUi.GradientChooser].
*/
function prop_gradient_chooser_new(
config: GObject.Object,
property_name: string,
chooser_title?: string | null,
): Gtk.Widget;
/**
* Creates a horizontal scale to control the value of the specified
* integer or double property.
* @param config Object to which property is attached.
* @param property_name Name of integer or double property controlled by the scale.
* @param step_increment Step size.
* @param page_increment Page size.
* @param digits Number of digits after decimal point to display.
* @returns A new #GtkScale.
*/
function prop_hscale_new(
config: GObject.Object,
property_name: string,
step_increment: number,
page_increment: number,
digits: number,
): Gtk.Widget;
/**
* Creates a widget to display a icon image representing the value of the
* specified string property, which should encode an icon name.
* See gtk_image_new_from_icon_name() for more information.
* @param config Object to which property is attached.
* @param property_name Name of string property.
* @param icon_size Size of desired icon image.
* @returns A new #GtkImage widget.
*/
function prop_icon_image_new(
config: GObject.Object,
property_name: string,
icon_size: Gtk.IconSize | null,
): Gtk.Widget;
/**
* Creates a #GimpIntComboBox widget to display and set the specified
* property. The contents of the widget are determined by `store,`
* which should be created using gimp_int_store_new().
* @param config Object to which property is attached.
* @param property_name Name of int property controlled by combo box.
* @param store #GimpIntStore holding list of labels, values, etc.
* @returns The newly created #GimpIntComboBox widget.
*/
function prop_int_combo_box_new(config: GObject.Object, property_name: string, store: IntStore): Gtk.Widget;
/**
* Creates a group of radio buttons which function to set and display
* the specified int property. If `title` is %NULL, the
* `property_name'`s nick will be used as label of the returned frame.
* @param config Object to which property is attached.
* @param property_name Name of enum property controlled by the radio buttons.
* @param title Label for the frame holding the buttons
* @param store #GimpIntStore holding list of labels, values, etc.
* @returns A #GimpFrame containing the radio buttons.
*/
function prop_int_radio_frame_new(
config: GObject.Object,
property_name: string,
title: string | null,
store: IntStore,
): Gtk.Widget;
/**
* Creates a #GimpLabelColor to set and display the value of an RGB
* property.
* @param config Object to which property is attached.
* @param property_name Name of RGB property.
* @param editable Whether the widget should allow color editability.
* @returns A new #GimpLabelColor widget.
*/
function prop_label_color_new(config: GObject.Object, property_name: string, editable: boolean): Gtk.Widget;
/**
* Creates a #GimpLabelEntry to set and display the value of the
* specified string property.
* @param config Object to which property is attached.
* @param property_name Name of string property.
* @param max_len Maximum allowed length of string (set to negative for no maximum).
* @returns A new #GtkEntry widget.
*/
function prop_label_entry_new(config: GObject.Object, property_name: string, max_len: number): Gtk.Widget;
/**
* Creates a #GtkLabel to display the value of the specified property.
* The property should be a string property or at least transformable
* to a string. If the user should be able to edit the string, use
* gimp_prop_entry_new() instead.
* @param config Object to which property is attached.
* @param property_name Name of string property.
* @returns A new #GtkLabel widget.
*/
function prop_label_new(config: GObject.Object, property_name: string): Gtk.Widget;
/**
* Creates a #GimpLabelSpin to set and display the value of the
* specified double property.
* @param config Object to which property is attached.
* @param property_name
* @param digits Number of digits after decimal point to display.
* @returns A new #libgimpwidgets-gimpspinbutton.
*/
function prop_label_spin_new(config: GObject.Object, property_name: string, digits: number): Gtk.Widget;
/**
* Creates a #GimpMemsizeEntry (spin button and option menu) to set
* and display the value of the specified memsize property. See
* gimp_memsize_entry_new() for more information.
* @param config Object to which property is attached.
* @param property_name Name of memsize property.
* @returns A new #GimpMemsizeEntry.
*/
function prop_memsize_entry_new(config: GObject.Object, property_name: string): Gtk.Widget;
/**
* Creates a [class`GimpUi`.PaletteChooser] controlled by the specified property.
* @param config Object to which property is attached.
* @param property_name Name of a [class@Gimp.Palette] property.
* @param chooser_title title for the poppable dialog.
* @returns A new [class@GimpUi.PaletteChooser].
*/
function prop_palette_chooser_new(
config: GObject.Object,
property_name: string,
chooser_title?: string | null,
): Gtk.Widget;
/**
* Creates a #GimpPathEditor to edit the specified path and writable
* path properties.
* @param config object to which property is attached.
* @param path_property_name name of path property.
* @param writable_property_name name of writable path property.
* @param filechooser_title window title of #GtkFileChooserDialog widget.
* @returns A new #GimpPathEditor.
*/
function prop_path_editor_new(
config: GObject.Object,
path_property_name: string,
writable_property_name: string,
filechooser_title: string,
): Gtk.Widget;
/**
* Creates a [class`GimpUi`.PatternChooser] controlled by the specified property.
* @param config Object to which property is attached.
* @param property_name Name of a [class@Gimp.Pattern] property.
* @param chooser_title title for the poppable dialog.
* @returns A new [class@GimpUi.PatternChooser].
*/
function prop_pattern_chooser_new(
config: GObject.Object,
property_name: string,
chooser_title?: string | null,
): Gtk.Widget;
/**
* Creates a #GimpIntComboBox widget to display and set the specified
* property. The contents of the widget are determined by `store,`
* which should be created using gimp_int_store_new().
* Values are GType/gpointer data, and therefore must be stored in the
* "user-data" column, instead of the usual "value" column.
* @param config Object to which property is attached.
* @param property_name Name of GType/gpointer property controlled by combo box.
* @param store #GimpIntStore holding list of labels, values, etc.
* @returns The newly created #GimpIntComboBox widget.
*/
function prop_pointer_combo_box_new(config: GObject.Object, property_name: string, store: IntStore): Gtk.Widget;
/**
* Creates a #GimpScaleEntry (slider and spin button) to set and display
* the value of a specified int or double property with sensible default
* settings depending on the range (decimal places, increments, etc.).
* These settings can be overridden by the relevant widget methods.
*
* If `label` is %NULL, the `property_name'`s nick will be used as label
* of the returned object.
*
* If `factor` is not 1.0, the widget's range will be computed based of
* `property_name'`s range multiplied by `factor`. A typical usage would
* be to display a [0.0, 1.0] range as [0.0, 100.0] by setting 100.0 as
* `factor`.
*
* See gimp_scale_entry_set_bounds() for more information on
* `limit_scale,` `lower_limit` and `upper_limit`.
* @param config Object to which property is attached.
* @param property_name Name of integer or double property controlled by the scale.
* @param label The text for the #GtkLabel which will appear left of the #GtkScale.
* @param factor Optional multiplier to convert @property_name's range into the #GimpScaleEntry's range. The common usage is to set 1.0. For non-double properties, no other values than 1.0 are acceptable.
* @param limit_scale %FALSE if the range of possible values of the GtkScale should be the same as of the GtkSpinButton.
* @param lower_limit The scale's lower boundary if @scale_limits is %TRUE.
* @param upper_limit The scale's upper boundary if @scale_limits is %TRUE.
* @returns The newly allocated #GimpScaleEntry.
*/
function prop_scale_entry_new(
config: GObject.Object,
property_name: string,
label: string | null,
factor: number,
limit_scale: boolean,
lower_limit: number,
upper_limit: number,
): Gtk.Widget;
/**
* Creates a #GimpSizeEntry to set and display the specified double or
* int property, and its associated unit property. Note that this
* function is only suitable for creating a size entry holding a
* single value. Use gimp_prop_coordinates_new() to create a size
* entry holding two values.
* @param config Object to which property is attached.
* @param property_name Name of int or double property.
* @param property_is_pixel When %TRUE, the property value is in pixels, and in the selected unit otherwise.
* @param unit_property_name Name of unit property.
* @param unit_format A printf-like unit-format string as is used with gimp_unit_menu_new().
* @param update_policy How the automatic pixel <-> real-world-unit calculations should be done.
* @param resolution The resolution (in dpi) for the field.
* @returns A new #GimpSizeEntry widget.
*/
function prop_size_entry_new(
config: GObject.Object,
property_name: string,
property_is_pixel: boolean,
unit_property_name: string,
unit_format: string,
update_policy: SizeEntryUpdatePolicy | null,
resolution: number,
): Gtk.Widget;
/**
* Creates a spin button to set and display the value of the
* specified double property.
*
* If you wish to change the widget's range relatively to the
* `property_name'`s range, use gimp_prop_widget_set_factor().
* @param config Object to which property is attached.
* @param property_name Name of double property controlled by the spin button.
* @param step_increment Step size.
* @param page_increment Page size.
* @param digits Number of digits after decimal point to display.
* @returns A new #libgimpwidgets-gimpspinbutton.
*/
function prop_spin_button_new(
config: GObject.Object,
property_name: string,
step_increment: number,
page_increment: number,
digits: number,
): Gtk.Widget;
/**
* Creates a spin scale to set and display the value of the specified
* int or double property.
*
* By default, the `property_name'`s nick will be used as label of the
* returned widget. Use gimp_spin_scale_set_label() to change this.
*
* If you wish to change the widget's range relatively to the
* `property_name'`s range, use gimp_prop_widget_set_factor().
* @param config Object to which property is attached.
* @param property_name Name of double or int property controlled by the spin button.
* @param step_increment Step size.
* @param page_increment Page size.
* @param digits Number of digits after decimal point to display. This is only used for double properties. In case of int properties, `digits = 0` is implied.
* @returns A new #libgimpwidgets-gimpspinbutton.
*/
function prop_spin_scale_new(
config: GObject.Object,
property_name: string,
step_increment: number,
page_increment: number,
digits: number,
): Gtk.Widget;
/**
* Creates a #GimpStringComboBox widget to display and set the
* specified property. The contents of the widget are determined by
* `store`.
* @param config Object to which property is attached.
* @param property_name Name of int property controlled by combo box.
* @param model #GtkTreeStore holding list of values
* @param id_column column in @store that holds string IDs
* @param label_column column in @store that holds labels to use in the combo-box
* @returns The newly created #GimpStringComboBox widget.
*/
function prop_string_combo_box_new(
config: GObject.Object,
property_name: string,
model: Gtk.TreeModel,
id_column: number,
label_column: number,
): Gtk.Widget;
/**
* Creates a #GtkBox with a switch and a label that displays and sets the
* specified boolean property.
* If `label` is %NULL, the `property_name'`s nick will be used as label.
* @param config Object to which property is attached.
* @param property_name Name of boolean property controlled by checkbutton.
* @param label Label to give checkbutton (including mnemonic).
* @returns The newly created box containing a #GtkSwitch.
*/
function prop_switch_new(
config: GObject.Object,
property_name: string,
label: string,
): [Gtk.Widget, Gtk.Widget | null, Gtk.Widget | null];
/**
* Creates a #GtkTextBuffer to set and display the value of the
* specified string property. Unless the string is expected to
* contain multiple lines or a large amount of text, use
* gimp_prop_entry_new() instead. See #GtkTextView for information on
* how to insert a text buffer into a visible widget.
*
* If `max_len` is 0 or negative, the text buffer allows an unlimited
* number of characters to be entered.
* @param config Object to which property is attached.
* @param property_name Name of string property.
* @param max_len Maximum allowed length of text (in characters).
* @returns A new #GtkTextBuffer.
*/
function prop_text_buffer_new(config: GObject.Object, property_name: string, max_len: number): Gtk.TextBuffer;
/**
* Creates a #GimpUnitComboBox to set and display the value of a Unit
* property. See gimp_unit_combo_box_new() for more information.
* @param config Object to which property is attached.
* @param property_name Name of Unit property.
* @returns A new #GimpUnitComboBox widget.
*/
function prop_unit_combo_box_new(config: GObject.Object, property_name: string): Gtk.Widget;
/**
* Change the display factor of the property `widget` relatively to the
* property it was bound to. Currently the only types of widget accepted
* as input are those created by gimp_prop_spin_scale_new() and
* gimp_prop_spin_button_new().
*
* If `factor` is 1.0, then the config property and the widget display
* map exactly.
*
* If `factor` is not 1.0, the widget's range will be computed based of
* `property_name'`s range multiplied by `factor`. A typical usage would
* be to display a [0.0, 1.0] range as [0.0, 100.0] by setting 100.0 as
* `factor`. This function can only be used with double properties.
*
* The `step_increment` and `page_increment` can be set to new increments
* you want to get for this new range. If you set them to 0.0 or
* negative values, new increments will be computed based on the new
* `factor` and previous factor.
* @param widget Property widget.
* @param factor Multiplier to convert the @widget's range and map appropriately to the property's range it is associated to.
* @param step_increment Step size.
* @param page_increment Page size.
* @param digits Number of digits after decimal point to display.
*/
function prop_widget_set_factor(
widget: Gtk.Widget,
factor: number,
step_increment: number,
page_increment: number,
digits: number,
): void;
/**
* Creates a new #GtkDialog that asks the user to do a boolean decision.
* @param title The query box dialog's title.
* @param parent The dialog's parent widget.
* @param help_func The help function to show this dialog's help page.
* @param help_id A string identifying this dialog's help page.
* @param icon_name An icon name to specify an icon to appear on the left on the dialog's message.
* @param message A string which will be shown in the query box.
* @param true_button The string to be shown in the dialog's left button.
* @param false_button The string to be shown in the dialog's right button.
* @param object The object this query box is associated with.
* @param signal The object's signal which will cause the query box to be closed.
* @param callback The function which will be called when the user clicks one of the buttons.
* @returns A pointer to the new #GtkDialog.
*/
function query_boolean_box(
title: string,
parent: Gtk.Widget,
help_func: HelpFunc,
help_id: string,
icon_name: string,
message: string,
true_button: string,
false_button: string,
object: GObject.Object,
signal: string,
callback: QueryBooleanCallback,
): Gtk.Widget;
/**
* Creates a new #GtkDialog that queries the user for a double value.
* @param title The query box dialog's title.
* @param parent The dialog's parent widget.
* @param help_func The help function to show this dialog's help page.
* @param help_id A string identifying this dialog's help page.
* @param message A string which will be shown above the dialog's entry widget.
* @param initial The initial value.
* @param lower The lower boundary of the range of possible values.
* @param upper The upper boundray of the range of possible values.
* @param digits The number of decimal digits the #GtkSpinButton will provide.
* @param object The object this query box is associated with.
* @param signal The object's signal which will cause the query box to be closed.
* @param callback The function which will be called when the user selects "OK".
* @returns A pointer to the new #GtkDialog.
*/
function query_double_box(
title: string,
parent: Gtk.Widget,
help_func: HelpFunc,
help_id: string,
message: string,
initial: number,
lower: number,
upper: number,
digits: number,
object: GObject.Object,
signal: string,
callback: QueryDoubleCallback,
): Gtk.Widget;
/**
* Creates a new #GtkDialog that queries the user for an integer value.
* @param title The query box dialog's title.
* @param parent The dialog's parent widget.
* @param help_func The help function to show this dialog's help page.
* @param help_id A string identifying this dialog's help page.
* @param message A string which will be shown above the dialog's entry widget.
* @param initial The initial value.
* @param lower The lower boundary of the range of possible values.
* @param upper The upper boundray of the range of possible values.
* @param object The object this query box is associated with.
* @param signal The object's signal which will cause the query box to be closed.
* @param callback The function which will be called when the user selects "OK".
* @returns A pointer to the new #GtkDialog.
*/
function query_int_box(
title: string,
parent: Gtk.Widget,
help_func: HelpFunc,
help_id: string,
message: string,
initial: number,
lower: number,
upper: number,
object: GObject.Object,
signal: string,
callback: QueryIntCallback,
): Gtk.Widget;
/**
* Creates a new #GtkDialog that queries the user for a size using a
* #GimpSizeEntry.
* @param title The query box dialog's title.
* @param parent The dialog's parent widget.
* @param help_func The help function to show this dialog's help page.
* @param help_id A string identifying this dialog's help page.
* @param message A string which will be shown above the dialog's entry widget.
* @param initial The initial value.
* @param lower The lower boundary of the range of possible values.
* @param upper The upper boundray of the range of possible values.
* @param digits The number of decimal digits the #GimpSizeEntry provide in "pixel" mode.
* @param unit The unit initially shown by the #GimpUnitMenu.
* @param resolution The resolution (in dpi) which will be used for pixel/unit calculations.
* @param dot_for_dot %TRUE if the #GimpUnitMenu's initial unit should be "pixels".
* @param object The object this query box is associated with.
* @param signal The object's signal which will cause the query box to be closed.
* @param callback The function which will be called when the user selects "OK".
* @returns A pointer to the new #GtkDialog.
*/
function query_size_box(
title: string,
parent: Gtk.Widget,
help_func: HelpFunc,
help_id: string,
message: string,
initial: number,
lower: number,
upper: number,
digits: number,
unit: Gimp.Unit,
resolution: number,
dot_for_dot: boolean,
object: GObject.Object,
signal: string,
callback: QuerySizeCallback,
): Gtk.Widget;
/**
* Creates a new #GtkDialog that queries the user for a string value.
* @param title The query box dialog's title.
* @param parent The dialog's parent widget.
* @param help_func The help function to show this dialog's help page.
* @param help_id A string identifying this dialog's help page.
* @param message A string which will be shown above the dialog's entry widget.
* @param initial The initial value.
* @param object The object this query box is associated with.
* @param signal The object's signal which will cause the query box to be closed.
* @param callback The function which will be called when the user selects "OK".
* @returns A pointer to the new #GtkDialog.
*/
function query_string_box(
title: string,
parent: Gtk.Widget,
help_func: HelpFunc,
help_id: string,
message: string,
initial: string,
object: GObject.Object,
signal: string,
callback: QueryStringCallback,
): Gtk.Widget;
function radio_button_update(widget: Gtk.Widget): number;
/**
* Creates a widget that allows the user to control how the random number
* generator is initialized.
* @param seed A pointer to the variable which stores the random seed.
* @param random_seed A pointer to a boolean indicating whether seed should be initialised randomly or not.
* @returns A #GtkBox containing a #GtkSpinButton for the seed and a #GtkButton for setting a random seed.
*/
function random_seed_new(seed: number, random_seed: boolean): Gtk.Widget;
function scroll_adjustment_values(
sevent: Gdk.EventScroll,
hadj: Gtk.Adjustment | null,
vadj: Gtk.Adjustment | null,
): [number, number];
/**
* This is the standard GIMP help function which does nothing but calling
* gimp_help(). It is the right function to use in almost all cases.
* @param help_id A unique help identifier.
* @param help_data The @help_data passed to gimp_help_connect().
*/
function standard_help_func(help_id: string, help_data?: any | null): void;
function toggle_button_update(widget: Gtk.Widget): boolean;
/**
* Note that the #GtkAdjustment's value (which is a #gdouble) will be rounded
* with (#guint) (value + 0.5).
* @param adjustment A #GtkAdjustment.
*/
function uint_adjustment_update(adjustment: Gtk.Adjustment): number;
/**
* This function attempts to read the user's system preference for
* showing animation. It can be used to turn off or hide unnecessary
* animations such as the scrolling credits or Easter Egg animations.
* @returns %TRUE if the user has animations enabled on their system
*/
function widget_animation_enabled(): boolean;
/**
* Disposes a widget's native window handle created asynchronously after
* a previous call to gimp_widget_set_native_handle.
* This disposes what the pointer points to, a *GBytes, if any.
* Call this when the widget and the window handle it owns is being disposed.
*
* This should be called at least once, paired with set_native_handle.
* This knows how to free `window_handle,` especially that on some platforms,
* an asynchronous callback must be canceled else it might call back
* with the pointer, after the widget and its private is freed.
*
* This is safe to call when deferenced `window_handle` is NULL,
* when the window handle was never actually set,
* on Wayland where actual setting is asynchronous.
*
* !!! The word "handle" has two meanings.
* A "window handle" is an ID of a window.
* A "handle" also commonly means a pointer to a pointer, in this case **GBytes.
* `window_handle` is both kinds of handle.
* @param widget a #GtkWindow
*/
function widget_free_native_handle(widget: Gtk.Widget): GLib.Bytes;
/**
* This function returns the #GimpColorProfile of the monitor `widget` is
* currently displayed on, or %NULL if there is no profile configured.
* @param widget a #GtkWidget
* @returns @widget's monitor's #GimpColorProfile, or %NULL.
*/
function widget_get_color_profile(widget: Gtk.Widget): Gimp.ColorProfile | null;
/**
* This function returns the #GimpColorTransform that transforms pixels
* from `src_profile` to the profile of the #GdkMonitor the `widget` is
* displayed on.
* @param widget a #GtkWidget
* @param config a #GimpColorConfig
* @param src_profile a #GimpColorProfile
* @param src_format Babl format for the transform's source pixels
* @param dest_format Babl format for the transforms's destination pixels
* @param softproof_profile
* @param proof_intent
* @param proof_bpc
* @returns the #GimpColorTransform.
*/
function widget_get_color_transform(
widget: Gtk.Widget,
config: Gimp.ColorConfig,
src_profile: Gimp.ColorProfile,
src_format: Babl.Object,
dest_format: Babl.Object,
softproof_profile: Gimp.ColorProfile,
proof_intent: Gimp.ColorRenderingIntent | null,
proof_bpc: boolean,
): Gimp.ColorTransform | null;
function widget_get_monitor(widget: Gtk.Widget): Gdk.Monitor;
function widget_get_render_space(widget: Gtk.Widget, config: Gimp.ColorConfig): Babl.Object;
/**
* This function is used to store the handle representing `window` into
* `handle` so that it can later be reused to set other windows as
* transient to this one (even in other processes, such as plug-ins).
*
* Depending on the platform, the actual content of `handle` can be
* various types. Moreover it may be filled asynchronously in a
* callback, so you should not assume that `handle` is set after running
* this function.
*
* This convenience function is safe to use even before `widget` is
* visible as it will set the handle once it is mapped.
* @param widget a #GtkWindow
*/
function widget_set_native_handle(widget: Gtk.Widget): GLib.Bytes;
/**
* This function behaves as if #GtkWidget had a signal
*
* GtkWidget::monitor_changed(GtkWidget *widget, gpointer user_data)
*
* That is emitted whenever `widget'`s toplevel window is moved from
* one monitor to another. This function automatically connects to
* the right toplevel #GtkWindow, even across moving `widget` between
* toplevel windows.
*
* Note that this function tracks the toplevel, not `widget` itself, so
* all a window's widgets are always considered to be on the same
* monitor. This is because this function is mainly used for fetching
* the new monitor's color profile, and it makes little sense to use
* different profiles for the widgets of one window.
* @param widget a #GtkWidget
* @param monitor_changed_callback the callback when @widget's monitor changes
*/
function widget_track_monitor(widget: Gtk.Widget, monitor_changed_callback: GObject.Callback): void;
/**
* This function is never called directly. Use GIMP_WIDGETS_ERROR() instead.
* @returns the #GQuark that defines the GIMP widgets error domain.
*/
function widgets_error_quark(): GLib.Quark;
/**
* Indicates to the window manager that `window` is a transient dialog
* associated with the GIMP window that the plug-in has been
* started from. See also gimp_window_set_transient_for_display().
* @param window the #GtkWindow that should become transient
*/
function window_set_transient(window: Gtk.Window): void;
/**
* Indicates to the window manager that `window` is a transient dialog
* to the window identified by `handle`.
*
* Note that `handle` is an opaque data, which you should not try to
* construct yourself or make sense of. It may be different things
* depending on the OS or even the display server. You should only use
* a handle returned by [func`Gimp`.progress_get_window_handle],
* [method`Gimp`.Display.get_window_handle] or
* [method`GimpUi`.Dialog.get_native_handle].
*
* Most of the time you will want to use the convenience function
* [func`GimpUi`.window_set_transient].
* @param window the #GtkWindow that should become transient
* @param handle handle of the window that should become the parent
*/
function window_set_transient_for(window: Gtk.Window, handle: GLib.Bytes | Uint8Array): void;
/**
* Indicates to the window manager that `window` is a transient dialog
* associated with the GIMP image window that is identified by its
* display. See [method`Gdk`.Window.set_transient_for] for more information.
*
* Most of the time you will want to use the convenience function
* [func`GimpUi`.window_set_transient].
* @param window the #GtkWindow that should become transient
* @param display display of the image window that should become the parent
*/
function window_set_transient_for_display(window: Gtk.Window, display: Gimp.Display): void;
function zoom_button_new(
model: ZoomModel,
zoom_type: ZoomType | null,
icon_size: Gtk.IconSize | null,
): Gtk.Widget;
interface HelpFunc {
(help_id: string, help_data?: any | null): void;
}
interface ImageConstraintFunc {
(image: Gimp.Image): boolean;
}
interface IntRadioFrameSensitivityFunc {
(value: number, new_value: number): boolean;
}
interface IntSensitivityFunc {
(value: number): boolean;
}
interface ItemConstraintFunc {
(image: Gimp.Image, item: Gimp.Item): boolean;
}
interface QueryBooleanCallback {
(query_box: Gtk.Widget, value: boolean): void;
}
interface QueryDoubleCallback {
(query_box: Gtk.Widget, value: number): void;
}
interface QueryIntCallback {
(query_box: Gtk.Widget, value: number): void;
}
interface QuerySizeCallback {
(query_box: Gtk.Widget, size: number, unit: Gimp.Unit): void;
}
interface QueryStringCallback {
(query_box: Gtk.Widget, string: string): void;
}
interface StringSensitivityFunc {
(id: string): boolean;
}
namespace AspectPreview {
// Constructor properties interface
interface ConstructorProps
extends Preview.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
drawable: Gimp.Drawable;
}
}
/**
* A widget providing a preview with fixed aspect ratio.
*/
class AspectPreview extends Preview implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
get drawable(): Gimp.Drawable;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static new_from_drawable(drawable: Gimp.Drawable): AspectPreview;
// 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 Browser {
// Signal callback interfaces
interface Search {
(object: string, p0: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Paned.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* A base class for a documentation browser.
*/
class Browser extends Gtk.Paned implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Browser;
// 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: 'search', callback: (_source: this, object: string, p0: number) => void): number;
connect_after(signal: 'search', callback: (_source: this, object: string, p0: number) => void): number;
emit(signal: 'search', object: string, p0: number): void;
// Methods
get_left_vbox(): Gtk.Box;
get_right_vbox(): Gtk.Box;
/**
* Sets the search summary text.
* @param summary a string describing the search result
*/
set_search_summary(summary: string): void;
/**
* Sets the widget to appear on the right side of the `browser`.
* @param widget a #GtkWidget
*/
set_widget(widget: Gtk.Widget): void;
/**
* Displays `message` in the right side of the `browser`. Unless the right
* side already contains a #GtkLabel, the widget previously added with
* gimp_browser_set_widget() is removed and replaced by a #GtkLabel.
* @param message text message
*/
show_message(message: string): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 BrushChooser {
// Constructor properties interface
interface ConstructorProps
extends ResourceChooser.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* A button which pops up a brush selection dialog.
*
* Note that this widget draws itself using `GEGL` code. You **must** call
* [func`Gegl`.init] first to be able to use this chooser.
*/
class BrushChooser extends ResourceChooser implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title?: string | null, label?: string | null, brush?: Gimp.Brush | null): BrushChooser;
// Conflicted with Gtk.Box.new
static ['new'](...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;
/**
* 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 BusyBox {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
message: string;
}
}
/**
* #GimpBusyBox displays a styled message, providing indication of
* an ongoing operation.
*/
class BusyBox extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* Specifies the displayed message.
*/
get message(): string;
set message(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](message?: string | null): BusyBox;
// Conflicted with Gtk.Box.new
static ['new'](...args: never[]): any;
// Methods
/**
* Returns the displayed message of `box`.
* @returns The displayed message.
*/
get_message(): string;
/**
* Sets the displayed message og `box` to `message`.
* @param message the displayed message
*/
set_message(message: string): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 Button {
// Signal callback interfaces
interface ExtendedClicked {
(arg1: Gdk.ModifierType): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Actionable.ConstructorProps,
Gtk.Activatable.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
/**
* #GimpButton adds an extra signal to the #GtkButton widget that
* allows the callback to distinguish a normal click from a click that
* was performed with modifier keys pressed.
*/
class Button
extends Gtk.Button
implements Atk.ImplementorIface, Gtk.Actionable, Gtk.Activatable, Gtk.Buildable
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Button;
// 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: 'extended-clicked', callback: (_source: this, arg1: Gdk.ModifierType) => void): number;
connect_after(
signal: 'extended-clicked',
callback: (_source: this, arg1: Gdk.ModifierType) => void,
): number;
emit(signal: 'extended-clicked', arg1: Gdk.ModifierType): void;
// Virtual methods
/**
* Emits the button's "extended_clicked" signal.
* @param modifier_state a state as found in #GdkEventButton->state, e.g. #GDK_SHIFT_MASK.
*/
vfunc_extended_clicked(modifier_state: Gdk.ModifierType): void;
// Methods
/**
* Emits the button's "extended_clicked" signal.
* @param modifier_state a state as found in #GdkEventButton->state, e.g. #GDK_SHIFT_MASK.
*/
extended_clicked(modifier_state: Gdk.ModifierType | null): void;
// Inherited properties
get action_name(): string;
set action_name(val: string);
get actionName(): string;
set actionName(val: string);
get action_target(): GLib.Variant;
set action_target(val: GLib.Variant);
get actionTarget(): GLib.Variant;
set actionTarget(val: GLib.Variant);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* > #GtkActivatable implementors need to handle the this property and
* > call gtk_activatable_do_set_related_action() when it changes.
*/
get related_action(): Gtk.Action;
set related_action(val: Gtk.Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* > #GtkActivatable implementors need to handle the this property and
* > call gtk_activatable_do_set_related_action() when it changes.
*/
get relatedAction(): Gtk.Action;
set relatedAction(val: Gtk.Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* > #GtkActivatable implementors need to handle this property
* > and call gtk_activatable_sync_action_properties() on the activatable
* > widget when it changes.
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* > #GtkActivatable implementors need to handle this property
* > and call gtk_activatable_sync_action_properties() on the activatable
* > widget when it changes.
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Gets the action name for `actionable`.
*
* See gtk_actionable_set_action_name() for more information.
* @returns the action name, or %NULL if none is set
*/
get_action_name(): string | null;
/**
* Gets the current target value of `actionable`.
*
* See gtk_actionable_set_action_target_value() for more information.
* @returns the current target value
*/
get_action_target_value(): GLib.Variant;
/**
* Specifies the name of the action with which this widget should be
* associated. If `action_name` is %NULL then the widget will be
* unassociated from any previous action.
*
* Usually this function is used when the widget is located (or will be
* located) within the hierarchy of a #GtkApplicationWindow.
*
* Names are of the form “win.save” or “app.quit” for actions on the
* containing #GtkApplicationWindow or its associated #GtkApplication,
* respectively. This is the same form used for actions in the #GMenu
* associated with the window.
* @param action_name an action name, or %NULL
*/
set_action_name(action_name?: string | null): void;
/**
* Sets the target value of an actionable widget.
*
* If `target_value` is %NULL then the target value is unset.
*
* The target value has two purposes. First, it is used as the
* parameter to activation of the action associated with the
* #GtkActionable widget. Second, it is used to determine if the widget
* should be rendered as “active” — the widget is active if the state
* is equal to the given target.
*
* Consider the example of associating a set of buttons with a #GAction
* with string state in a typical “radio button” situation. Each button
* will be associated with the same action, but with a different target
* value for that action. Clicking on a particular button will activate
* the action with the target of that button, which will typically cause
* the action’s state to change to that value. Since the action’s state
* is now equal to the target value of the button, the button will now
* be rendered as active (and the other buttons, with different targets,
* rendered inactive).
* @param target_value a #GVariant to set as the target value, or %NULL
*/
set_action_target_value(target_value?: GLib.Variant | null): void;
/**
* Sets the action-name and associated string target value of an
* actionable widget.
*
* `detailed_action_name` is a string in the format accepted by
* g_action_parse_detailed_name().
*
* (Note that prior to version 3.22.25,
* this function is only usable for actions with a simple "s" target, and
* `detailed_action_name` must be of the form `"action::target"` where
* `action` is the action name and `target` is the string to use
* as the target.)
* @param detailed_action_name the detailed action name
*/
set_detailed_action_name(detailed_action_name: string): void;
/**
* Gets the action name for `actionable`.
*
* See gtk_actionable_set_action_name() for more information.
*/
vfunc_get_action_name(): string | null;
/**
* Gets the current target value of `actionable`.
*
* See gtk_actionable_set_action_target_value() for more information.
*/
vfunc_get_action_target_value(): GLib.Variant;
/**
* Specifies the name of the action with which this widget should be
* associated. If `action_name` is %NULL then the widget will be
* unassociated from any previous action.
*
* Usually this function is used when the widget is located (or will be
* located) within the hierarchy of a #GtkApplicationWindow.
*
* Names are of the form “win.save” or “app.quit” for actions on the
* containing #GtkApplicationWindow or its associated #GtkApplication,
* respectively. This is the same form used for actions in the #GMenu
* associated with the window.
* @param action_name an action name, or %NULL
*/
vfunc_set_action_name(action_name?: string | null): void;
/**
* Sets the target value of an actionable widget.
*
* If `target_value` is %NULL then the target value is unset.
*
* The target value has two purposes. First, it is used as the
* parameter to activation of the action associated with the
* #GtkActionable widget. Second, it is used to determine if the widget
* should be rendered as “active” — the widget is active if the state
* is equal to the given target.
*
* Consider the example of associating a set of buttons with a #GAction
* with string state in a typical “radio button” situation. Each button
* will be associated with the same action, but with a different target
* value for that action. Clicking on a particular button will activate
* the action with the target of that button, which will typically cause
* the action’s state to change to that value. Since the action’s state
* is now equal to the target value of the button, the button will now
* be rendered as active (and the other buttons, with different targets,
* rendered inactive).
* @param target_value a #GVariant to set as the target value, or %NULL
*/
vfunc_set_action_target_value(target_value?: GLib.Variant | null): void;
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action’s proxy list.
*
* > Be careful to call this before setting the local
* > copy of the #GtkAction property, since this function uses
* > gtk_activatable_get_related_action() to retrieve the
* > previous action.
* @param action the #GtkAction to set
*/
do_set_related_action(action: Gtk.Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Gtk.Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* > #GtkActivatable implementors need to handle the #GtkActivatable:related-action
* > property and call gtk_activatable_do_set_related_action() when it changes.
* @param action the #GtkAction to set
*/
set_related_action(action: Gtk.Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* > #GtkActivatable implementors need to handle the
* > #GtkActivatable:use-action-appearance property and call
* > gtk_activatable_sync_action_properties() to update `activatable`
* > if needed.
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable:related-action property is set
* or unset and by the implementing class when
* #GtkActivatable:use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Gtk.Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable:related-action property is set
* or unset and by the implementing class when
* #GtkActivatable:use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Gtk.Action | null): void;
/**
* Called to update the activatable when its related action’s properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Gtk.Action, property_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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace CellRendererColor {
// Constructor properties interface
interface ConstructorProps extends Gtk.CellRenderer.ConstructorProps {
color: Gegl.Color;
icon_size: number;
iconSize: number;
opaque: boolean;
}
}
/**
* A #GtkCellRenderer to display a #GeglColor color.
*/
class CellRendererColor extends Gtk.CellRenderer {
static $gtype: GObject.GType;
// Properties
get color(): Gegl.Color;
set color(val: Gegl.Color);
get icon_size(): number;
set icon_size(val: number);
get iconSize(): number;
set iconSize(val: number);
get opaque(): boolean;
set opaque(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererColor;
}
namespace CellRendererToggle {
// Signal callback interfaces
interface Clicked {
(object: string, p0: Gdk.ModifierType): void;
}
// Constructor properties interface
interface ConstructorProps extends Gtk.CellRendererToggle.ConstructorProps {
icon_name: string;
iconName: string;
icon_size: number;
iconSize: number;
override_background: boolean;
overrideBackground: boolean;
}
}
/**
* A #GtkCellRendererToggle that displays icons instead of a checkbox.
*/
class CellRendererToggle extends Gtk.CellRendererToggle {
static $gtype: GObject.GType;
// Properties
get icon_name(): string;
set icon_name(val: string);
get iconName(): string;
set iconName(val: string);
get icon_size(): number;
set icon_size(val: number);
get iconSize(): number;
set iconSize(val: number);
get override_background(): boolean;
set override_background(val: boolean);
get overrideBackground(): boolean;
set overrideBackground(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](icon_name: string): CellRendererToggle;
// Conflicted with Gtk.CellRendererToggle.new
static ['new'](...args: never[]): any;
// 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: 'clicked', callback: (_source: this, object: string, p0: Gdk.ModifierType) => void): number;
connect_after(
signal: 'clicked',
callback: (_source: this, object: string, p0: Gdk.ModifierType) => void,
): number;
emit(signal: 'clicked', object: string, p0: Gdk.ModifierType): void;
// Methods
/**
* Emits the "clicked" signal from a #GimpCellRendererToggle.
* @param path the path to the clicked row
* @param state the modifier state
*/
clicked(path: string, state: Gdk.ModifierType | null): void;
}
namespace ChainButton {
// Signal callback interfaces
interface Toggled {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Grid.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
active: boolean;
icon_size: Gtk.IconSize;
iconSize: Gtk.IconSize;
position: ChainPosition;
}
}
/**
* This widget provides a button showing either a linked or a broken
* chain that can be used to link two entries, spinbuttons, colors or
* other GUI elements and show that they may be locked. Use it for
* example to connect X and Y ratios to provide the possibility of a
* constrained aspect ratio.
*
* The #GimpChainButton only gives visual feedback, it does not really
* connect widgets. You have to take care of locking the values
* yourself by checking the state of the #GimpChainButton whenever a
* value changes in one of the connected widgets and adjusting the
* other value if necessary.
*/
class ChainButton extends Gtk.Grid implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The toggled state of the chain button.
*/
get active(): boolean;
set active(val: boolean);
/**
* The chain button icon size.
*/
get icon_size(): Gtk.IconSize;
set icon_size(val: Gtk.IconSize);
/**
* The chain button icon size.
*/
get iconSize(): Gtk.IconSize;
set iconSize(val: Gtk.IconSize);
/**
* The position in which the chain button will be used.
*/
get position(): ChainPosition;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](position: ChainPosition): ChainButton;
// Conflicted with Gtk.Grid.new
static ['new'](...args: never[]): any;
// 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: 'toggled', callback: (_source: this) => void): number;
connect_after(signal: 'toggled', callback: (_source: this) => void): number;
emit(signal: 'toggled'): void;
// Methods
/**
* Checks the state of the #GimpChainButton.
* @returns %TRUE if the #GimpChainButton is active (locked).
*/
get_active(): boolean;
get_button(): Gtk.Button;
/**
* Gets the icon size of the #GimpChainButton.
* @returns The icon size.
*/
get_icon_size(): Gtk.IconSize;
/**
* Sets the state of the #GimpChainButton to be either locked (%TRUE) or
* unlocked (%FALSE) and changes the showed pixmap to reflect the new state.
* @param active The new state.
*/
set_active(active: boolean): void;
/**
* Sets the icon size of the #GimpChainButton.
* @param size The new icon size.
*/
set_icon_size(size: Gtk.IconSize | null): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 ChannelComboBox {
// Constructor properties interface
interface ConstructorProps
extends IntComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {}
}
class ChannelComboBox
extends IntComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](constraint?: ItemConstraintFunc | null): ChannelComboBox;
// Conflicted with GimpUi.IntComboBox.new
static ['new'](...args: never[]): any;
// Inherited properties
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace ColorArea {
// Signal callback interfaces
interface ColorChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.DrawingArea.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
color: Gegl.Color;
drag_mask: Gdk.ModifierType;
dragMask: Gdk.ModifierType;
draw_border: boolean;
drawBorder: boolean;
type: ColorAreaType;
}
}
/**
* Displays a [class`Gegl`.Color], optionally with alpha-channel.
*/
class ColorArea extends Gtk.DrawingArea implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The color displayed in the color area.
*/
get color(): Gegl.Color;
set color(val: Gegl.Color);
set drag_mask(val: Gdk.ModifierType);
set dragMask(val: Gdk.ModifierType);
/**
* Whether to draw a thin border in the foreground color around the area.
*/
get draw_border(): boolean;
set draw_border(val: boolean);
/**
* Whether to draw a thin border in the foreground color around the area.
*/
get drawBorder(): boolean;
set drawBorder(val: boolean);
/**
* The type of the color area.
*/
get type(): ColorAreaType;
set type(val: ColorAreaType);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](color: Gegl.Color, type: ColorAreaType, drag_mask: Gdk.ModifierType): ColorArea;
// Conflicted with Gtk.DrawingArea.new
static ['new'](...args: never[]): any;
// 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: 'color-changed', callback: (_source: this) => void): number;
connect_after(signal: 'color-changed', callback: (_source: this) => void): number;
emit(signal: 'color-changed'): void;
// Methods
/**
* Allows dragging the color displayed with buttons identified by
* `drag_mask`. The drag supports targets of type "application/x-color".
*
* Note that setting a `drag_mask` of 0 disables the drag ability.
* @param drag_mask The bitmask of buttons that can start the drag.
*/
enable_drag(drag_mask: Gdk.ModifierType | null): void;
/**
* Retrieves the current color of the `area`.
* @returns a copy of the [class@Gegl.Color] displayed in @area.
*/
get_color(): Gegl.Color;
/**
* Checks whether the `area` shows transparency information. This is determined
* via the `area'`s #GimpColorAreaType.
* @returns %TRUE if @area shows transparency information, %FALSE otherwise.
*/
has_alpha(): boolean;
/**
* Sets `area` to a different `color`.
* @param color Pointer to a [class@Gegl.Color] that defines the new color.
*/
set_color(color: Gegl.Color): void;
/**
* Sets the color management configuration to use with this color area.
* @param config a #GimpColorConfig object.
*/
set_color_config(config: Gimp.ColorConfig): void;
/**
* The `area` can draw a thin border in the foreground color around
* itself. This function toggles this behavior on and off. The
* default is not draw a border.
* @param draw_border whether to draw a border or not
*/
set_draw_border(draw_border: boolean): void;
/**
* Sets the color area to render as an out-of-gamut color, i.e. with a
* small triangle on a corner using the color management out of gamut
* color (as per gimp_color_area_set_color_config()).
*
* By default, `area` will render as out-of-gamut for any RGB color with
* a channel out of the [0; 1] range. This function allows to consider
* more colors out of gamut (for instance non-gray colors on a grayscale
* image, or colors absent of palettes in indexed images, etc.)
* @param out_of_gamut whether to show an out-of-gamut indicator
*/
set_out_of_gamut(out_of_gamut: boolean): void;
/**
* Changes the type of `area`. The #GimpColorAreaType determines
* whether the widget shows transparency information and chooses the
* size of the checkerboard used to do that.
* @param type A #GimpColorAreaType.
*/
set_type(type: ColorAreaType | null): 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 ColorButton {
// Signal callback interfaces
interface ColorChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Actionable.ConstructorProps,
Gtk.Activatable.ConstructorProps,
Gtk.Buildable.ConstructorProps {
area_height: number;
areaHeight: number;
area_width: number;
areaWidth: number;
color: Gegl.Color;
color_config: Gimp.ColorConfig;
colorConfig: Gimp.ColorConfig;
continuous_update: boolean;
continuousUpdate: boolean;
title: string;
type: ColorAreaType;
}
}
/**
* This widget provides a simple button with a preview showing the
* color.
*
* On click a color selection dialog is opened. Additionally the
* button supports Drag and Drop and has a right-click menu that
* allows one to choose the color from the current FG or BG color. If
* the user changes the color, the "color-changed" signal is emitted.
*/
class ColorButton
extends Button
implements Atk.ImplementorIface, Gtk.Actionable, Gtk.Activatable, Gtk.Buildable
{
static $gtype: GObject.GType;
// Properties
/**
* The minimum height of the button's #GimpColorArea.
*/
set area_height(val: number);
/**
* The minimum height of the button's #GimpColorArea.
*/
set areaHeight(val: number);
/**
* The minimum width of the button's #GimpColorArea.
*/
set area_width(val: number);
/**
* The minimum width of the button's #GimpColorArea.
*/
set areaWidth(val: number);
/**
* The color displayed in the button's color area.
*/
get color(): Gegl.Color;
set color(val: Gegl.Color);
/**
* The #GimpColorConfig object used for the button's #GimpColorArea
* and #GimpColorSelection.
*/
get color_config(): Gimp.ColorConfig;
set color_config(val: Gimp.ColorConfig);
/**
* The #GimpColorConfig object used for the button's #GimpColorArea
* and #GimpColorSelection.
*/
get colorConfig(): Gimp.ColorConfig;
set colorConfig(val: Gimp.ColorConfig);
/**
* The update policy of the color button.
*/
get continuous_update(): boolean;
set continuous_update(val: boolean);
/**
* The update policy of the color button.
*/
get continuousUpdate(): boolean;
set continuousUpdate(val: boolean);
/**
* The title to be used for the color selection dialog.
*/
get title(): string;
set title(val: string);
/**
* The type of the button's color area.
*/
get type(): ColorAreaType;
set type(val: ColorAreaType);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
title: string,
width: number,
height: number,
color: Gegl.Color,
type: ColorAreaType,
): ColorButton;
// Conflicted with GimpUi.Button.new
static ['new'](...args: never[]): any;
// 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: 'color-changed', callback: (_source: this) => void): number;
connect_after(signal: 'color-changed', callback: (_source: this) => void): number;
emit(signal: 'color-changed'): void;
// Virtual methods
vfunc_color_changed(): void;
vfunc_get_action_type(): GObject.GType;
// Methods
get_action_group(): Gio.SimpleActionGroup;
// Conflicted with Gtk.Widget.get_action_group
get_action_group(...args: never[]): any;
/**
* Retrieves the currently set color from the `button`.
* @returns a copy of @button's [class@Gegl.Color].
*/
get_color(): Gegl.Color;
get_title(): string;
/**
* Returns the color button's `continuous_update` property.
* @returns the @continuous_update property.
*/
get_update(): boolean;
/**
* Checks whether the `buttons` shows transparency information.
* @returns %TRUE if the @button shows transparency information, %FALSE otherwise.
*/
has_alpha(): boolean;
/**
* Sets the `button` to the given `color`.
* @param color A new [class@Gegl.Color].
*/
set_color(color: Gegl.Color): void;
/**
* Sets the color management configuration to use with this color button's
* #GimpColorArea.
* @param config a #GimpColorConfig object.
*/
set_color_config(config: Gimp.ColorConfig): void;
/**
* Sets the `button` dialog's title.
* @param title the new title.
*/
set_title(title: string): void;
/**
* Sets the `button` to the given `type`. See also gimp_color_area_set_type().
* @param type the new #GimpColorAreaType
*/
set_type(type: ColorAreaType | null): void;
/**
* When set to %TRUE, the `button` will emit the "color-changed"
* continuously while the color is changed in the color selection
* dialog.
* @param continuous The new setting of the @continuous_update property.
*/
set_update(continuous: boolean): void;
// Inherited properties
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace ColorDisplay {
// Signal callback interfaces
interface Changed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gimp.ConfigInterface.ConstructorProps {
color_config: Gimp.ColorConfig;
colorConfig: Gimp.ColorConfig;
color_managed: Gimp.ColorManaged;
colorManaged: Gimp.ColorManaged;
enabled: boolean;
}
}
/**
* Functions and definitions for creating pluggable GIMP
* display color correction modules.
*/
abstract class ColorDisplay extends GObject.Object implements Gimp.ConfigInterface {
static $gtype: GObject.GType;
// Properties
get color_config(): Gimp.ColorConfig;
get colorConfig(): Gimp.ColorConfig;
get color_managed(): Gimp.ColorManaged;
get colorManaged(): Gimp.ColorManaged;
get enabled(): boolean;
set enabled(val: boolean);
// 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) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
// Virtual methods
vfunc_changed(): void;
/**
* Creates a configuration widget for `display` which can be added to a
* container widget.
*/
vfunc_configure(): Gtk.Widget;
/**
* Converts all pixels in `area` of `buffer`.
* @param buffer a #GeglBuffer
* @param area area in @buffer to convert
*/
vfunc_convert_buffer(buffer: Gegl.Buffer, area: Gegl.Rectangle): void;
// Methods
changed(): void;
/**
* Creates a copy of `display`.
* @returns a duplicate of @display.
*/
clone(): ColorDisplay;
/**
* Creates a configuration widget for `display` which can be added to a
* container widget.
* @returns a new configuration widget for @display, or %NULL if no specific widget exists.
*/
configure(): Gtk.Widget;
configure_reset(): void;
/**
* Converts all pixels in `area` of `buffer`.
* @param buffer a #GeglBuffer
* @param area area in @buffer to convert
*/
convert_buffer(buffer: Gegl.Buffer, area: Gegl.Rectangle): void;
get_config(): Gimp.ColorConfig;
get_enabled(): boolean;
get_managed(): Gimp.ColorManaged;
/**
* Configures `display` from the contents of the parasite `state`.
* `state` must be a properly serialized configuration for a
* #GimpColorDisplay, such as saved by gimp_color_display_save_state().
* @param state a #GimpParasite
*/
load_state(state: Gimp.Parasite): void;
/**
* Saves the configuration state of `display` as a new parasite.
* @returns a #GimpParasite
*/
save_state(): Gimp.Parasite;
set_enabled(enabled: 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 ColorDisplayStack {
// Signal callback interfaces
interface Added {
(object: ColorDisplay, p0: number): void;
}
interface Changed {
(): void;
}
interface Removed {
(object: ColorDisplay): void;
}
interface Reordered {
(object: ColorDisplay, p0: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* A stack of color correction modules.
*/
class ColorDisplayStack extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ColorDisplayStack;
// 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: 'added', callback: (_source: this, object: ColorDisplay, p0: number) => void): number;
connect_after(signal: 'added', callback: (_source: this, object: ColorDisplay, p0: number) => void): number;
emit(signal: 'added', object: ColorDisplay, p0: number): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'removed', callback: (_source: this, object: ColorDisplay) => void): number;
connect_after(signal: 'removed', callback: (_source: this, object: ColorDisplay) => void): number;
emit(signal: 'removed', object: ColorDisplay): void;
connect(signal: 'reordered', callback: (_source: this, object: ColorDisplay, p0: number) => void): number;
connect_after(
signal: 'reordered',
callback: (_source: this, object: ColorDisplay, p0: number) => void,
): number;
emit(signal: 'reordered', object: ColorDisplay, p0: number): void;
// Methods
/**
* Add the color module `display` to `stack`.
* @param display a #GimpColorDisplay
*/
add(display: ColorDisplay): void;
/**
* Emit the "changed" signal of `stack`.
*/
changed(): void;
/**
* Creates a copy of `stack` with all its display color modules also
* duplicated.
* @returns a duplicate of @stack.
*/
clone(): ColorDisplayStack;
/**
* Runs all the stack's filters on all pixels in `area` of `buffer`.
* @param buffer a #GeglBuffer
* @param area area of @buffer to convert
*/
convert_buffer(buffer: Gegl.Buffer, area: Gegl.Rectangle): void;
/**
* Gets the list of added color modules.
* @returns the list of @stack's display color modules.
*/
get_filters(): ColorDisplay[];
/**
* Remove the color module `display` from `stack`.
* @param display a #GimpColorDisplay
*/
remove(display: ColorDisplay): void;
/**
* Move the color module `display` down in the filter list of `stack`.
* @param display a #GimpColorDisplay
*/
reorder_down(display: ColorDisplay): void;
/**
* Move the color module `display` up in the filter list of `stack`.
* @param display a #GimpColorDisplay
*/
reorder_up(display: ColorDisplay): void;
}
namespace ColorHexEntry {
// Signal callback interfaces
interface ColorChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Entry.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.Editable.ConstructorProps {}
}
/**
* Widget for entering a color's hex triplet. The syntax follows CSS and
* SVG specifications, which means that only sRGB colors are supported.
*/
class ColorHexEntry
extends Gtk.Entry
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.Editable
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ColorHexEntry;
// 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: 'color-changed', callback: (_source: this) => void): number;
connect_after(signal: 'color-changed', callback: (_source: this) => void): number;
emit(signal: 'color-changed'): void;
// Methods
/**
* Retrieves the color value displayed by a #GimpColorHexEntry.
* @returns the color stored in @entry.
*/
get_color(): Gegl.Color;
/**
* Sets the color displayed by a #GimpColorHexEntry. If the new color
* is different to the previously set color, the "color-changed"
* signal is emitted.
* @param color the color to set.
*/
set_color(color: Gegl.Color): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Copies the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
copy_clipboard(): void;
/**
* Removes the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
cut_clipboard(): void;
/**
* Deletes the currently selected text of the editable.
* This call doesn’t do anything if there is no selected text.
*/
delete_selection(): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
delete_text(start_pos: number, end_pos: number): void;
/**
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the characters
* retrieved are those characters from `start_pos` to the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of text
* @param end_pos end of text
* @returns a pointer to the contents of the widget as a string. This string is allocated by the #GtkEditable implementation and should be freed by the caller.
*/
get_chars(start_pos: number, end_pos: number): string;
/**
* Retrieves whether `editable` is editable. See
* gtk_editable_set_editable().
* @returns %TRUE if @editable is editable.
*/
get_editable(): boolean;
/**
* Retrieves the current position of the cursor relative to the start
* of the content of the editable.
*
* Note that this position is in characters, not in bytes.
* @returns the cursor position
*/
get_position(): number;
/**
* Retrieves the selection bound of the editable. start_pos will be filled
* with the start of the selection and `end_pos` with end. If no text was
* selected both will be identical and %FALSE will be returned.
*
* Note that positions are specified in characters, not bytes.
* @returns %TRUE if an area is selected, %FALSE otherwise
*/
get_selection_bounds(): [boolean, number, number];
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Pastes the content of the clipboard to the current position of the
* cursor in the editable.
*/
paste_clipboard(): void;
/**
* Selects a region of text. The characters that are selected are
* those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the
* characters selected are those characters from `start_pos` to
* the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of region
* @param end_pos end of region
*/
select_region(start_pos: number, end_pos: number): void;
/**
* Determines if the user can edit the text in the editable
* widget or not.
* @param is_editable %TRUE if the user is allowed to edit the text in the widget
*/
set_editable(is_editable: boolean): void;
/**
* Sets the cursor position in the editable to the given value.
*
* The cursor is displayed before the character with the given (base 0)
* index in the contents of the editable. The value must be less than or
* equal to the number of characters in the editable. A value of -1
* indicates that the position should be set after the last character
* of the editable. Note that `position` is in characters, not in bytes.
* @param position the position of the cursor
*/
set_position(position: number): void;
vfunc_changed(): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
vfunc_delete_text(start_pos: number, end_pos: number): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
vfunc_do_delete_text(start_pos: number, end_pos: number): void;
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
vfunc_do_insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the characters
* retrieved are those characters from `start_pos` to the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of text
* @param end_pos end of text
*/
vfunc_get_chars(start_pos: number, end_pos: number): string;
/**
* Retrieves the current position of the cursor relative to the start
* of the content of the editable.
*
* Note that this position is in characters, not in bytes.
*/
vfunc_get_position(): number;
/**
* Retrieves the selection bound of the editable. start_pos will be filled
* with the start of the selection and `end_pos` with end. If no text was
* selected both will be identical and %FALSE will be returned.
*
* Note that positions are specified in characters, not bytes.
*/
vfunc_get_selection_bounds(): [boolean, number, number];
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
vfunc_insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Sets the cursor position in the editable to the given value.
*
* The cursor is displayed before the character with the given (base 0)
* index in the contents of the editable. The value must be less than or
* equal to the number of characters in the editable. A value of -1
* indicates that the position should be set after the last character
* of the editable. Note that `position` is in characters, not in bytes.
* @param position the position of the cursor
*/
vfunc_set_position(position: number): void;
/**
* Selects a region of text. The characters that are selected are
* those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the
* characters selected are those characters from `start_pos` to
* the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of region
* @param end_pos end of region
*/
vfunc_set_selection_bounds(start_pos: number, end_pos: number): 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace ColorNotebook {
// Constructor properties interface
interface ConstructorProps
extends ColorSelector.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* The #GimpColorNotebook widget is an implementation of a
* #GimpColorSelector. It serves as a container for
* #GimpColorSelectors.
*/
class ColorNotebook extends ColorSelector implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
enable_simulation(enabled: boolean): void;
// Conflicted with GimpUi.ColorSelector.enable_simulation
enable_simulation(...args: never[]): any;
get_current_selector(): ColorSelector;
get_notebook(): Gtk.Notebook;
get_selectors(): ColorSelector[];
/**
* Updates all selectors with the current format.
* @param format A Babl format, with space.
*/
set_format(format: Babl.Object): void;
/**
* This function adds and removed pages to / from a #GimpColorNotebook.
* The `page_type` passed must be a #GimpColorSelector subtype.
* @param page_type The #GType of the notebook page to add or remove.
* @param has_page Whether the page should be added or removed.
* @returns The new page widget, if @has_page was %TRUE, or %NULL if @has_page was %FALSE.
*/
set_has_page(page_type: GObject.GType, has_page: boolean): Gtk.Widget;
/**
* Updates all selectors with the current simulation settings.
* @param profile A #GimpColorProfile object.
* @param intent A #GimpColorRenderingIntent enum.
* @param bpc A gboolean.
*/
set_simulation(profile: Gimp.ColorProfile, intent: Gimp.ColorRenderingIntent | null, bpc: 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 ColorProfileChooserDialog {
// Constructor properties interface
interface ConstructorProps
extends Gtk.FileChooserDialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.FileChooser.ConstructorProps {}
}
/**
* A #GtkFileChooser subclass for selecting color profiles.
*/
class ColorProfileChooserDialog
extends Gtk.FileChooserDialog
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.FileChooser
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title: string, parent: Gtk.Window, action: Gtk.FileChooserAction): ColorProfileChooserDialog;
// Conflicted with Gtk.Dialog.new
static ['new'](...args: never[]): any;
// Inherited properties
get action(): Gtk.FileChooserAction;
set action(val: Gtk.FileChooserAction);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get create_folders(): boolean;
set create_folders(val: boolean);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get createFolders(): boolean;
set createFolders(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get do_overwrite_confirmation(): boolean;
set do_overwrite_confirmation(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get doOverwriteConfirmation(): boolean;
set doOverwriteConfirmation(val: boolean);
get extra_widget(): Gtk.Widget;
set extra_widget(val: Gtk.Widget);
get extraWidget(): Gtk.Widget;
set extraWidget(val: Gtk.Widget);
get filter(): Gtk.FileFilter;
set filter(val: Gtk.FileFilter);
get local_only(): boolean;
set local_only(val: boolean);
get localOnly(): boolean;
set localOnly(val: boolean);
get preview_widget(): Gtk.Widget;
set preview_widget(val: Gtk.Widget);
get previewWidget(): Gtk.Widget;
set previewWidget(val: Gtk.Widget);
get preview_widget_active(): boolean;
set preview_widget_active(val: boolean);
get previewWidgetActive(): boolean;
set previewWidgetActive(val: boolean);
get select_multiple(): boolean;
set select_multiple(val: boolean);
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
get show_hidden(): boolean;
set show_hidden(val: boolean);
get showHidden(): boolean;
set showHidden(val: boolean);
get use_preview_label(): boolean;
set use_preview_label(val: boolean);
get usePreviewLabel(): boolean;
set usePreviewLabel(val: boolean);
// Inherited methods
/**
* Adds a 'choice' to the file chooser. This is typically implemented
* as a combobox or, for boolean choices, as a checkbutton. You can select
* a value using gtk_file_chooser_set_choice() before the dialog is shown,
* and you can obtain the user-selected value in the ::response signal handler
* using gtk_file_chooser_get_choice().
*
* Compare gtk_file_chooser_set_extra_widget().
* @param id id for the added choice
* @param label user-visible label for the added choice
* @param options ids for the options of the choice, or %NULL for a boolean choice
* @param option_labels user-visible labels for the options, must be the same length as @options
*/
add_choice(id: string, label: string, options?: string[] | null, option_labels?: string[] | null): void;
/**
* Adds `filter` to the list of filters that the user can select between.
* When a filter is selected, only files that are passed by that
* filter are displayed.
*
* Note that the `chooser` takes ownership of the filter, so you have to
* ref and sink it if you want to keep a reference.
* @param filter a #GtkFileFilter
*/
add_filter(filter: Gtk.FileFilter): void;
/**
* Adds a folder to be displayed with the shortcut folders in a file chooser.
* Note that shortcut folders do not get saved, as they are provided by the
* application. For example, you can use this to add a
* “/usr/share/mydrawprogram/Clipart” folder to the volume list.
* @param folder filename of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder(folder: string): boolean;
/**
* Adds a folder URI to be displayed with the shortcut folders in a file
* chooser. Note that shortcut folders do not get saved, as they are provided
* by the application. For example, you can use this to add a
* “file:///usr/share/mydrawprogram/Clipart” folder to the volume list.
* @param uri URI of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder_uri(uri: string): boolean;
/**
* Gets the type of operation that the file chooser is performing; see
* gtk_file_chooser_set_action().
* @returns the action that the file selector is performing
*/
get_action(): Gtk.FileChooserAction;
/**
* Gets the currently selected option in the 'choice' with the given ID.
* @param id the ID of the choice to get
* @returns the ID of the currenly selected option
*/
get_choice(id: string): string;
/**
* Gets whether file choser will offer to create new folders.
* See gtk_file_chooser_set_create_folders().
* @returns %TRUE if the Create Folder button should be displayed.
*/
get_create_folders(): boolean;
/**
* Gets the current folder of `chooser` as a local filename.
* See gtk_file_chooser_set_current_folder().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "/home/username/Documents"), which is not the same
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "/home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the full path of the current folder, or %NULL if the current path cannot be represented as a local filename. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder() on a nonexistent folder.
*/
get_current_folder(): string | null;
/**
* Gets the current folder of `chooser` as #GFile.
* See gtk_file_chooser_get_current_folder_uri().
* @returns the #GFile for the current folder.
*/
get_current_folder_file(): Gio.File | null;
/**
* Gets the current folder of `chooser` as an URI.
* See gtk_file_chooser_set_current_folder_uri().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "file:///home/username/Documents"), which is not the same
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "file:///home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the URI for the current folder. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder_uri() on a nonexistent folder.
*/
get_current_folder_uri(): string | null;
/**
* Gets the current name in the file selector, as entered by the user in the
* text entry for “Name”.
*
* This is meant to be used in save dialogs, to get the currently typed filename
* when the file itself does not exist yet. For example, an application that
* adds a custom extra widget to the file chooser for “file format” may want to
* change the extension of the typed filename based on the chosen format, say,
* from “.jpg” to “.png”.
* @returns The raw text from the file chooser’s “Name” entry. Free this with g_free(). Note that this string is not a full pathname or URI; it is whatever the contents of the entry are. Note also that this string is in UTF-8 encoding, which is not necessarily the system’s encoding for filenames.
*/
get_current_name(): string;
/**
* Queries whether a file chooser is set to confirm for overwriting when the user
* types a file name that already exists.
* @returns %TRUE if the file chooser will present a confirmation dialog; %FALSE otherwise.
*/
get_do_overwrite_confirmation(): boolean;
/**
* Gets the current extra widget; see
* gtk_file_chooser_set_extra_widget().
* @returns the current extra widget, or %NULL
*/
get_extra_widget(): Gtk.Widget | null;
/**
* Gets the #GFile for the currently selected file in
* the file selector. If multiple files are selected,
* one of the files will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns a selected #GFile. You own the returned file; use g_object_unref() to release it.
*/
get_file(): Gio.File;
/**
* Gets the filename for the currently selected file in
* the file selector. The filename is returned as an absolute path. If
* multiple files are selected, one of the filenames will be returned at
* random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected filename, or %NULL if no file is selected, or the selected file can't be represented with a local filename. Free with g_free().
*/
get_filename(): string | null;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute paths. If files in the current
* folder cannot be represented as local filenames they will be ignored. (See
* gtk_file_chooser_get_uris())
* @returns a #GSList containing the filenames of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_filenames(): string[];
/**
* Lists all the selected files and subfolders in the current folder of `chooser`
* as #GFile. An internal function, see gtk_file_chooser_get_uris().
* @returns a #GSList containing a #GFile for each selected file and subfolder in the current folder. Free the returned list with g_slist_free(), and the files with g_object_unref().
*/
get_files(): Gio.File[];
/**
* Gets the current filter; see gtk_file_chooser_set_filter().
* @returns the current filter, or %NULL
*/
get_filter(): Gtk.FileFilter | null;
/**
* Gets whether only local files can be selected in the
* file selector. See gtk_file_chooser_set_local_only()
* @returns %TRUE if only local files can be selected.
*/
get_local_only(): boolean;
/**
* Gets the #GFile that should be previewed in a custom preview
* Internal function, see gtk_file_chooser_get_preview_uri().
* @returns the #GFile for the file to preview, or %NULL if no file is selected. Free with g_object_unref().
*/
get_preview_file(): Gio.File | null;
/**
* Gets the filename that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the filename to preview, or %NULL if no file is selected, or if the selected file cannot be represented as a local filename. Free with g_free()
*/
get_preview_filename(): string | null;
/**
* Gets the URI that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the URI for the file to preview, or %NULL if no file is selected. Free with g_free().
*/
get_preview_uri(): string | null;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_preview_widget().
* @returns the current preview widget, or %NULL
*/
get_preview_widget(): Gtk.Widget | null;
/**
* Gets whether the preview widget set by gtk_file_chooser_set_preview_widget()
* should be shown for the current filename. See
* gtk_file_chooser_set_preview_widget_active().
* @returns %TRUE if the preview widget is active for the current filename.
*/
get_preview_widget_active(): boolean;
/**
* Gets whether multiple files can be selected in the file
* selector. See gtk_file_chooser_set_select_multiple().
* @returns %TRUE if multiple files can be selected.
*/
get_select_multiple(): boolean;
/**
* Gets whether hidden files and folders are displayed in the file selector.
* See gtk_file_chooser_set_show_hidden().
* @returns %TRUE if hidden files and folders are displayed.
*/
get_show_hidden(): boolean;
/**
* Gets the URI for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected URI, or %NULL if no file is selected. If gtk_file_chooser_set_local_only() is set to %TRUE (the default) a local URI will be returned for any FUSE locations. Free with g_free()
*/
get_uri(): string | null;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute URIs.
* @returns a #GSList containing the URIs of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_uris(): string[];
/**
* Gets whether a stock label should be drawn with the name of the previewed
* file. See gtk_file_chooser_set_use_preview_label().
* @returns %TRUE if the file chooser is set to display a label with the name of the previewed file, %FALSE otherwise.
*/
get_use_preview_label(): boolean;
/**
* Lists the current set of user-selectable filters; see
* gtk_file_chooser_add_filter(), gtk_file_chooser_remove_filter().
* @returns a #GSList containing the current set of user selectable filters. The contents of the list are owned by GTK+, but you must free the list itself with g_slist_free() when you are done with it.
*/
list_filters(): Gtk.FileFilter[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder_uri().
* @returns A list of folder URIs, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the URIs with g_free().
*/
list_shortcut_folder_uris(): string[] | null;
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder().
* @returns A list of folder filenames, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
list_shortcut_folders(): string[] | null;
/**
* Removes a 'choice' that has been added with gtk_file_chooser_add_choice().
* @param id the ID of the choice to remove
*/
remove_choice(id: string): void;
/**
* Removes `filter` from the list of filters that the user can select between.
* @param filter a #GtkFileFilter
*/
remove_filter(filter: Gtk.FileFilter): void;
/**
* Removes a folder from a file chooser’s list of shortcut folders.
* @param folder filename of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder()
*/
remove_shortcut_folder(folder: string): boolean;
/**
* Removes a folder URI from a file chooser’s list of shortcut folders.
* @param uri URI of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder_uri()
*/
remove_shortcut_folder_uri(uri: string): boolean;
/**
* Selects all the files in the current folder of a file chooser.
*/
select_all(): void;
/**
* Selects the file referred to by `file`. An internal function. See
* _gtk_file_chooser_select_uri().
* @param file the file to select
* @returns Not useful.
*/
select_file(file: Gio.File): boolean;
/**
* Selects a filename. If the file name isn’t in the current
* folder of `chooser,` then the current folder of `chooser` will
* be changed to the folder containing `filename`.
* @param filename the filename to select
* @returns Not useful. See also: gtk_file_chooser_set_filename()
*/
select_filename(filename: string): boolean;
/**
* Selects the file to by `uri`. If the URI doesn’t refer to a
* file in the current folder of `chooser,` then the current folder of
* `chooser` will be changed to the folder containing `filename`.
* @param uri the URI to select
* @returns Not useful.
*/
select_uri(uri: string): boolean;
/**
* Sets the type of operation that the chooser is performing; the
* user interface is adapted to suit the selected action. For example,
* an option to create a new folder might be shown if the action is
* %GTK_FILE_CHOOSER_ACTION_SAVE but not if the action is
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param action the action that the file selector is performing
*/
set_action(action: Gtk.FileChooserAction | null): void;
/**
* Selects an option in a 'choice' that has been added with
* gtk_file_chooser_add_choice(). For a boolean choice, the
* possible options are "true" and "false".
* @param id the ID of the choice to set
* @param option the ID of the option to select
*/
set_choice(id: string, option: string): void;
/**
* Sets whether file choser will offer to create new folders.
* This is only relevant if the action is not set to be
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param create_folders %TRUE if the Create Folder button should be displayed
*/
set_create_folders(create_folders: boolean): void;
/**
* Sets the current folder for `chooser` from a local filename.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
*
* In general, you should not use this function. See the
* [section on setting up a file chooser dialog][gtkfilechooserdialog-setting-up]
* for the rationale behind this.
* @param filename the full path of the new current folder
* @returns Not useful.
*/
set_current_folder(filename: string): boolean;
/**
* Sets the current folder for `chooser` from a #GFile.
* Internal function, see gtk_file_chooser_set_current_folder_uri().
* @param file the #GFile for the new folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_file(file: Gio.File): boolean;
/**
* Sets the current folder for `chooser` from an URI.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
*
* In general, you should not use this function. See the
* [section on setting up a file chooser dialog][gtkfilechooserdialog-setting-up]
* for the rationale behind this.
* @param uri the URI for the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_uri(uri: string): boolean;
/**
* Sets the current name in the file selector, as if entered
* by the user. Note that the name passed in here is a UTF-8
* string rather than a filename. This function is meant for
* such uses as a suggested name in a “Save As...” dialog. You can
* pass “Untitled.doc” or a similarly suitable suggestion for the `name`.
*
* If you want to preselect a particular existing file, you should use
* gtk_file_chooser_set_filename() or gtk_file_chooser_set_uri() instead.
* Please see the documentation for those functions for an example of using
* gtk_file_chooser_set_current_name() as well.
* @param name the filename to use, as a UTF-8 string
*/
set_current_name(name: string): void;
/**
* Sets whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode will present
* a confirmation dialog if the user types a file name that already exists. This
* is %FALSE by default.
*
* If set to %TRUE, the `chooser` will emit the
* #GtkFileChooser::confirm-overwrite signal when appropriate.
*
* If all you need is the stock confirmation dialog, set this property to %TRUE.
* You can override the way confirmation is done by actually handling the
* #GtkFileChooser::confirm-overwrite signal; please refer to its documentation
* for the details.
* @param do_overwrite_confirmation whether to confirm overwriting in save mode
*/
set_do_overwrite_confirmation(do_overwrite_confirmation: boolean): void;
/**
* Sets an application-supplied widget to provide extra options to the user.
* @param extra_widget widget for extra options
*/
set_extra_widget(extra_widget: Gtk.Widget): void;
/**
* Sets `file` as the current filename for the file chooser, by changing
* to the file’s parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file’s base name
* will also appear in the dialog’s file name entry.
*
* If the file name isn’t in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a save dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does Save As... If you don’t have
* a file name already — for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```c
* if (document_is_new)
* {
* // the user just created a new document
* gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* // the user edited an existing document
* gtk_file_chooser_set_file (chooser, existing_file);
* }
* ```
*
* @param file the #GFile to set as current
* @returns Not useful.
*/
set_file(file: Gio.File): boolean;
/**
* Sets `filename` as the current filename for the file chooser, by changing to
* the file’s parent folder and actually selecting the file in list; all other
* files will be unselected. If the `chooser` is in
* %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file’s base name will also appear in
* the dialog’s file name entry.
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* You should use this function only when implementing a save
* dialog for which you already have a file name to which
* the user may save. For example, when the user opens an existing file and
* then does Save As... to save a copy or
* a modified version. If you don’t have a file name already — for
* example, if the user just created a new file and is saving it for the first
* time, do not call this function. Instead, use something similar to this:
*
* ```c
* if (document_is_new)
* {
* // the user just created a new document
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* // the user edited an existing document
* gtk_file_chooser_set_filename (chooser, existing_filename);
* }
* ```
*
*
* In the first case, the file chooser will present the user with useful suggestions
* as to where to save his new file. In the second case, the file’s existing location
* is already known, so the file chooser will use it.
* @param filename the filename to set as current
* @returns Not useful.
*/
set_filename(filename: string): boolean;
/**
* Sets the current filter; only the files that pass the
* filter will be displayed. If the user-selectable list of filters
* is non-empty, then the filter should be one of the filters
* in that list. Setting the current filter when the list of
* filters is empty is useful if you want to restrict the displayed
* set of files without letting the user change it.
* @param filter a #GtkFileFilter
*/
set_filter(filter: Gtk.FileFilter): void;
/**
* Sets whether only local files can be selected in the
* file selector. If `local_only` is %TRUE (the default),
* then the selected file or files are guaranteed to be
* accessible through the operating systems native file
* system and therefore the application only
* needs to worry about the filename functions in
* #GtkFileChooser, like gtk_file_chooser_get_filename(),
* rather than the URI functions like
* gtk_file_chooser_get_uri(),
*
* On some systems non-native files may still be
* available using the native filesystem via a userspace
* filesystem (FUSE).
* @param local_only %TRUE if only local files can be selected
*/
set_local_only(local_only: boolean): void;
/**
* Sets an application-supplied widget to use to display a custom preview
* of the currently selected file. To implement a preview, after setting the
* preview widget, you connect to the #GtkFileChooser::update-preview
* signal, and call gtk_file_chooser_get_preview_filename() or
* gtk_file_chooser_get_preview_uri() on each change. If you can
* display a preview of the new file, update your widget and
* set the preview active using gtk_file_chooser_set_preview_widget_active().
* Otherwise, set the preview inactive.
*
* When there is no application-supplied preview widget, or the
* application-supplied preview widget is not active, the file chooser
* will display no preview at all.
* @param preview_widget widget for displaying preview.
*/
set_preview_widget(preview_widget: Gtk.Widget): void;
/**
* Sets whether the preview widget set by
* gtk_file_chooser_set_preview_widget() should be shown for the
* current filename. When `active` is set to false, the file chooser
* may display an internally generated preview of the current file
* or it may display no preview at all. See
* gtk_file_chooser_set_preview_widget() for more details.
* @param active whether to display the user-specified preview widget
*/
set_preview_widget_active(active: boolean): void;
/**
* Sets whether multiple files can be selected in the file selector. This is
* only relevant if the action is set to be %GTK_FILE_CHOOSER_ACTION_OPEN or
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
* @param select_multiple %TRUE if multiple files can be selected.
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether hidden files and folders are displayed in the file selector.
* @param show_hidden %TRUE if hidden files and folders should be displayed.
*/
set_show_hidden(show_hidden: boolean): void;
/**
* Sets the file referred to by `uri` as the current file for the file chooser,
* by changing to the URI’s parent folder and actually selecting the URI in the
* list. If the `chooser` is %GTK_FILE_CHOOSER_ACTION_SAVE mode, the URI’s base
* name will also appear in the dialog’s file name entry.
*
* Note that the URI must exist, or nothing will be done except for the
* directory change.
*
* You should use this function only when implementing a save
* dialog for which you already have a file name to which
* the user may save. For example, when the user opens an existing file and then
* does Save As... to save a copy or a
* modified version. If you don’t have a file name already — for example,
* if the user just created a new file and is saving it for the first time, do
* not call this function. Instead, use something similar to this:
*
* ```c
* if (document_is_new)
* {
* // the user just created a new document
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* // the user edited an existing document
* gtk_file_chooser_set_uri (chooser, existing_uri);
* }
* ```
*
*
*
* In the first case, the file chooser will present the user with useful suggestions
* as to where to save his new file. In the second case, the file’s existing location
* is already known, so the file chooser will use it.
* @param uri the URI to set as current
* @returns Not useful.
*/
set_uri(uri: string): boolean;
/**
* Sets whether the file chooser should display a stock label with the name of
* the file that is being previewed; the default is %TRUE. Applications that
* want to draw the whole preview area themselves should set this to %FALSE and
* display the name themselves in their preview widget.
*
* See also: gtk_file_chooser_set_preview_widget()
* @param use_label whether to display a stock label with the name of the previewed file
*/
set_use_preview_label(use_label: boolean): void;
/**
* Unselects all the files in the current folder of a file chooser.
*/
unselect_all(): void;
/**
* Unselects the file referred to by `file`. If the file is not in the current
* directory, does not exist, or is otherwise not currently selected, does nothing.
* @param file a #GFile
*/
unselect_file(file: Gio.File): void;
/**
* Unselects a currently selected filename. If the filename
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param filename the filename to unselect
*/
unselect_filename(filename: string): void;
/**
* Unselects the file referred to by `uri`. If the file
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param uri the URI to unselect
*/
unselect_uri(uri: 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 ColorProfileComboBox {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {
dialog: Gtk.Dialog;
model: ColorProfileStore;
}
}
/**
* A combo box for selecting color profiles.
*/
class ColorProfileComboBox
extends Gtk.ComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Properties
/**
* #GtkDialog to present when the user selects the
* "Select color profile from disk..." item.
*/
get dialog(): Gtk.Dialog;
/**
* Overrides the "model" property of the #GtkComboBox class.
* #GimpColorProfileComboBox requires the model to be a
* #GimpColorProfileStore.
*/
get model(): ColorProfileStore;
set model(val: ColorProfileStore);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](dialog: Gtk.Widget, history: Gio.File): ColorProfileComboBox;
// Conflicted with Gtk.ComboBox.new
static ['new'](...args: never[]): any;
static new_with_model(dialog: Gtk.Widget, model: Gtk.TreeModel): ColorProfileComboBox;
// Conflicted with Gtk.ComboBox.new_with_model
static new_with_model(...args: never[]): any;
// Methods
/**
* This function delegates to the underlying
* #GimpColorProfileStore. Please refer to the documentation of
* gimp_color_profile_store_add_file() for details.
* @param file file of the profile to add (or %NULL)
* @param label label to use for the profile (may only be %NULL if @file is %NULL)
*/
add_file(file: Gio.File, label: string): void;
get_active_file(): Gio.File;
/**
* Selects a color profile from the `combo` and makes it the active
* item. If the profile is not listed in the `combo,` then it is added
* with the given `label` (or `file` in case that `label` is %NULL).
* @param file file of the profile to select
* @param label label to use when adding a new entry (can be %NULL)
*/
set_active_file(file: Gio.File, label: string): void;
/**
* Selects a color profile from the `combo` and makes it the active
* item.
* @param profile a #GimpColorProfile to set
*/
set_active_profile(profile: Gimp.ColorProfile): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`.
*
* The `column` is the column of the model to get a value from, and the
* `attribute` is the parameter on `cell` to be set from the value. So for
* example if column 2 of the model contains strings, you could have the
* “text” attribute of a #GtkCellRendererText get its values from column 2.
* @param cell a #GtkCellRenderer
* @param attribute an attribute on the renderer
* @param column the column position on the model to get the attribute from
*/
add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell a #GtkCellRenderer to clear the attribute mapping on
*/
clear_attributes(cell: Gtk.CellRenderer): void;
/**
* Returns the underlying #GtkCellArea which might be `cell_layout`
* if called on a #GtkCellArea or might be %NULL if no #GtkCellArea
* is used by `cell_layout`.
* @returns the cell area used by @cell_layout, or %NULL in case no cell area is used.
*/
get_area(): Gtk.CellArea | null;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): Gtk.CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
pack_end(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
pack_start(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`.
*
* Note that `cell` has already to be packed into `cell_layout`
* for this to function properly.
* @param cell a #GtkCellRenderer to reorder
* @param position new position to insert @cell at
*/
reorder(cell: Gtk.CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`.
*
* This function is used instead of the standard attributes mapping
* for setting the column value, and should set the value of `cell_layout’`s
* cell renderer(s) as appropriate.
*
* `func` may be %NULL to remove a previously set function.
* @param cell a #GtkCellRenderer
* @param func the #GtkCellLayoutDataFunc to use, or %NULL
*/
set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`.
*
* The `column` is the column of the model to get a value from, and the
* `attribute` is the parameter on `cell` to be set from the value. So for
* example if column 2 of the model contains strings, you could have the
* “text” attribute of a #GtkCellRendererText get its values from column 2.
* @param cell a #GtkCellRenderer
* @param attribute an attribute on the renderer
* @param column the column position on the model to get the attribute from
*/
vfunc_add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell a #GtkCellRenderer to clear the attribute mapping on
*/
vfunc_clear_attributes(cell: Gtk.CellRenderer): void;
/**
* Returns the underlying #GtkCellArea which might be `cell_layout`
* if called on a #GtkCellArea or might be %NULL if no #GtkCellArea
* is used by `cell_layout`.
*/
vfunc_get_area(): Gtk.CellArea | null;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): Gtk.CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
vfunc_pack_end(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
vfunc_pack_start(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`.
*
* Note that `cell` has already to be packed into `cell_layout`
* for this to function properly.
* @param cell a #GtkCellRenderer to reorder
* @param position new position to insert @cell at
*/
vfunc_reorder(cell: Gtk.CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`.
*
* This function is used instead of the standard attributes mapping
* for setting the column value, and should set the value of `cell_layout’`s
* cell renderer(s) as appropriate.
*
* `func` may be %NULL to remove a previously set function.
* @param cell a #GtkCellRenderer
* @param func the #GtkCellLayoutDataFunc to use, or %NULL
*/
vfunc_set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace ColorProfileStore {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ListStore.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.TreeDragDest.ConstructorProps,
Gtk.TreeDragSource.ConstructorProps,
Gtk.TreeModel.ConstructorProps,
Gtk.TreeSortable.ConstructorProps {
history: Gio.File;
}
}
/**
* A #GtkListStore subclass that keep color profiles.
*/
class ColorProfileStore
extends Gtk.ListStore
implements Gtk.Buildable, Gtk.TreeDragDest, Gtk.TreeDragSource, Gtk.TreeModel, Gtk.TreeSortable
{
static $gtype: GObject.GType;
// Properties
/**
* #GFile of the color history used to populate the profile store.
*/
get history(): Gio.File;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](history: Gio.File): ColorProfileStore;
// Conflicted with Gtk.ListStore.new
static ['new'](...args: never[]): any;
// Methods
/**
* Adds a color profile item to the #GimpColorProfileStore. Items
* added with this function will be kept at the top, separated from
* the history of last used color profiles.
*
* This function is often used to add a selectable item for the %NULL
* file. If you pass %NULL for both `file` and `label,` the `label` will
* be set to the string "None" for you (and translated for the user).
* @param file #GFile of the profile to add (or %NULL)
* @param label label to use for the profile (may only be %NULL if @file is %NULL)
*/
add_file(file: Gio.File, label: string): 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: Gtk.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: Gtk.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: Gtk.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: Gtk.Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under ``.
* @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: Gtk.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: Gtk.Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the
* [GtkBuilder UI definition][BUILDER-UI]
* used to construct the `buildable`.
* @returns the name set with gtk_buildable_set_name()
*/
get_name(): string;
/**
* Called when the builder finishes the parsing of a
* [GtkBuilder UI definition][BUILDER-UI].
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Gtk.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: Gtk.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: Gtk.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: Gtk.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: Gtk.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: Gtk.Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under ``.
* @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: Gtk.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: Gtk.Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the
* [GtkBuilder UI definition][BUILDER-UI]
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* [GtkBuilder UI definition][BUILDER-UI].
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Gtk.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: Gtk.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;
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
* @returns whether a new row was created before position @dest
*/
drag_data_received(dest: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn’t exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
* @returns %TRUE if a drop is possible before @dest_path
*/
row_drop_possible(dest_path: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
*/
vfunc_drag_data_received(dest: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn’t exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
*/
vfunc_row_drop_possible(dest_path: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
* @returns %TRUE if the row was successfully deleted
*/
drag_data_delete(path: Gtk.TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @param selection_data a #GtkSelectionData to fill with data from the dragged row
* @returns %TRUE if data of the required type was provided
*/
drag_data_get(path: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn’t implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
* @returns %TRUE if the row can be dragged
*/
row_draggable(path: Gtk.TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
*/
vfunc_drag_data_delete(path: Gtk.TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @param selection_data a #GtkSelectionData to fill with data from the dragged row
*/
vfunc_drag_data_get(path: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn’t implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
*/
vfunc_row_draggable(path: Gtk.TreePath): boolean;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child_model
* and `root` as the virtual root.
* @param root A #GtkTreePath or %NULL.
* @returns A new #GtkTreeModel.
*/
filter_new(root?: Gtk.TreePath | null): Gtk.TreeModel;
/**
* Calls func on each node in model in a depth-first fashion.
*
* If `func` returns %TRUE, then the tree ceases to be walked,
* and gtk_tree_model_foreach() returns.
* @param func a function to be called on each row
*/
foreach(func: Gtk.TreeModelForeachFunc): void;
/**
* Returns the type of the column.
* @param index_ the column index
* @returns the type of the column
*/
get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface.
*
* The flags are a bitwise combination of #GtkTreeModelFlags.
* The flags supported should not change during the lifetime
* of the `tree_model`.
* @returns the flags supported by this interface
*/
get_flags(): Gtk.TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`. If `path` does
* not exist, `iter` is set to an invalid iterator and %FALSE is returned.
* @param path the #GtkTreePath-struct
* @returns %TRUE, if @iter was set
*/
get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter];
/**
* Initializes `iter` with the first iterator in the tree
* (the one at the path "0") and returns %TRUE. Returns
* %FALSE if the tree is empty.
* @returns %TRUE, if @iter was set
*/
get_iter_first(): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to a valid iterator pointing to `path_string,` if it
* exists. Otherwise, `iter` is left invalid and %FALSE is returned.
* @param path_string a string representation of a #GtkTreePath-struct
* @returns %TRUE, if @iter was set
*/
get_iter_from_string(path_string: string): [boolean, Gtk.TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
* @returns the number of columns
*/
get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath-struct referenced by `iter`.
*
* This path should be freed with gtk_tree_path_free().
* @param iter the #GtkTreeIter-struct
* @returns a newly-created #GtkTreePath-struct
*/
get_path(iter: Gtk.TreeIter): Gtk.TreePath;
/**
* Generates a string representation of the iter.
*
* This string is a “:” separated list of numbers.
* For example, “4:10:0:3” would be an acceptable
* return value for this string.
* @param iter a #GtkTreeIter-struct
* @returns a newly-allocated string. Must be freed with g_free().
*/
get_string_from_iter(iter: Gtk.TreeIter): string;
/**
* Initializes and sets `value` to that at `column`.
*
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter the #GtkTreeIter-struct
* @param column the column to lookup the value at
*/
get_value(iter: Gtk.TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`.
*
* If `parent` has no children, %FALSE is returned and `iter` is
* set to be invalid. `parent` will remain a valid node after this
* function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* `gtk_tree_model_get_iter_first (tree_model, iter);`
* @param parent the #GtkTreeIter-struct, or %NULL
* @returns %TRUE, if @iter has been set to the first child
*/
iter_children(parent?: Gtk.TreeIter | null): [boolean, Gtk.TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter the #GtkTreeIter-struct to test for children
* @returns %TRUE if @iter has children
*/
iter_has_child(iter: Gtk.TreeIter): boolean;
/**
* Returns the number of children that `iter` has.
*
* As a special case, if `iter` is %NULL, then the number
* of toplevel nodes is returned.
* @param iter the #GtkTreeIter-struct, or %NULL
* @returns the number of children of @iter
*/
iter_n_children(iter?: Gtk.TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level.
*
* If there is no next `iter,` %FALSE is returned and `iter` is set
* to be invalid.
* @param iter the #GtkTreeIter-struct
* @returns %TRUE if @iter has been changed to the next node
*/
iter_next(iter: Gtk.TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index.
*
* The first index is 0. If `n` is too big, or `parent` has no children,
* `iter` is set to an invalid iterator and %FALSE is returned. `parent`
* will remain a valid node after this function has been called. As a
* special case, if `parent` is %NULL, then the `n-th` root node
* is set.
* @param parent the #GtkTreeIter-struct to get the child from, or %NULL.
* @param n the index of the desired child
* @returns %TRUE, if @parent has an @n-th child
*/
iter_nth_child(parent: Gtk.TreeIter | null, n: number): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to be the parent of `child`.
*
* If `child` is at the toplevel, and doesn’t have a parent, then
* `iter` is set to an invalid iterator and %FALSE is returned.
* `child` will remain a valid node after this function has been
* called.
*
* `iter` will be initialized before the lookup is performed, so `child`
* and `iter` cannot point to the same memory location.
* @param child the #GtkTreeIter-struct
* @returns %TRUE, if @iter is set to the parent of @child
*/
iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to point to the previous node at the current level.
*
* If there is no previous `iter,` %FALSE is returned and `iter` is
* set to be invalid.
* @param iter the #GtkTreeIter-struct
* @returns %TRUE if @iter has been changed to the previous node
*/
iter_previous(iter: Gtk.TreeIter): boolean;
/**
* Lets the tree ref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let
* caching models know when nodes are being displayed (and hence,
* whether or not to cache that node). Being displayed means a node
* is in an expanded branch, regardless of whether the node is currently
* visible in the viewport. For example, a file-system based model
* would not want to keep the entire file-hierarchy in memory,
* just the sections that are currently being displayed by
* every current view.
*
* A model should be expected to be able to get an iter independent
* of its reffed state.
* @param iter the #GtkTreeIter-struct
*/
ref_node(iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-changed signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-deleted signal on `tree_model`.
*
* This should be called by models after a row has been removed.
* The location pointed to by `path` should be the location that
* the row previously was at. It may not be a valid location anymore.
*
* Nodes that are deleted are not unreffed, this means that any
* outstanding references on the deleted node should not be released.
* @param path a #GtkTreePath-struct pointing to the previous location of the deleted row
*/
row_deleted(path: Gtk.TreePath): void;
/**
* Emits the #GtkTreeModel::row-has-child-toggled signal on
* `tree_model`. This should be called by models after the child
* state of a node changes.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-inserted signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the inserted row
* @param iter a valid #GtkTreeIter-struct pointing to the inserted row
*/
row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::rows-reordered signal on `tree_model`.
*
* This should be called by models when their rows have been
* reordered.
* @param path a #GtkTreePath-struct pointing to the tree node whose children have been reordered
* @param iter a valid #GtkTreeIter-struct pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order`[newpos] = oldpos`
*/
rows_reordered(path: Gtk.TreePath, iter: Gtk.TreeIter | null, new_order: number[]): void;
/**
* Lets the tree unref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons. For more information on what
* this means, see gtk_tree_model_ref_node().
*
* Please note that nodes that are deleted are not unreffed.
* @param iter the #GtkTreeIter-struct
*/
unref_node(iter: Gtk.TreeIter): void;
/**
* Returns the type of the column.
* @param index_ the column index
*/
vfunc_get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface.
*
* The flags are a bitwise combination of #GtkTreeModelFlags.
* The flags supported should not change during the lifetime
* of the `tree_model`.
*/
vfunc_get_flags(): Gtk.TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`. If `path` does
* not exist, `iter` is set to an invalid iterator and %FALSE is returned.
* @param path the #GtkTreePath-struct
*/
vfunc_get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
*/
vfunc_get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath-struct referenced by `iter`.
*
* This path should be freed with gtk_tree_path_free().
* @param iter the #GtkTreeIter-struct
*/
vfunc_get_path(iter: Gtk.TreeIter): Gtk.TreePath;
/**
* Initializes and sets `value` to that at `column`.
*
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter the #GtkTreeIter-struct
* @param column the column to lookup the value at
*/
vfunc_get_value(iter: Gtk.TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`.
*
* If `parent` has no children, %FALSE is returned and `iter` is
* set to be invalid. `parent` will remain a valid node after this
* function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* `gtk_tree_model_get_iter_first (tree_model, iter);`
* @param parent the #GtkTreeIter-struct, or %NULL
*/
vfunc_iter_children(parent?: Gtk.TreeIter | null): [boolean, Gtk.TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter the #GtkTreeIter-struct to test for children
*/
vfunc_iter_has_child(iter: Gtk.TreeIter): boolean;
/**
* Returns the number of children that `iter` has.
*
* As a special case, if `iter` is %NULL, then the number
* of toplevel nodes is returned.
* @param iter the #GtkTreeIter-struct, or %NULL
*/
vfunc_iter_n_children(iter?: Gtk.TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level.
*
* If there is no next `iter,` %FALSE is returned and `iter` is set
* to be invalid.
* @param iter the #GtkTreeIter-struct
*/
vfunc_iter_next(iter: Gtk.TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index.
*
* The first index is 0. If `n` is too big, or `parent` has no children,
* `iter` is set to an invalid iterator and %FALSE is returned. `parent`
* will remain a valid node after this function has been called. As a
* special case, if `parent` is %NULL, then the `n-th` root node
* is set.
* @param parent the #GtkTreeIter-struct to get the child from, or %NULL.
* @param n the index of the desired child
*/
vfunc_iter_nth_child(parent: Gtk.TreeIter | null, n: number): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to be the parent of `child`.
*
* If `child` is at the toplevel, and doesn’t have a parent, then
* `iter` is set to an invalid iterator and %FALSE is returned.
* `child` will remain a valid node after this function has been
* called.
*
* `iter` will be initialized before the lookup is performed, so `child`
* and `iter` cannot point to the same memory location.
* @param child the #GtkTreeIter-struct
*/
vfunc_iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to point to the previous node at the current level.
*
* If there is no previous `iter,` %FALSE is returned and `iter` is
* set to be invalid.
* @param iter the #GtkTreeIter-struct
*/
vfunc_iter_previous(iter: Gtk.TreeIter): boolean;
/**
* Lets the tree ref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let
* caching models know when nodes are being displayed (and hence,
* whether or not to cache that node). Being displayed means a node
* is in an expanded branch, regardless of whether the node is currently
* visible in the viewport. For example, a file-system based model
* would not want to keep the entire file-hierarchy in memory,
* just the sections that are currently being displayed by
* every current view.
*
* A model should be expected to be able to get an iter independent
* of its reffed state.
* @param iter the #GtkTreeIter-struct
*/
vfunc_ref_node(iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-changed signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
vfunc_row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-deleted signal on `tree_model`.
*
* This should be called by models after a row has been removed.
* The location pointed to by `path` should be the location that
* the row previously was at. It may not be a valid location anymore.
*
* Nodes that are deleted are not unreffed, this means that any
* outstanding references on the deleted node should not be released.
* @param path a #GtkTreePath-struct pointing to the previous location of the deleted row
*/
vfunc_row_deleted(path: Gtk.TreePath): void;
/**
* Emits the #GtkTreeModel::row-has-child-toggled signal on
* `tree_model`. This should be called by models after the child
* state of a node changes.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
vfunc_row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-inserted signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the inserted row
* @param iter a valid #GtkTreeIter-struct pointing to the inserted row
*/
vfunc_row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Lets the tree unref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons. For more information on what
* this means, see gtk_tree_model_ref_node().
*
* Please note that nodes that are deleted are not unreffed.
* @param iter the #GtkTreeIter-struct
*/
vfunc_unref_node(iter: Gtk.TreeIter): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @returns %TRUE if the sort column is not one of the special sort column ids.
*/
get_sort_column_id(): [boolean, number, Gtk.SortType];
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
* @returns %TRUE, if the model has a default sort function
*/
has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can’t go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_default_sort_func(sort_func: Gtk.TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
*
* - %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function
* will be used, if it is set
*
* - %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
set_sort_column_id(sort_column_id: number, order: Gtk.SortType | null): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_sort_func(
sort_column_id: number,
sort_func: Gtk.TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
sort_column_changed(): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
*/
vfunc_get_sort_column_id(): [boolean, number, Gtk.SortType];
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
*/
vfunc_has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can’t go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_default_sort_func(sort_func: Gtk.TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
*
* - %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function
* will be used, if it is set
*
* - %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
vfunc_set_sort_column_id(sort_column_id: number, order: Gtk.SortType): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_sort_func(
sort_column_id: number,
sort_func: Gtk.TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
vfunc_sort_column_changed(): 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;
// Conflicted with Gtk.ListStore.set
set(...args: never[]): any;
/**
* 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 ColorProfileView {
// Constructor properties interface
interface ConstructorProps
extends Gtk.TextView.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Scrollable.ConstructorProps {}
}
/**
* A widget for viewing the properties of a #GimpColorProfile.
*/
class ColorProfileView extends Gtk.TextView implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Scrollable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ColorProfileView;
// Methods
set_error(message: string): void;
set_profile(profile: Gimp.ColorProfile): void;
// Inherited properties
/**
* Horizontal #GtkAdjustment of the scrollable widget. This adjustment is
* shared between the scrollable widget and its parent.
*/
get hadjustment(): Gtk.Adjustment;
set hadjustment(val: Gtk.Adjustment);
/**
* Determines whether horizontal scrolling should start once the scrollable
* widget is allocated less than its minimum width or less than its natural width.
*/
get hscroll_policy(): Gtk.ScrollablePolicy;
set hscroll_policy(val: Gtk.ScrollablePolicy);
/**
* Determines whether horizontal scrolling should start once the scrollable
* widget is allocated less than its minimum width or less than its natural width.
*/
get hscrollPolicy(): Gtk.ScrollablePolicy;
set hscrollPolicy(val: Gtk.ScrollablePolicy);
/**
* Verical #GtkAdjustment of the scrollable widget. This adjustment is shared
* between the scrollable widget and its parent.
*/
get vadjustment(): Gtk.Adjustment;
set vadjustment(val: Gtk.Adjustment);
/**
* Determines whether vertical scrolling should start once the scrollable
* widget is allocated less than its minimum height or less than its natural height.
*/
get vscroll_policy(): Gtk.ScrollablePolicy;
set vscroll_policy(val: Gtk.ScrollablePolicy);
/**
* Determines whether vertical scrolling should start once the scrollable
* widget is allocated less than its minimum height or less than its natural height.
*/
get vscrollPolicy(): Gtk.ScrollablePolicy;
set vscrollPolicy(val: Gtk.ScrollablePolicy);
// Inherited methods
/**
* Returns the size of a non-scrolling border around the
* outside of the scrollable. An example for this would
* be treeview headers. GTK+ can use this information to
* display overlayed graphics, like the overshoot indication,
* at the right position.
* @returns %TRUE if @border has been set
*/
get_border(): [boolean, Gtk.Border];
/**
* Retrieves the #GtkAdjustment used for horizontal scrolling.
* @returns horizontal #GtkAdjustment.
*/
get_hadjustment(): Gtk.Adjustment;
/**
* Gets the horizontal #GtkScrollablePolicy.
* @returns The horizontal #GtkScrollablePolicy.
*/
get_hscroll_policy(): Gtk.ScrollablePolicy;
/**
* Retrieves the #GtkAdjustment used for vertical scrolling.
* @returns vertical #GtkAdjustment.
*/
get_vadjustment(): Gtk.Adjustment;
/**
* Gets the vertical #GtkScrollablePolicy.
* @returns The vertical #GtkScrollablePolicy.
*/
get_vscroll_policy(): Gtk.ScrollablePolicy;
/**
* Sets the horizontal adjustment of the #GtkScrollable.
* @param hadjustment a #GtkAdjustment
*/
set_hadjustment(hadjustment?: Gtk.Adjustment | null): void;
/**
* Sets the #GtkScrollablePolicy to determine whether
* horizontal scrolling should start below the minimum width or
* below the natural width.
* @param policy the horizontal #GtkScrollablePolicy
*/
set_hscroll_policy(policy: Gtk.ScrollablePolicy | null): void;
/**
* Sets the vertical adjustment of the #GtkScrollable.
* @param vadjustment a #GtkAdjustment
*/
set_vadjustment(vadjustment?: Gtk.Adjustment | null): void;
/**
* Sets the #GtkScrollablePolicy to determine whether
* vertical scrolling should start below the minimum height or
* below the natural height.
* @param policy the vertical #GtkScrollablePolicy
*/
set_vscroll_policy(policy: Gtk.ScrollablePolicy | null): void;
/**
* Returns the size of a non-scrolling border around the
* outside of the scrollable. An example for this would
* be treeview headers. GTK+ can use this information to
* display overlayed graphics, like the overshoot indication,
* at the right position.
*/
vfunc_get_border(): [boolean, Gtk.Border];
/**
* 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 ColorScale {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Scale.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
channel: ColorSelectorChannel;
}
}
/**
* Fancy colored sliders.
*/
class ColorScale extends Gtk.Scale implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The channel which is edited by the color scale.
*/
get channel(): ColorSelectorChannel;
set channel(val: ColorSelectorChannel);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](orientation: Gtk.Orientation, channel: ColorSelectorChannel): ColorScale;
// Conflicted with Gtk.Scale.new
static ['new'](...args: never[]): any;
// Methods
/**
* Changes the color channel displayed by the `scale`.
* @param channel the new color channel
*/
set_channel(channel: ColorSelectorChannel | null): void;
/**
* Changes the color value of the `scale`.
* @param color the new color.
*/
set_color(color: Gegl.Color): void;
/**
* Sets the color management configuration to use with this color scale.
* @param config a #GimpColorConfig object.
*/
set_color_config(config: Gimp.ColorConfig): void;
/**
* Changes the color format displayed by the `scale`.
* @param format the Babl format represented by @scale.
*/
set_format(format: Babl.Object): 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 ColorScaleEntry {
// Constructor properties interface
interface ConstructorProps
extends ScaleEntry.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* This widget is a subclass of #GimpScaleEntry showing a
* #GimpColorScale instead of a #GtkScale.
*/
class ColorScaleEntry extends ScaleEntry implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](text: string, value: number, lower: number, upper: number, digits: number): ColorScaleEntry;
// Conflicted with Gtk.Grid.new
static ['new'](...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;
/**
* 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 ColorSelection {
// Signal callback interfaces
interface ColorChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
config: Gimp.ColorConfig;
}
}
/**
* Widget for doing a color selection.
*/
class ColorSelection extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
set config(val: Gimp.ColorConfig);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ColorSelection;
// 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: 'color-changed', callback: (_source: this) => void): number;
connect_after(signal: 'color-changed', callback: (_source: this) => void): number;
emit(signal: 'color-changed'): void;
// Methods
/**
* Emits the "color-changed" signal.
*/
color_changed(): void;
/**
* This function returns the #GimpColorSelection's current color.
* @returns the currently selected color.
*/
get_color(): Gegl.Color;
get_notebook(): Gtk.Widget;
get_old_color(): Gegl.Color;
get_right_vbox(): Gtk.Box;
/**
* Returns the `selection'`s `show_alpha` property.
* @returns %TRUE if the #GimpColorSelection has alpha controls.
*/
get_show_alpha(): boolean;
/**
* Sets the #GimpColorSelection's current color to its old color.
*/
reset(): void;
/**
* Sets the #GimpColorSelection's current color to the new `color`.
* @param color The @color to set as current color.
*/
set_color(color: Gegl.Color): void;
/**
* Sets the color management configuration to use with this color selection.
* @param config A #GimpColorConfig object.
*/
set_config(config: Gimp.ColorConfig): void;
/**
* Updates all selectors with the current format.
* @param format A Babl format, with space.
*/
set_format(format: Babl.Object): void;
/**
* Sets the #GimpColorSelection's old color.
* @param color The @color to set as old color.
*/
set_old_color(color: Gegl.Color): void;
/**
* Sets the `show_alpha` property of the `selection` widget.
* @param show_alpha The new @show_alpha setting.
*/
set_show_alpha(show_alpha: boolean): void;
/**
* Sets the simulation options to use with this color selection.
* @param profile A #GimpColorProfile object.
* @param intent A #GimpColorRenderingIntent enum.
* @param bpc A gboolean.
*/
set_simulation(profile: Gimp.ColorProfile, intent: Gimp.ColorRenderingIntent | null, bpc: boolean): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 ColorSelector {
// Signal callback interfaces
interface ChannelChanged {
(object: ColorSelectorChannel): void;
}
interface ColorChanged {
(object: Gegl.Color): void;
}
interface ModelVisibleChanged {
(object: ColorSelectorModel, p0: boolean): void;
}
interface Simulation {
(object: boolean): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* Functions and definitions for creating pluggable GIMP color
* selector modules.
*/
abstract class ColorSelector extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
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: 'channel-changed', callback: (_source: this, object: ColorSelectorChannel) => void): number;
connect_after(
signal: 'channel-changed',
callback: (_source: this, object: ColorSelectorChannel) => void,
): number;
emit(signal: 'channel-changed', object: ColorSelectorChannel): void;
connect(signal: 'color-changed', callback: (_source: this, object: Gegl.Color) => void): number;
connect_after(signal: 'color-changed', callback: (_source: this, object: Gegl.Color) => void): number;
emit(signal: 'color-changed', object: Gegl.Color): void;
connect(
signal: 'model-visible-changed',
callback: (_source: this, object: ColorSelectorModel, p0: boolean) => void,
): number;
connect_after(
signal: 'model-visible-changed',
callback: (_source: this, object: ColorSelectorModel, p0: boolean) => void,
): number;
emit(signal: 'model-visible-changed', object: ColorSelectorModel, p0: boolean): void;
connect(signal: 'simulation', callback: (_source: this, object: boolean) => void): number;
connect_after(signal: 'simulation', callback: (_source: this, object: boolean) => void): number;
emit(signal: 'simulation', object: boolean): void;
// Virtual methods
vfunc_channel_changed(channel: ColorSelectorChannel): void;
vfunc_color_changed(color: Gegl.Color): void;
vfunc_model_visible_changed(model: ColorSelectorModel, visible: boolean): void;
/**
* Sets the `channel` property of the `selector` widget.
*
* Changes between displayed channels if this `selector` instance has
* the ability to show different channels.
* This will also update the color model if needed.
* @param channel The new @channel setting.
*/
vfunc_set_channel(channel: ColorSelectorChannel): void;
/**
* Sets the color shown in the `selector` widget.
* @param color The new color.
*/
vfunc_set_color(color: Gegl.Color): void;
/**
* Sets the color management configuration to use with this color selector.
* @param config a #GimpColorConfig object.
*/
vfunc_set_config(config: Gimp.ColorConfig): void;
/**
* Sets the babl format representing the color model and the space this
* `selector` is supposed to display values for. Depending on the type of color
* selector, it may trigger various UX changes, or none at all.
* @param format a Babl format, with space.
*/
vfunc_set_format(format: Babl.Object): void;
/**
* Sets the `model` visible/invisible on the `selector` widget.
*
* Toggles visibility of displayed models if this `selector` instance
* has the ability to show different color models.
* @param model The affected #GimpColorSelectorModel.
* @param visible The new visible setting.
*/
vfunc_set_model_visible(model: ColorSelectorModel, visible: boolean): void;
/**
* Sets the `show_alpha` property of the `selector` widget.
* @param show_alpha The new @show_alpha setting.
*/
vfunc_set_show_alpha(show_alpha: boolean): void;
/**
* Sets the simulation options to use with this color selector.
* @param profile a #GimpColorProfile object.
* @param intent a #GimpColorRenderingIntent enum.
* @param bpc a gboolean.
*/
vfunc_set_simulation(profile: Gimp.ColorProfile, intent: Gimp.ColorRenderingIntent, bpc: boolean): void;
/**
* Sets the `sensitive` property of the `selector'`s toggles.
*
* This function has no effect if this `selector` instance has no
* toggles to switch channels.
* @param sensitive The new @sensitive setting.
*/
vfunc_set_toggles_sensitive(sensitive: boolean): void;
/**
* Sets the `visible` property of the `selector'`s toggles.
*
* This function has no effect if this `selector` instance has no
* toggles to switch channels.
* @param visible The new @visible setting.
*/
vfunc_set_toggles_visible(visible: boolean): void;
vfunc_simulation(enabled: boolean): void;
// Methods
enable_simulation(enabled: boolean): boolean;
/**
* Returns the `selector'`s current channel.
* @returns The #GimpColorSelectorChannel currently shown by the @selector.
*/
get_channel(): ColorSelectorChannel;
/**
* Retrieves the color shown in the `selector` widget.
* @returns a copy of the selected color.
*/
get_color(): Gegl.Color;
get_model_visible(model: ColorSelectorModel | null): boolean;
/**
* Returns the `selector'`s `show_alpha` property.
* @returns %TRUE if the #GimpColorSelector has alpha controls.
*/
get_show_alpha(): boolean;
get_simulation(profile: Gimp.ColorProfile, intent: Gimp.ColorRenderingIntent | null, bpc: boolean): boolean;
/**
* Returns the `sensitive` property of the `selector'`s toggles.
* @returns %TRUE if the #GimpColorSelector's toggles are sensitive.
*/
get_toggles_sensitive(): boolean;
/**
* Returns the `visible` property of the `selector'`s toggles.
* @returns %TRUE if the #GimpColorSelector's toggles are visible.
*/
get_toggles_visible(): boolean;
/**
* Sets the `channel` property of the `selector` widget.
*
* Changes between displayed channels if this `selector` instance has
* the ability to show different channels.
* This will also update the color model if needed.
* @param channel The new @channel setting.
*/
set_channel(channel: ColorSelectorChannel | null): void;
/**
* Sets the color shown in the `selector` widget.
* @param color The new color.
*/
set_color(color: Gegl.Color): void;
/**
* Sets the color management configuration to use with this color selector.
* @param config a #GimpColorConfig object.
*/
set_config(config: Gimp.ColorConfig): void;
/**
* Sets the babl format representing the color model and the space this
* `selector` is supposed to display values for. Depending on the type of color
* selector, it may trigger various UX changes, or none at all.
* @param format a Babl format, with space.
*/
set_format(format: Babl.Object): void;
/**
* Sets the `model` visible/invisible on the `selector` widget.
*
* Toggles visibility of displayed models if this `selector` instance
* has the ability to show different color models.
* @param model The affected #GimpColorSelectorModel.
* @param visible The new visible setting.
*/
set_model_visible(model: ColorSelectorModel | null, visible: boolean): void;
/**
* Sets the `show_alpha` property of the `selector` widget.
* @param show_alpha The new @show_alpha setting.
*/
set_show_alpha(show_alpha: boolean): void;
/**
* Sets the simulation options to use with this color selector.
* @param profile a #GimpColorProfile object.
* @param intent a #GimpColorRenderingIntent enum.
* @param bpc a gboolean.
*/
set_simulation(profile: Gimp.ColorProfile, intent: Gimp.ColorRenderingIntent | null, bpc: boolean): void;
/**
* Sets the `sensitive` property of the `selector'`s toggles.
*
* This function has no effect if this `selector` instance has no
* toggles to switch channels.
* @param sensitive The new @sensitive setting.
*/
set_toggles_sensitive(sensitive: boolean): void;
/**
* Sets the `visible` property of the `selector'`s toggles.
*
* This function has no effect if this `selector` instance has no
* toggles to switch channels.
* @param visible The new @visible setting.
*/
set_toggles_visible(visible: boolean): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 Dialog {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
help_func: any;
helpFunc: any;
help_id: string;
helpId: string;
parent: Gtk.Widget | any;
}
}
/**
* Constructors for #GtkDialog's and action_areas as well as other
* dialog-related stuff.
*/
class Dialog extends Gtk.Dialog implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
get help_func(): any;
get helpFunc(): any;
get help_id(): string;
set help_id(val: string);
get helpId(): string;
set helpId(val: string);
// This accessor conflicts with another accessor's type in a parent class or interface.
set parent(val: Gtk.Widget | any);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* This function is essentially the same as gtk_dialog_add_button()
* except it ensures there is only one help button and automatically
* sets the RESPONSE_OK widget as the default response.
* @param button_text text of button, or stock ID.
* @param response_id response ID for the button.
* @returns the button widget that was added.
*/
add_button(button_text: string, response_id: number): Gtk.Widget;
/**
* Returns an opaque data handle representing the window in the currently
* running platform. You should not try to use this directly. Usually this is to
* be used in functions such as [func`Gimp`.brushes_popup] which will allow the
* core process to set this [class`Dialog]` as parent to the newly created popup.
* @returns an opaque [struct@GLib.Bytes] identifying this window.
*/
get_native_handle(): GLib.Bytes;
/**
* This function does exactly the same as gtk_dialog_run() except it
* does not make the dialog modal while the #GMainLoop is running.
* @returns response ID
*/
run(): number;
/**
* Reorder `dialog'`s buttons if [property`Gtk`.Settings:gtk-alternative-button-order]
* is set to TRUE. This is mostly a wrapper around the GTK function
* [method`Gtk`.Dialog.set_alternative_button_order], except it won't
* output a deprecation warning.
* @param order array of buttons' response ids.
*/
set_alternative_button_order_from_array(order: 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;
/**
* 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 DrawableChooser {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
drawable: Gimp.Drawable;
drawable_type: GObject.GType;
drawableType: GObject.GType;
label: string;
title: string;
}
}
/**
* The chooser contains an optional label and a button which queries the core
* process to pop up a drawable selection dialog.
*/
class DrawableChooser extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The currently selected drawable.
*/
get drawable(): Gimp.Drawable;
set drawable(val: Gimp.Drawable);
/**
* Allowed drawable types, which must be either GIMP_TYPE_DRAWABLE or a
* subtype.
*/
get drawable_type(): GObject.GType;
/**
* Allowed drawable types, which must be either GIMP_TYPE_DRAWABLE or a
* subtype.
*/
get drawableType(): GObject.GType;
/**
* Label text with mnemonic.
*/
get label(): string;
/**
* The title to be used for the drawable selection popup dialog.
*/
get title(): string;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
title: string | null,
label: string | null,
drawable_type: GObject.GType,
drawable?: Gimp.Drawable | null,
): DrawableChooser;
// Conflicted with Gtk.Box.new
static ['new'](...args: never[]): any;
// Methods
/**
* Gets the currently selected drawable.
* @returns an internal copy of the drawable which must not be freed.
*/
get_drawable(): Gimp.Drawable;
/**
* Returns the label widget.
* @returns the [class@Gtk.Widget] showing the label text.
*/
get_label(): Gtk.Widget;
/**
* Sets the currently selected drawable.
* This will select the drawable in both the button and any chooser popup.
* @param drawable Drawable to set.
*/
set_drawable(drawable: Gimp.Drawable): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 DrawableComboBox {
// Constructor properties interface
interface ConstructorProps
extends IntComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {}
}
class DrawableComboBox
extends IntComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](constraint?: ItemConstraintFunc | null): DrawableComboBox;
// Conflicted with GimpUi.IntComboBox.new
static ['new'](...args: never[]): any;
// Inherited properties
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace DrawablePreview {
// Constructor properties interface
interface ConstructorProps
extends ScrolledPreview.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
drawable: Gimp.Drawable;
}
}
/**
* A widget providing a preview of a #GimpDrawable.
*/
class DrawablePreview extends ScrolledPreview implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
get drawable(): Gimp.Drawable;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static new_from_drawable(drawable: Gimp.Drawable): DrawablePreview;
// Methods
get_drawable(): Gimp.Drawable;
// 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 EnumComboBox {
// Constructor properties interface
interface ConstructorProps
extends IntComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {
model: EnumStore;
}
}
/**
* A #GtkComboBox subclass for selecting an enum value.
*/
class EnumComboBox
extends IntComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Properties
get model(): EnumStore;
set model(val: EnumStore);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](enum_type: GObject.GType): EnumComboBox;
// Conflicted with GimpUi.IntComboBox.new
static ['new'](...args: never[]): any;
static new_with_model(enum_store: EnumStore): EnumComboBox;
// Methods
/**
* Attempts to create icons for all items in the `combo_box`. See
* gimp_enum_store_set_icon_prefix() to find out what to use as
* `icon_prefix`.
* @param icon_prefix a prefix to create icon names from enum values
*/
set_icon_prefix(icon_prefix: string): void;
// Inherited properties
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace EnumLabel {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Label.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
enum_type: GObject.GType;
enumType: GObject.GType;
enum_value: number;
enumValue: number;
}
}
/**
* A #GtkLabel subclass that displays an enum value.
*/
class EnumLabel extends Gtk.Label implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The #GType of the enum.
*/
get enum_type(): GObject.GType;
/**
* The #GType of the enum.
*/
get enumType(): GObject.GType;
/**
* The value to display.
*/
set enum_value(val: number);
/**
* The value to display.
*/
set enumValue(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](enum_type: GObject.GType, value: number): EnumLabel;
// Conflicted with Gtk.Label.new
static ['new'](...args: never[]): any;
// Methods
set_value(value: 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;
/**
* 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 EnumStore {
// Constructor properties interface
interface ConstructorProps
extends IntStore.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.TreeDragDest.ConstructorProps,
Gtk.TreeDragSource.ConstructorProps,
Gtk.TreeModel.ConstructorProps,
Gtk.TreeSortable.ConstructorProps {
enum_type: GObject.GType;
enumType: GObject.GType;
}
}
/**
* A #GimpIntStore subclass that keeps enum values.
*/
class EnumStore
extends IntStore
implements Gtk.Buildable, Gtk.TreeDragDest, Gtk.TreeDragSource, Gtk.TreeModel, Gtk.TreeSortable
{
static $gtype: GObject.GType;
// Properties
/**
* Sets the #GType of the enum to be used in the store.
*/
get enum_type(): GObject.GType;
/**
* Sets the #GType of the enum to be used in the store.
*/
get enumType(): GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](enum_type: GObject.GType): EnumStore;
// Conflicted with GimpUi.IntStore.new
static ['new'](...args: never[]): any;
static new_with_range(enum_type: GObject.GType, minimum: number, maximum: number): EnumStore;
// Methods
/**
* Creates an icon name for each enum value in the `store` by appending
* the value's nick to the given `icon_prefix,` separated by a hyphen.
*
* See also: gimp_enum_combo_box_set_icon_prefix().
* @param icon_prefix a prefix to create icon names from enum values
*/
set_icon_prefix(icon_prefix: string): 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;
// Conflicted with Gtk.ListStore.set
set(...args: never[]): any;
/**
* 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 ExportProcedureDialog {
// Constructor properties interface
interface ConstructorProps
extends ProcedureDialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
class ExportProcedureDialog extends ProcedureDialog implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
procedure: Gimp.ExportProcedure,
config: Gimp.ProcedureConfig,
image: Gimp.Image,
): ExportProcedureDialog;
// Conflicted with GimpUi.ProcedureDialog.new
static ['new'](...args: never[]): any;
// Methods
add_metadata(property: string): 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 FileChooser {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
action: Gimp.FileChooserAction;
file: Gio.File;
label: string;
title: string;
}
}
/**
* The chooser contains an optional label and other interface allowing
* to select files for different use cases.
*/
class FileChooser extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The action determining the chooser UI.
*/
get action(): Gimp.FileChooserAction;
set action(val: Gimp.FileChooserAction);
/**
* The currently selected file.
*/
get file(): Gio.File;
set file(val: Gio.File);
/**
* Label text with mnemonic.
*/
get label(): string;
set label(val: string);
/**
* The title to be used for the file selection popup dialog.
* If %NULL, the "label" property is used instead.
*/
get title(): string;
set title(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
action: Gimp.FileChooserAction,
label?: string | null,
title?: string | null,
file?: Gio.File | null,
): FileChooser;
// Conflicted with Gtk.Box.new
static ['new'](...args: never[]): any;
// Methods
/**
* Gets the current action.
* @returns the action which determined the UI of @chooser.
*/
get_action(): Gimp.FileChooserAction;
/**
* Gets the currently selected file.
* @returns an internal copy of the file which must not be freed.
*/
get_file(): Gio.File;
/**
* Gets the current label text. A %NULL label means that the label
* widget is hidden.
*
* Note: the label text may contain a mnemonic.
* @returns the label set.
*/
get_label(): string | null;
/**
* Returns the label widget. This can be useful for instance when
* aligning dialog's widgets with a [class`Gtk`.SizeGroup].
* @returns the [class@Gtk.Widget] showing the label text.
*/
get_label_widget(): Gtk.Widget;
/**
* Gets the text currently used for the file dialog's title and for
* entry's placeholder text.
*
* A %NULL value means that the file dialog uses default title and the
* entry has no placeholder text.
* @returns the text used for the title of @chooser's dialog.
*/
get_title(): string | null;
/**
* Changes how `chooser` is set to select a file. It may completely
* change the internal widget structure so you should not depend on a
* specific widget composition.
*
* Warning: with GTK deprecations, we may have soon to change the
* internal implementation. So this is all the more reason for you not
* to rely on specific child widgets being present (e.g.: we use
* currently [class`Gtk`.FileChooserButton] internally but it was removed
* in GTK4 so we will eventually replace it by custom code). We will
* also likely move to native file dialogs at some point.
*
* [enum`Gimp`.FileChooserAction.ANY] is not a valid value for `action`.
* @param action Action to set.
*/
set_action(action: Gimp.FileChooserAction | null): void;
/**
* Sets the currently selected file.
* @param file File to set.
*/
set_file(file: Gio.File): void;
/**
* Set the label text with mnemonic.
*
* Setting a %NULL label text will hide the label widget.
* @param text Label text.
*/
set_label(text?: string | null): void;
/**
* Set the text to be used for the file dialog's title and for entry's
* placeholder text.
*
* Setting a %NULL title `text` will mean that the file dialog will use a
* generic title and there will be no placeholder text in the entry.
* @param text Dialog's title text.
*/
set_title(text?: string | null): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 FontChooser {
// Constructor properties interface
interface ConstructorProps
extends ResourceChooser.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* A button which pops up a font selection dialog.
*/
class FontChooser extends ResourceChooser implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title?: string | null, label?: string | null, font?: Gimp.Font | null): FontChooser;
// Conflicted with Gtk.Box.new
static ['new'](...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;
/**
* 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 Frame {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Frame.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
/**
* A widget providing a HIG-compliant subclass of #GtkFrame.
*/
class Frame extends Gtk.Frame implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType ;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](label?: string | null): Frame;
// 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 GradientChooser {
// Constructor properties interface
interface ConstructorProps
extends ResourceChooser.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* A button which pops up a gradient select dialog.
*/
class GradientChooser extends ResourceChooser implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
title?: string | null,
label?: string | null,
gradient?: Gimp.Gradient | null,
): GradientChooser;
// Conflicted with Gtk.Box.new
static ['new'](...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;
/**
* 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 HintBox {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
hint: string;
icon_name: string;
iconName: string;
}
}
/**
* Displays a wilber icon and a text.
*/
class HintBox extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
get hint(): string;
get icon_name(): string;
get iconName(): string;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](hint: string): HintBox;
// Conflicted with Gtk.Box.new
static ['new'](...args: never[]): any;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 ImageComboBox {
// Constructor properties interface
interface ConstructorProps
extends IntComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {}
}
/**
* A widget providing a popup menu of images.
*/
class ImageComboBox
extends IntComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](constraint?: ImageConstraintFunc | null): ImageComboBox;
// Conflicted with GimpUi.IntComboBox.new
static ['new'](...args: never[]): any;
// Inherited properties
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace IntComboBox {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {
ellipsize: Pango.EllipsizeMode;
label: string;
layout: IntComboBoxLayout;
value: number;
}
}
/**
* A widget providing a popup menu of integer values (e.g. enums).
*/
class IntComboBox
extends Gtk.ComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Properties
/**
* Specifies the preferred place to ellipsize text in the combo-box,
* if the cell renderer does not have enough room to display the
* entire string.
*/
get ellipsize(): Pango.EllipsizeMode;
set ellipsize(val: Pango.EllipsizeMode);
/**
* Sets a label on the combo-box, see gimp_int_combo_box_set_label().
*/
get label(): string;
set label(val: string);
/**
* Specifies the combo box layout.
*/
get layout(): IntComboBoxLayout;
set layout(val: IntComboBoxLayout);
/**
* The active value (different from the "active" property of
* GtkComboBox which is the active index).
*/
get value(): number;
set value(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](labels: string[]): IntComboBox;
// Conflicted with Gtk.ComboBox.new
static ['new'](...args: never[]): any;
// Methods
/**
* A convenience function that sets the initial `value` of a
* #GimpIntComboBox and connects `callback` to the "changed"
* signal.
*
* This function also calls the `callback` once after setting the
* initial `value`. This is often convenient when working with combo
* boxes that select a default active item, like for example
* gimp_drawable_combo_box_new(). If you pass an invalid initial
* `value,` the `callback` will be called with the default item active.
* @param value the value to set
* @param callback a callback to connect to the @combo_box's "changed" signal
* @returns the signal handler ID as returned by g_signal_connect()
*/
connect(value: number, callback: GObject.Callback): number;
connect(...args: never[]): any;
/**
* Retrieves the value of the selected (active) item in the `combo_box`.
* @returns %TRUE if @value has been set or %FALSE if no item was active.
*/
get_active(): [boolean, number];
// Conflicted with Gtk.ComboBox.get_active
get_active(...args: never[]): any;
/**
* Retrieves the user-data of the selected (active) item in the `combo_box`.
* @returns %TRUE if @user_data has been set or %FALSE if no item was active.
*/
get_active_user_data(): [boolean, any];
/**
* Returns the label previously set with gimp_int_combo_box_set_label(),
* or %NULL,
* @returns the @combo_box' label.
*/
get_label(): string;
/**
* Returns the layout of `combo_box`
* @returns the @combo_box's layout.
*/
get_layout(): IntComboBoxLayout;
/**
* Looks up the item that belongs to the given `value` and makes it the
* selected item in the `combo_box`.
* @param value an integer value
* @returns %TRUE on success (value changed or not) or %FALSE if there was no item for this value.
*/
set_active(value: number): boolean;
// Conflicted with Gtk.ComboBox.set_active
set_active(...args: never[]): any;
/**
* Looks up the item that has the given `user_data` and makes it the
* selected item in the `combo_box`.
* @param user_data an integer value
* @returns %TRUE on success or %FALSE if there was no item for this user-data.
*/
set_active_by_user_data(user_data?: any | null): boolean;
/**
* Sets a caption on the `combo_box` that will be displayed
* left-aligned inside the box. When a label is set, the remaining
* contents of the box will be right-aligned. This is useful for
* places where screen estate is rare, like in tool options.
* @param label a string to be shown as label
*/
set_label(label: string): void;
/**
* Sets the layout of `combo_box` to `layout`.
* @param layout the combo box layout
*/
set_layout(layout: IntComboBoxLayout | null): void;
/**
* Sets a function that is used to decide about the sensitivity of
* rows in the `combo_box`. Use this if you want to set certain rows
* insensitive.
*
* Calling gtk_widget_queue_draw() on the `combo_box` will cause the
* sensitivity to be updated.
* @param func a function that returns a boolean value, or %NULL to unset
*/
set_sensitivity(func: IntSensitivityFunc): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`.
*
* The `column` is the column of the model to get a value from, and the
* `attribute` is the parameter on `cell` to be set from the value. So for
* example if column 2 of the model contains strings, you could have the
* “text” attribute of a #GtkCellRendererText get its values from column 2.
* @param cell a #GtkCellRenderer
* @param attribute an attribute on the renderer
* @param column the column position on the model to get the attribute from
*/
add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell a #GtkCellRenderer to clear the attribute mapping on
*/
clear_attributes(cell: Gtk.CellRenderer): void;
/**
* Returns the underlying #GtkCellArea which might be `cell_layout`
* if called on a #GtkCellArea or might be %NULL if no #GtkCellArea
* is used by `cell_layout`.
* @returns the cell area used by @cell_layout, or %NULL in case no cell area is used.
*/
get_area(): Gtk.CellArea | null;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): Gtk.CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
pack_end(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
pack_start(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`.
*
* Note that `cell` has already to be packed into `cell_layout`
* for this to function properly.
* @param cell a #GtkCellRenderer to reorder
* @param position new position to insert @cell at
*/
reorder(cell: Gtk.CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`.
*
* This function is used instead of the standard attributes mapping
* for setting the column value, and should set the value of `cell_layout’`s
* cell renderer(s) as appropriate.
*
* `func` may be %NULL to remove a previously set function.
* @param cell a #GtkCellRenderer
* @param func the #GtkCellLayoutDataFunc to use, or %NULL
*/
set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`.
*
* The `column` is the column of the model to get a value from, and the
* `attribute` is the parameter on `cell` to be set from the value. So for
* example if column 2 of the model contains strings, you could have the
* “text” attribute of a #GtkCellRendererText get its values from column 2.
* @param cell a #GtkCellRenderer
* @param attribute an attribute on the renderer
* @param column the column position on the model to get the attribute from
*/
vfunc_add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell a #GtkCellRenderer to clear the attribute mapping on
*/
vfunc_clear_attributes(cell: Gtk.CellRenderer): void;
/**
* Returns the underlying #GtkCellArea which might be `cell_layout`
* if called on a #GtkCellArea or might be %NULL if no #GtkCellArea
* is used by `cell_layout`.
*/
vfunc_get_area(): Gtk.CellArea | null;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): Gtk.CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
vfunc_pack_end(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
vfunc_pack_start(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`.
*
* Note that `cell` has already to be packed into `cell_layout`
* for this to function properly.
* @param cell a #GtkCellRenderer to reorder
* @param position new position to insert @cell at
*/
vfunc_reorder(cell: Gtk.CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`.
*
* This function is used instead of the standard attributes mapping
* for setting the column value, and should set the value of `cell_layout’`s
* cell renderer(s) as appropriate.
*
* `func` may be %NULL to remove a previously set function.
* @param cell a #GtkCellRenderer
* @param func the #GtkCellLayoutDataFunc to use, or %NULL
*/
vfunc_set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace IntRadioFrame {
// Constructor properties interface
interface ConstructorProps
extends Frame.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
store: IntStore;
value: number;
}
}
/**
* A widget providing a frame with title, containing grouped radio
* buttons, each associated with an integer value and random user data.
*/
class IntRadioFrame extends Frame implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The %GimpIntStore from which the radio frame takes the values shown
* in the list.
*/
get store(): IntStore;
set store(val: IntStore);
/**
* The active value
*/
get value(): number;
set value(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](labels: string[]): IntRadioFrame;
// Conflicted with GimpUi.Frame.new
static ['new'](...args: never[]): any;
static new_from_store(title: string, store: IntStore): IntRadioFrame;
// Methods
get_active(): number;
/**
* Retrieves the user-data of the selected (active) item in the `radio_frame`.
* @returns %TRUE if @user_data has been set or %FALSE if no item was active.
*/
get_active_user_data(): [boolean, any];
/**
* Looks up the item that belongs to the given `value` and makes it the
* selected item in the `radio_frame`.
* @param value an integer value
* @returns %TRUE on success (value changed or not) or %FALSE if there was no item for this value.
*/
set_active(value: number): boolean;
/**
* Looks up the item that has the given `user_data` and makes it the
* selected item in the `radio_frame`.
* @param user_data an integer value
* @returns %TRUE on success or %FALSE if there was no item for this user-data.
*/
set_active_by_user_data(user_data?: any | null): boolean;
/**
* Sets a function that is used to decide about the sensitivity of radio
* buttons in the `radio_frame`. Use this if you want to set certain
* radio buttons insensitive.
*
* Calling gtk_widget_queue_draw() on the `radio_frame` will cause the
* sensitivity to be updated.
* @param func a function that returns a boolean value, or %NULL to unset
*/
set_sensitivity(func: IntRadioFrameSensitivityFunc): void;
/**
* Change the `frame'`s title, possibly with a mnemonic.
* @param title the frame title or %NULL for none.
* @param with_mnemonic whether @title has a mnemonic.
*/
set_title(title: string, with_mnemonic: 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 IntStore {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ListStore.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.TreeDragDest.ConstructorProps,
Gtk.TreeDragSource.ConstructorProps,
Gtk.TreeModel.ConstructorProps,
Gtk.TreeSortable.ConstructorProps {
user_data_type: GObject.GType;
userDataType: GObject.GType;
}
}
/**
* A model for integer based name-value pairs (e.g. enums)
*/
class IntStore
extends Gtk.ListStore
implements Gtk.Buildable, Gtk.TreeDragDest, Gtk.TreeDragSource, Gtk.TreeModel, Gtk.TreeSortable
{
static $gtype: GObject.GType;
// Properties
/**
* Sets the #GType for the GIMP_INT_STORE_USER_DATA column.
*
* You need to set this property when constructing the store if you want
* to use the GIMP_INT_STORE_USER_DATA column and want to have the store
* handle ref-counting of your user data.
*/
get user_data_type(): GObject.GType;
/**
* Sets the #GType for the GIMP_INT_STORE_USER_DATA column.
*
* You need to set this property when constructing the store if you want
* to use the GIMP_INT_STORE_USER_DATA column and want to have the store
* handle ref-counting of your user data.
*/
get userDataType(): GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](labels: string[]): IntStore;
// Conflicted with Gtk.ListStore.new
static ['new'](...args: never[]): any;
// Static methods
/**
* Iterate over the `model` looking for `user_data`.
* @param model a #GimpIntStore
* @param user_data a gpointer "user-data" to lookup in the @model
*/
static lookup_by_user_data(model: Gtk.TreeModel, user_data: any | null): [boolean, Gtk.TreeIter];
/**
* Iterate over the `model` looking for `value`.
* @param model a #GimpIntStore
* @param value an integer value to lookup in the @model
*/
static lookup_by_value(model: Gtk.TreeModel, value: number): [boolean, Gtk.TreeIter];
// 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: Gtk.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: Gtk.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: Gtk.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: Gtk.Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under ``.
* @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: Gtk.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: Gtk.Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the
* [GtkBuilder UI definition][BUILDER-UI]
* used to construct the `buildable`.
* @returns the name set with gtk_buildable_set_name()
*/
get_name(): string;
/**
* Called when the builder finishes the parsing of a
* [GtkBuilder UI definition][BUILDER-UI].
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Gtk.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: Gtk.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: Gtk.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: Gtk.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: Gtk.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: Gtk.Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under ``.
* @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: Gtk.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: Gtk.Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the
* [GtkBuilder UI definition][BUILDER-UI]
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* [GtkBuilder UI definition][BUILDER-UI].
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Gtk.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: Gtk.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;
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
* @returns whether a new row was created before position @dest
*/
drag_data_received(dest: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn’t exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
* @returns %TRUE if a drop is possible before @dest_path
*/
row_drop_possible(dest_path: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
*/
vfunc_drag_data_received(dest: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn’t exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
*/
vfunc_row_drop_possible(dest_path: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
* @returns %TRUE if the row was successfully deleted
*/
drag_data_delete(path: Gtk.TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @param selection_data a #GtkSelectionData to fill with data from the dragged row
* @returns %TRUE if data of the required type was provided
*/
drag_data_get(path: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn’t implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
* @returns %TRUE if the row can be dragged
*/
row_draggable(path: Gtk.TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
*/
vfunc_drag_data_delete(path: Gtk.TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @param selection_data a #GtkSelectionData to fill with data from the dragged row
*/
vfunc_drag_data_get(path: Gtk.TreePath, selection_data: Gtk.SelectionData): boolean;
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn’t implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
*/
vfunc_row_draggable(path: Gtk.TreePath): boolean;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child_model
* and `root` as the virtual root.
* @param root A #GtkTreePath or %NULL.
* @returns A new #GtkTreeModel.
*/
filter_new(root?: Gtk.TreePath | null): Gtk.TreeModel;
/**
* Calls func on each node in model in a depth-first fashion.
*
* If `func` returns %TRUE, then the tree ceases to be walked,
* and gtk_tree_model_foreach() returns.
* @param func a function to be called on each row
*/
foreach(func: Gtk.TreeModelForeachFunc): void;
/**
* Returns the type of the column.
* @param index_ the column index
* @returns the type of the column
*/
get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface.
*
* The flags are a bitwise combination of #GtkTreeModelFlags.
* The flags supported should not change during the lifetime
* of the `tree_model`.
* @returns the flags supported by this interface
*/
get_flags(): Gtk.TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`. If `path` does
* not exist, `iter` is set to an invalid iterator and %FALSE is returned.
* @param path the #GtkTreePath-struct
* @returns %TRUE, if @iter was set
*/
get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter];
/**
* Initializes `iter` with the first iterator in the tree
* (the one at the path "0") and returns %TRUE. Returns
* %FALSE if the tree is empty.
* @returns %TRUE, if @iter was set
*/
get_iter_first(): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to a valid iterator pointing to `path_string,` if it
* exists. Otherwise, `iter` is left invalid and %FALSE is returned.
* @param path_string a string representation of a #GtkTreePath-struct
* @returns %TRUE, if @iter was set
*/
get_iter_from_string(path_string: string): [boolean, Gtk.TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
* @returns the number of columns
*/
get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath-struct referenced by `iter`.
*
* This path should be freed with gtk_tree_path_free().
* @param iter the #GtkTreeIter-struct
* @returns a newly-created #GtkTreePath-struct
*/
get_path(iter: Gtk.TreeIter): Gtk.TreePath;
/**
* Generates a string representation of the iter.
*
* This string is a “:” separated list of numbers.
* For example, “4:10:0:3” would be an acceptable
* return value for this string.
* @param iter a #GtkTreeIter-struct
* @returns a newly-allocated string. Must be freed with g_free().
*/
get_string_from_iter(iter: Gtk.TreeIter): string;
/**
* Initializes and sets `value` to that at `column`.
*
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter the #GtkTreeIter-struct
* @param column the column to lookup the value at
*/
get_value(iter: Gtk.TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`.
*
* If `parent` has no children, %FALSE is returned and `iter` is
* set to be invalid. `parent` will remain a valid node after this
* function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* `gtk_tree_model_get_iter_first (tree_model, iter);`
* @param parent the #GtkTreeIter-struct, or %NULL
* @returns %TRUE, if @iter has been set to the first child
*/
iter_children(parent?: Gtk.TreeIter | null): [boolean, Gtk.TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter the #GtkTreeIter-struct to test for children
* @returns %TRUE if @iter has children
*/
iter_has_child(iter: Gtk.TreeIter): boolean;
/**
* Returns the number of children that `iter` has.
*
* As a special case, if `iter` is %NULL, then the number
* of toplevel nodes is returned.
* @param iter the #GtkTreeIter-struct, or %NULL
* @returns the number of children of @iter
*/
iter_n_children(iter?: Gtk.TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level.
*
* If there is no next `iter,` %FALSE is returned and `iter` is set
* to be invalid.
* @param iter the #GtkTreeIter-struct
* @returns %TRUE if @iter has been changed to the next node
*/
iter_next(iter: Gtk.TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index.
*
* The first index is 0. If `n` is too big, or `parent` has no children,
* `iter` is set to an invalid iterator and %FALSE is returned. `parent`
* will remain a valid node after this function has been called. As a
* special case, if `parent` is %NULL, then the `n-th` root node
* is set.
* @param parent the #GtkTreeIter-struct to get the child from, or %NULL.
* @param n the index of the desired child
* @returns %TRUE, if @parent has an @n-th child
*/
iter_nth_child(parent: Gtk.TreeIter | null, n: number): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to be the parent of `child`.
*
* If `child` is at the toplevel, and doesn’t have a parent, then
* `iter` is set to an invalid iterator and %FALSE is returned.
* `child` will remain a valid node after this function has been
* called.
*
* `iter` will be initialized before the lookup is performed, so `child`
* and `iter` cannot point to the same memory location.
* @param child the #GtkTreeIter-struct
* @returns %TRUE, if @iter is set to the parent of @child
*/
iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to point to the previous node at the current level.
*
* If there is no previous `iter,` %FALSE is returned and `iter` is
* set to be invalid.
* @param iter the #GtkTreeIter-struct
* @returns %TRUE if @iter has been changed to the previous node
*/
iter_previous(iter: Gtk.TreeIter): boolean;
/**
* Lets the tree ref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let
* caching models know when nodes are being displayed (and hence,
* whether or not to cache that node). Being displayed means a node
* is in an expanded branch, regardless of whether the node is currently
* visible in the viewport. For example, a file-system based model
* would not want to keep the entire file-hierarchy in memory,
* just the sections that are currently being displayed by
* every current view.
*
* A model should be expected to be able to get an iter independent
* of its reffed state.
* @param iter the #GtkTreeIter-struct
*/
ref_node(iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-changed signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-deleted signal on `tree_model`.
*
* This should be called by models after a row has been removed.
* The location pointed to by `path` should be the location that
* the row previously was at. It may not be a valid location anymore.
*
* Nodes that are deleted are not unreffed, this means that any
* outstanding references on the deleted node should not be released.
* @param path a #GtkTreePath-struct pointing to the previous location of the deleted row
*/
row_deleted(path: Gtk.TreePath): void;
/**
* Emits the #GtkTreeModel::row-has-child-toggled signal on
* `tree_model`. This should be called by models after the child
* state of a node changes.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-inserted signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the inserted row
* @param iter a valid #GtkTreeIter-struct pointing to the inserted row
*/
row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::rows-reordered signal on `tree_model`.
*
* This should be called by models when their rows have been
* reordered.
* @param path a #GtkTreePath-struct pointing to the tree node whose children have been reordered
* @param iter a valid #GtkTreeIter-struct pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order`[newpos] = oldpos`
*/
rows_reordered(path: Gtk.TreePath, iter: Gtk.TreeIter | null, new_order: number[]): void;
/**
* Lets the tree unref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons. For more information on what
* this means, see gtk_tree_model_ref_node().
*
* Please note that nodes that are deleted are not unreffed.
* @param iter the #GtkTreeIter-struct
*/
unref_node(iter: Gtk.TreeIter): void;
/**
* Returns the type of the column.
* @param index_ the column index
*/
vfunc_get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface.
*
* The flags are a bitwise combination of #GtkTreeModelFlags.
* The flags supported should not change during the lifetime
* of the `tree_model`.
*/
vfunc_get_flags(): Gtk.TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`. If `path` does
* not exist, `iter` is set to an invalid iterator and %FALSE is returned.
* @param path the #GtkTreePath-struct
*/
vfunc_get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
*/
vfunc_get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath-struct referenced by `iter`.
*
* This path should be freed with gtk_tree_path_free().
* @param iter the #GtkTreeIter-struct
*/
vfunc_get_path(iter: Gtk.TreeIter): Gtk.TreePath;
/**
* Initializes and sets `value` to that at `column`.
*
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter the #GtkTreeIter-struct
* @param column the column to lookup the value at
*/
vfunc_get_value(iter: Gtk.TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`.
*
* If `parent` has no children, %FALSE is returned and `iter` is
* set to be invalid. `parent` will remain a valid node after this
* function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* `gtk_tree_model_get_iter_first (tree_model, iter);`
* @param parent the #GtkTreeIter-struct, or %NULL
*/
vfunc_iter_children(parent?: Gtk.TreeIter | null): [boolean, Gtk.TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter the #GtkTreeIter-struct to test for children
*/
vfunc_iter_has_child(iter: Gtk.TreeIter): boolean;
/**
* Returns the number of children that `iter` has.
*
* As a special case, if `iter` is %NULL, then the number
* of toplevel nodes is returned.
* @param iter the #GtkTreeIter-struct, or %NULL
*/
vfunc_iter_n_children(iter?: Gtk.TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level.
*
* If there is no next `iter,` %FALSE is returned and `iter` is set
* to be invalid.
* @param iter the #GtkTreeIter-struct
*/
vfunc_iter_next(iter: Gtk.TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index.
*
* The first index is 0. If `n` is too big, or `parent` has no children,
* `iter` is set to an invalid iterator and %FALSE is returned. `parent`
* will remain a valid node after this function has been called. As a
* special case, if `parent` is %NULL, then the `n-th` root node
* is set.
* @param parent the #GtkTreeIter-struct to get the child from, or %NULL.
* @param n the index of the desired child
*/
vfunc_iter_nth_child(parent: Gtk.TreeIter | null, n: number): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to be the parent of `child`.
*
* If `child` is at the toplevel, and doesn’t have a parent, then
* `iter` is set to an invalid iterator and %FALSE is returned.
* `child` will remain a valid node after this function has been
* called.
*
* `iter` will be initialized before the lookup is performed, so `child`
* and `iter` cannot point to the same memory location.
* @param child the #GtkTreeIter-struct
*/
vfunc_iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to point to the previous node at the current level.
*
* If there is no previous `iter,` %FALSE is returned and `iter` is
* set to be invalid.
* @param iter the #GtkTreeIter-struct
*/
vfunc_iter_previous(iter: Gtk.TreeIter): boolean;
/**
* Lets the tree ref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let
* caching models know when nodes are being displayed (and hence,
* whether or not to cache that node). Being displayed means a node
* is in an expanded branch, regardless of whether the node is currently
* visible in the viewport. For example, a file-system based model
* would not want to keep the entire file-hierarchy in memory,
* just the sections that are currently being displayed by
* every current view.
*
* A model should be expected to be able to get an iter independent
* of its reffed state.
* @param iter the #GtkTreeIter-struct
*/
vfunc_ref_node(iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-changed signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
vfunc_row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-deleted signal on `tree_model`.
*
* This should be called by models after a row has been removed.
* The location pointed to by `path` should be the location that
* the row previously was at. It may not be a valid location anymore.
*
* Nodes that are deleted are not unreffed, this means that any
* outstanding references on the deleted node should not be released.
* @param path a #GtkTreePath-struct pointing to the previous location of the deleted row
*/
vfunc_row_deleted(path: Gtk.TreePath): void;
/**
* Emits the #GtkTreeModel::row-has-child-toggled signal on
* `tree_model`. This should be called by models after the child
* state of a node changes.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
vfunc_row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-inserted signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the inserted row
* @param iter a valid #GtkTreeIter-struct pointing to the inserted row
*/
vfunc_row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Lets the tree unref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons. For more information on what
* this means, see gtk_tree_model_ref_node().
*
* Please note that nodes that are deleted are not unreffed.
* @param iter the #GtkTreeIter-struct
*/
vfunc_unref_node(iter: Gtk.TreeIter): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @returns %TRUE if the sort column is not one of the special sort column ids.
*/
get_sort_column_id(): [boolean, number, Gtk.SortType];
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
* @returns %TRUE, if the model has a default sort function
*/
has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can’t go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_default_sort_func(sort_func: Gtk.TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
*
* - %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function
* will be used, if it is set
*
* - %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
set_sort_column_id(sort_column_id: number, order: Gtk.SortType | null): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_sort_func(
sort_column_id: number,
sort_func: Gtk.TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
sort_column_changed(): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
*/
vfunc_get_sort_column_id(): [boolean, number, Gtk.SortType];
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
*/
vfunc_has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can’t go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_default_sort_func(sort_func: Gtk.TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
*
* - %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function
* will be used, if it is set
*
* - %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
vfunc_set_sort_column_id(sort_column_id: number, order: Gtk.SortType): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_sort_func(
sort_column_id: number,
sort_func: Gtk.TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
vfunc_sort_column_changed(): 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;
// Conflicted with Gtk.ListStore.set
set(...args: never[]): any;
/**
* 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 LabelColor {
// Signal callback interfaces
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Labeled.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
editable: boolean;
value: Gegl.Color;
}
}
/**
* This widget is a subclass of #GimpLabeled with a #GtkColor.
*/
class LabelColor extends Labeled implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* Whether the color can be edited.
*/
get editable(): boolean;
set editable(val: boolean);
/**
* The currently set value.
*/
get value(): Gegl.Color;
set value(val: Gegl.Color);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](label: string, color: Gegl.Color, editable: boolean): LabelColor;
// Conflicted with Gtk.Grid.new
static ['new'](...args: never[]): any;
// 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: 'value-changed', callback: (_source: this) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this) => void): number;
emit(signal: 'value-changed'): void;
// Methods
/**
* This function returns the color widget packed in `color,` which can be
* either a #GimpColorButton (if the `color` is editable) or a
* #GimpColorArea otherwise.
* @returns The color widget packed in @color.
*/
get_color_widget(): Gtk.Widget;
/**
* This function returns the value shown by `color`.
* @returns a copy of the [class@Gegl.Color] used by the widget.
*/
get_value(): Gegl.Color;
/**
* This function tells whether the color widget allows to edit the
* color.
* @returns %TRUE if the color is editable.
*/
is_editable(): boolean;
/**
* Changes the editability of the color.
* @param editable Whether the color should be editable.
*/
set_editable(editable: boolean): void;
/**
* This function sets the value in the #GtkColor inside `color`.
* @param value A new value.
*/
set_value(value: Gegl.Color): 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 LabelEntry {
// Signal callback interfaces
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Labeled.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
value: string;
}
}
/**
* This widget is a subclass of #GimpLabeled with a #GtkEntry.
*/
class LabelEntry extends Labeled implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The currently set value.
*/
get value(): string;
set value(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](label: string): LabelEntry;
// Conflicted with Gtk.Grid.new
static ['new'](...args: never[]): any;
// 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: 'value-changed', callback: (_source: this) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this) => void): number;
emit(signal: 'value-changed'): void;
// Methods
/**
* This function returns the #GtkEntry packed in `entry`.
* @returns The #GtkEntry contained in @entry.
*/
get_entry(): Gtk.Widget;
/**
* This function returns the value shown by `entry`.
* @returns The value currently set.
*/
get_value(): string;
/**
* This function sets the value in the #GtkEntry inside `entry`.
* @param value A new value.
*/
set_value(value: string): 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 LabelIntWidget {
// Signal callback interfaces
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Labeled.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
value: number;
widget: Gtk.Widget | any;
}
}
/**
* This widget is a subclass of #GimpLabeled.
*/
class LabelIntWidget extends Labeled implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The currently set value.
*/
get value(): number;
set value(val: number);
/**
* The widget holding an integer value.
*/
// This accessor conflicts with a property or field in a parent class or interface.
widget: Gtk.Widget | any;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](text: string, widget: Gtk.Widget): LabelIntWidget;
// Conflicted with Gtk.Grid.new
static ['new'](...args: never[]): any;
// 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: 'value-changed', callback: (_source: this) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this) => void): number;
emit(signal: 'value-changed'): void;
// Methods
get_widget(): Gtk.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 LabelSpin {
// Signal callback interfaces
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Labeled.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
digits: number;
lower: number;
upper: number;
value: number;
}
}
/**
* This widget is a subclass of #GimpLabeled with a #GimpSpinButton.
*/
class LabelSpin extends Labeled implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The number of decimal places to display. If -1, then the number is
* estimated.
*/
get digits(): number;
set digits(val: number);
/**
* The lower bound of the spin button.
*/
get lower(): number;
set lower(val: number);
/**
* The upper bound of the spin button.
*/
get upper(): number;
set upper(val: number);
/**
* The currently set value.
*/
get value(): number;
set value(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](text: string, value: number, lower: number, upper: number, digits: number): LabelSpin;
// Conflicted with Gtk.Grid.new
static ['new'](...args: never[]): any;
// 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: '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_value_changed(): void;
// Methods
/**
* This function returns the #GimpSpinButton packed in `spin`.
* @returns The #GimpSpinButton contained in @spin.
*/
get_spin_button(): Gtk.Widget;
/**
* This function returns the value shown by `spin`.
* @returns The value currently set.
*/
get_value(): number;
/**
* Set the number of decimal place to display in the `spin'`s entry.
* If `digits` is -1, then it will also be estimated based on `spin'`s
* range. Digits estimation will always be at least 1, so if you want to
* show integer values only, set 0 explicitly.
* @param digits the number of decimal places to display.
*/
set_digits(digits: number): void;
/**
* Set the step and page increments of the spin button.
* By default, these increment values are automatically computed
* depending on the range based on common usage. So you will likely not
* need to run this for most case. Yet if you want specific increments
* (which the widget cannot guess), you can call this function.
* @param step the step increment.
* @param page the page increment.
*/
set_increments(step: number, page: number): void;
/**
* This function sets the value shown by `spin`.
* @param value A new value.
*/
set_value(value: 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;
/**
* 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 LabelStringWidget {
// Signal callback interfaces
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Labeled.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
value: string;
widget: Gtk.Widget | any;
}
}
/**
* This widget is a subclass of #GimpLabeled.
*/
class LabelStringWidget extends Labeled implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The currently set value.
*/
get value(): string;
set value(val: string);
/**
* The widget holding a string property named "value".
*/
// This accessor conflicts with a property or field in a parent class or interface.
widget: Gtk.Widget | any;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](text: string, widget: Gtk.Widget): LabelStringWidget;
// Conflicted with Gtk.Grid.new
static ['new'](...args: never[]): any;
// 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: 'value-changed', callback: (_source: this) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this) => void): number;
emit(signal: 'value-changed'): void;
// Methods
get_widget(): Gtk.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 Labeled {
// Signal callback interfaces
interface MnemonicWidgetChanged {
(object: Gtk.Widget): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Grid.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
label: string;
}
}
/**
* This widget is a #GtkGrid showing a #GtkLabel used as mnemonic on
* another widget.
*/
class Labeled extends Gtk.Grid implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* Label text with pango markup and mnemonic.
*/
get label(): string;
set label(val: string);
// 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: 'mnemonic-widget-changed', callback: (_source: this, object: Gtk.Widget) => void): number;
connect_after(
signal: 'mnemonic-widget-changed',
callback: (_source: this, object: Gtk.Widget) => void,
): number;
emit(signal: 'mnemonic-widget-changed', object: Gtk.Widget): void;
// Virtual methods
vfunc_mnemonic_widget_changed(widget: Gtk.Widget): void;
// Methods
/**
* This function returns the #GtkLabel packed in `labeled`. This can be
* useful if you need to customize some aspects of the widget.
* @returns The #GtkLabel contained in @labeled.
*/
get_label(): Gtk.Label;
/**
* This function will return exactly what you entered with
* gimp_labeled_set_text() or through the "label" property because this
* class expects labels to have mnemonics (and allows Pango formatting).
* To obtain instead the text as displayed with mnemonics and markup
* removed, call:
*
* ```c
* gtk_label_get_text (GTK_LABEL (gimp_labeled_get_label (`labeled)`));
* ```
*
* @returns the label text as entered, which includes pango markup and mnemonics similarly to gtk_label_get_label().
*/
get_text(): string;
/**
* This is the equivalent of running
* gtk_label_set_markup_with_mnemonic() on the #GtkLabel as a
* #GimpLabeled expects a mnemonic. Pango markup are also allowed.
* @param text label text with Pango markup and mnemonic.
*/
set_text(text: string): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 LayerComboBox {
// Constructor properties interface
interface ConstructorProps
extends IntComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {}
}
class LayerComboBox
extends IntComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](constraint?: ItemConstraintFunc | null): LayerComboBox;
// Conflicted with GimpUi.IntComboBox.new
static ['new'](...args: never[]): any;
// Inherited properties
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace MemsizeEntry {
// Signal callback interfaces
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* Similar to a #GimpSizeEntry but instead of lengths, this widget is
* used to let the user enter memory sizes. A combo box allows one to
* switch between Kilobytes, Megabytes and Gigabytes. Used in the GIMP
* preferences dialog.
*/
class MemsizeEntry extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](value: number, lower: number, upper: number): MemsizeEntry;
// Conflicted with Gtk.Box.new
static ['new'](...args: never[]): any;
// 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: 'value-changed', callback: (_source: this) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this) => void): number;
emit(signal: 'value-changed'): void;
// Methods
get_spinbutton(): Gtk.SpinButton;
/**
* Retrieves the current value from a #GimpMemsizeEntry.
* @returns the current value of @entry (in Bytes).
*/
get_value(): number;
/**
* Sets the `entry'`s value. Please note that the #GimpMemsizeEntry rounds
* the value to full Kilobytes.
* @param value the new value (in Bytes)
*/
set_value(value: number): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 NumberPairEntry {
// Signal callback interfaces
interface NumbersChanged {
(): void;
}
interface RatioChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Entry.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.Editable.ConstructorProps {
allow_simplification: boolean;
allowSimplification: boolean;
aspect: AspectType;
default_left_number: number;
defaultLeftNumber: number;
default_right_number: number;
defaultRightNumber: number;
default_text: string;
defaultText: string;
left_number: number;
leftNumber: number;
max_valid_value: number;
maxValidValue: number;
min_valid_value: number;
minValidValue: number;
ratio: number;
right_number: number;
rightNumber: number;
separators: string;
user_override: boolean;
userOverride: boolean;
}
}
/**
* A #GtkEntry subclass to enter ratios.
*/
class NumberPairEntry
extends Gtk.Entry
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.Editable
{
static $gtype: GObject.GType;
// Properties
get allow_simplification(): boolean;
set allow_simplification(val: boolean);
get allowSimplification(): boolean;
set allowSimplification(val: boolean);
get aspect(): AspectType;
set aspect(val: AspectType);
get default_left_number(): number;
set default_left_number(val: number);
get defaultLeftNumber(): number;
set defaultLeftNumber(val: number);
get default_right_number(): number;
set default_right_number(val: number);
get defaultRightNumber(): number;
set defaultRightNumber(val: number);
get default_text(): string;
set default_text(val: string);
get defaultText(): string;
set defaultText(val: string);
get left_number(): number;
set left_number(val: number);
get leftNumber(): number;
set leftNumber(val: number);
get max_valid_value(): number;
set max_valid_value(val: number);
get maxValidValue(): number;
set maxValidValue(val: number);
get min_valid_value(): number;
set min_valid_value(val: number);
get minValidValue(): number;
set minValidValue(val: number);
get ratio(): number;
set ratio(val: number);
get right_number(): number;
set right_number(val: number);
get rightNumber(): number;
set rightNumber(val: number);
get separators(): string;
get user_override(): boolean;
set user_override(val: boolean);
get userOverride(): boolean;
set userOverride(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
separators: string,
allow_simplification: boolean,
min_valid_value: number,
max_valid_value: number,
): NumberPairEntry;
// Conflicted with Gtk.Entry.new
static ['new'](...args: never[]): any;
// 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: 'numbers-changed', callback: (_source: this) => void): number;
connect_after(signal: 'numbers-changed', callback: (_source: this) => void): number;
emit(signal: 'numbers-changed'): void;
connect(signal: 'ratio-changed', callback: (_source: this) => void): number;
connect_after(signal: 'ratio-changed', callback: (_source: this) => void): number;
emit(signal: 'ratio-changed'): void;
// Methods
/**
* Gets the aspect of the ratio displayed by a #GimpNumberPairEntry.
* @returns The entry's current aspect.
*/
get_aspect(): AspectType;
get_default_text(): string | null;
get_default_values(): [number, number];
/**
* Retrieves the ratio of the numbers displayed by a #GimpNumberPairEntry.
* @returns The ratio value.
*/
get_ratio(): number;
get_user_override(): boolean;
/**
* Gets the numbers displayed by a #GimpNumberPairEntry.
*/
get_values(): [number, number];
/**
* Sets the aspect of the ratio by swapping the left_number and
* right_number if necessary (or setting them to 1.0 in case that
* `aspect` is %GIMP_ASPECT_SQUARE).
* @param aspect The new aspect.
*/
set_aspect(aspect: AspectType | null): void;
/**
* Causes the entry to show a given string when in automatic mode,
* instead of the default numbers. The only thing this does is making
* the #GimpNumberPairEntry showing this string, the internal state
* and API calls are not affected.
*
* Set the default string to %NULL to display default values as
* normal.
* @param string Default string.
*/
set_default_text(string: string): void;
set_default_values(left: number, right: number): void;
/**
* Sets the numbers of the #GimpNumberPairEntry to have the desired
* ratio. If the new ratio is different than the previous ratio, the
* "ratio-changed" signal is emitted.
*
* An attempt is made to convert the decimal number into a fraction
* with left_number and right_number < 1000.
* @param ratio Ratio to set in the widget.
*/
set_ratio(ratio: number): void;
/**
* When the entry is not in user overridden mode, the values will
* change when the default values are changed. When in user overridden
* mode, setting default values will not affect the active values.
* @param user_override %TRUE sets the entry in user overridden mode, %FALSE disables.
*/
set_user_override(user_override: boolean): void;
/**
* Forces setting the numbers displayed by a #GimpNumberPairEntry,
* ignoring if the user has set their own value. The state of
* user-override will not be changed.
* @param left Left number in the entry.
* @param right Right number in the entry.
*/
set_values(left: number, right: number): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Copies the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
copy_clipboard(): void;
/**
* Removes the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
cut_clipboard(): void;
/**
* Deletes the currently selected text of the editable.
* This call doesn’t do anything if there is no selected text.
*/
delete_selection(): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
delete_text(start_pos: number, end_pos: number): void;
/**
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the characters
* retrieved are those characters from `start_pos` to the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of text
* @param end_pos end of text
* @returns a pointer to the contents of the widget as a string. This string is allocated by the #GtkEditable implementation and should be freed by the caller.
*/
get_chars(start_pos: number, end_pos: number): string;
/**
* Retrieves whether `editable` is editable. See
* gtk_editable_set_editable().
* @returns %TRUE if @editable is editable.
*/
get_editable(): boolean;
/**
* Retrieves the current position of the cursor relative to the start
* of the content of the editable.
*
* Note that this position is in characters, not in bytes.
* @returns the cursor position
*/
get_position(): number;
/**
* Retrieves the selection bound of the editable. start_pos will be filled
* with the start of the selection and `end_pos` with end. If no text was
* selected both will be identical and %FALSE will be returned.
*
* Note that positions are specified in characters, not bytes.
* @returns %TRUE if an area is selected, %FALSE otherwise
*/
get_selection_bounds(): [boolean, number, number];
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Pastes the content of the clipboard to the current position of the
* cursor in the editable.
*/
paste_clipboard(): void;
/**
* Selects a region of text. The characters that are selected are
* those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the
* characters selected are those characters from `start_pos` to
* the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of region
* @param end_pos end of region
*/
select_region(start_pos: number, end_pos: number): void;
/**
* Determines if the user can edit the text in the editable
* widget or not.
* @param is_editable %TRUE if the user is allowed to edit the text in the widget
*/
set_editable(is_editable: boolean): void;
/**
* Sets the cursor position in the editable to the given value.
*
* The cursor is displayed before the character with the given (base 0)
* index in the contents of the editable. The value must be less than or
* equal to the number of characters in the editable. A value of -1
* indicates that the position should be set after the last character
* of the editable. Note that `position` is in characters, not in bytes.
* @param position the position of the cursor
*/
set_position(position: number): void;
vfunc_changed(): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
vfunc_delete_text(start_pos: number, end_pos: number): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
vfunc_do_delete_text(start_pos: number, end_pos: number): void;
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
vfunc_do_insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the characters
* retrieved are those characters from `start_pos` to the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of text
* @param end_pos end of text
*/
vfunc_get_chars(start_pos: number, end_pos: number): string;
/**
* Retrieves the current position of the cursor relative to the start
* of the content of the editable.
*
* Note that this position is in characters, not in bytes.
*/
vfunc_get_position(): number;
/**
* Retrieves the selection bound of the editable. start_pos will be filled
* with the start of the selection and `end_pos` with end. If no text was
* selected both will be identical and %FALSE will be returned.
*
* Note that positions are specified in characters, not bytes.
*/
vfunc_get_selection_bounds(): [boolean, number, number];
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
vfunc_insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Sets the cursor position in the editable to the given value.
*
* The cursor is displayed before the character with the given (base 0)
* index in the contents of the editable. The value must be less than or
* equal to the number of characters in the editable. A value of -1
* indicates that the position should be set after the last character
* of the editable. Note that `position` is in characters, not in bytes.
* @param position the position of the cursor
*/
vfunc_set_position(position: number): void;
/**
* Selects a region of text. The characters that are selected are
* those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the
* characters selected are those characters from `start_pos` to
* the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of region
* @param end_pos end of region
*/
vfunc_set_selection_bounds(start_pos: number, end_pos: number): 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace OffsetArea {
// Signal callback interfaces
interface OffsetsChanged {
(object: number, p0: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.DrawingArea.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
/**
* Widget to control image offsets.
*/
class OffsetArea extends Gtk.DrawingArea implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](orig_width: number, orig_height: number): OffsetArea;
// Conflicted with Gtk.DrawingArea.new
static ['new'](...args: never[]): any;
// 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: 'offsets-changed', callback: (_source: this, object: number, p0: number) => void): number;
connect_after(
signal: 'offsets-changed',
callback: (_source: this, object: number, p0: number) => void,
): number;
emit(signal: 'offsets-changed', object: number, p0: number): void;
// Methods
/**
* Sets the offsets of the image/drawable displayed by the #GimpOffsetArea.
* It does not emit the "offsets-changed" signal.
* @param offset_x the X offset
* @param offset_y the Y offset
*/
set_offsets(offset_x: number, offset_y: number): void;
/**
* Sets the pixbuf which represents the original image/drawable which
* is being offset.
* @param pixbuf a #GdkPixbuf.
*/
set_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the size of the image/drawable displayed by the #GimpOffsetArea.
* If the offsets change as a result of this change, the "offsets-changed"
* signal is emitted.
* @param width the new width
* @param height the new height
*/
set_size(width: number, height: 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;
/**
* 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 PageSelector {
// Signal callback interfaces
interface Activate {
(): void;
}
interface SelectionChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
n_pages: number;
nPages: number;
target: PageSelectorTarget;
}
}
/**
* Use this for example for specifying what pages to import from
* a PDF or PS document.
*/
class PageSelector extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The number of pages of the document to open.
*/
get n_pages(): number;
set n_pages(val: number);
/**
* The number of pages of the document to open.
*/
get nPages(): number;
set nPages(val: number);
/**
* The target to open the document to.
*/
get target(): PageSelectorTarget;
set target(val: PageSelectorTarget);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PageSelector;
// 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;
connect(signal: 'selection-changed', callback: (_source: this) => void): number;
connect_after(signal: 'selection-changed', callback: (_source: this) => void): number;
emit(signal: 'selection-changed'): void;
// Methods
get_n_pages(): number;
get_page_label(page_no: number): string | null;
get_page_thumbnail(page_no: number): GdkPixbuf.Pixbuf | null;
get_selected_pages(): number[];
get_selected_range(): string;
get_target(): PageSelectorTarget;
page_is_selected(page_no: number): boolean;
/**
* Selects all pages.
*/
select_all(): void;
/**
* Adds a page to the selection.
* @param page_no The number of the page to select.
*/
select_page(page_no: number): void;
/**
* Selects the pages described by `range`. The range string is a
* user-editable list of pages and ranges, e.g. "1,3,5-7,9-12,14".
* Note that the page numbering in the range string starts with 1,
* not 0.
*
* Invalid pages and ranges will be silently ignored, duplicate and
* overlapping pages and ranges will be merged.
* @param range A string representing the set of selected pages.
*/
select_range(range: string): void;
/**
* Sets the number of pages in the document to open.
* @param n_pages The number of pages.
*/
set_n_pages(n_pages: number): void;
/**
* Sets the label of the specified page.
* @param page_no The number of the page to set the label for.
* @param label The label.
*/
set_page_label(page_no: number, label: string): void;
/**
* Sets the thumbnail for given `page_no`. A default "page" icon will
* be used if no page thumbnail is set.
* @param page_no The number of the page to set the thumbnail for.
* @param thumbnail The thumbnail pixbuf.
*/
set_page_thumbnail(page_no: number, thumbnail: GdkPixbuf.Pixbuf): void;
set_target(target: PageSelectorTarget | null): void;
/**
* Unselects all pages.
*/
unselect_all(): void;
/**
* Removes a page from the selection.
* @param page_no The number of the page to unselect.
*/
unselect_page(page_no: number): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 PaletteChooser {
// Constructor properties interface
interface ConstructorProps
extends ResourceChooser.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* A button which pops up a palette selection dialog.
*/
class PaletteChooser extends ResourceChooser implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title?: string | null, label?: string | null, palette?: Gimp.Palette | null): PaletteChooser;
// Conflicted with Gtk.Box.new
static ['new'](...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;
/**
* 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 PathComboBox {
// Constructor properties interface
interface ConstructorProps
extends IntComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {}
}
class PathComboBox
extends IntComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](constraint?: ItemConstraintFunc | null): PathComboBox;
// Conflicted with GimpUi.IntComboBox.new
static ['new'](...args: never[]): any;
// Inherited properties
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace PathEditor {
// Signal callback interfaces
interface PathChanged {
(): void;
}
interface WritableChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* This widget is used to edit file search paths.
*
* It shows a list of all directories which are in the search
* path. You can click a directory to select it. The widget provides a
* #GimpFileEntry to change the currently selected directory.
*
* There are buttons to add or delete directories as well as "up" and
* "down" buttons to change the order in which the directories will be
* searched.
*
* Whenever the user adds, deletes, changes or reorders a directory of
* the search path, the "path_changed" signal will be emitted.
*/
class PathEditor extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title: string, path?: string | null): PathEditor;
// Conflicted with Gtk.Box.new
static ['new'](...args: never[]): any;
// 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: 'path-changed', callback: (_source: this) => void): number;
connect_after(signal: 'path-changed', callback: (_source: this) => void): number;
emit(signal: 'path-changed'): void;
connect(signal: 'writable-changed', callback: (_source: this) => void): number;
connect_after(signal: 'writable-changed', callback: (_source: this) => void): number;
emit(signal: 'writable-changed'): void;
// Methods
get_dir_writable(directory: string): boolean;
/**
* The elements of the returned search path string are separated with the
* #G_SEARCHPATH_SEPARATOR character.
*
* Note that you have to g_free() the returned string.
* @returns The search path the user has selected in the path editor.
*/
get_path(): string;
// Conflicted with Gtk.Widget.get_path
get_path(...args: never[]): any;
get_writable_path(): string;
set_dir_writable(directory: string, writable: boolean): void;
/**
* The elements of the initial search path must be separated with the
* %G_SEARCHPATH_SEPARATOR character.
* @param path The new path to set.
*/
set_path(path: string): void;
set_writable_path(path: string): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 PatternChooser {
// Constructor properties interface
interface ConstructorProps
extends ResourceChooser.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* A button which pops up a pattern selection dialog.
*
* Note that this widget draws itself using `GEGL` code. You **must** call
* [func`Gegl`.init] first to be able to use this chooser.
*/
class PatternChooser extends ResourceChooser implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title?: string | null, label?: string | null, pattern?: Gimp.Pattern | null): PatternChooser;
// Conflicted with Gtk.Box.new
static ['new'](...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;
/**
* 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 PickButton {
// Signal callback interfaces
interface ColorPicked {
(color: Gegl.Color): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Actionable.ConstructorProps,
Gtk.Activatable.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
/**
* #GimpPickButton is a specialized button. When clicked, it changes
* the cursor to a color-picker pipette and allows the user to pick a
* color from any point on the screen.
*/
class PickButton
extends Gtk.Button
implements Atk.ImplementorIface, Gtk.Actionable, Gtk.Activatable, Gtk.Buildable
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PickButton;
// 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: 'color-picked', callback: (_source: this, color: Gegl.Color) => void): number;
connect_after(signal: 'color-picked', callback: (_source: this, color: Gegl.Color) => void): number;
emit(signal: 'color-picked', color: Gegl.Color): void;
// Virtual methods
vfunc_color_picked(color: Gegl.Color): void;
// Inherited properties
get action_name(): string;
set action_name(val: string);
get actionName(): string;
set actionName(val: string);
get action_target(): GLib.Variant;
set action_target(val: GLib.Variant);
get actionTarget(): GLib.Variant;
set actionTarget(val: GLib.Variant);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* > #GtkActivatable implementors need to handle the this property and
* > call gtk_activatable_do_set_related_action() when it changes.
*/
get related_action(): Gtk.Action;
set related_action(val: Gtk.Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* > #GtkActivatable implementors need to handle the this property and
* > call gtk_activatable_do_set_related_action() when it changes.
*/
get relatedAction(): Gtk.Action;
set relatedAction(val: Gtk.Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* > #GtkActivatable implementors need to handle this property
* > and call gtk_activatable_sync_action_properties() on the activatable
* > widget when it changes.
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* > #GtkActivatable implementors need to handle this property
* > and call gtk_activatable_sync_action_properties() on the activatable
* > widget when it changes.
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Gets the action name for `actionable`.
*
* See gtk_actionable_set_action_name() for more information.
* @returns the action name, or %NULL if none is set
*/
get_action_name(): string | null;
/**
* Gets the current target value of `actionable`.
*
* See gtk_actionable_set_action_target_value() for more information.
* @returns the current target value
*/
get_action_target_value(): GLib.Variant;
/**
* Specifies the name of the action with which this widget should be
* associated. If `action_name` is %NULL then the widget will be
* unassociated from any previous action.
*
* Usually this function is used when the widget is located (or will be
* located) within the hierarchy of a #GtkApplicationWindow.
*
* Names are of the form “win.save” or “app.quit” for actions on the
* containing #GtkApplicationWindow or its associated #GtkApplication,
* respectively. This is the same form used for actions in the #GMenu
* associated with the window.
* @param action_name an action name, or %NULL
*/
set_action_name(action_name?: string | null): void;
/**
* Sets the target value of an actionable widget.
*
* If `target_value` is %NULL then the target value is unset.
*
* The target value has two purposes. First, it is used as the
* parameter to activation of the action associated with the
* #GtkActionable widget. Second, it is used to determine if the widget
* should be rendered as “active” — the widget is active if the state
* is equal to the given target.
*
* Consider the example of associating a set of buttons with a #GAction
* with string state in a typical “radio button” situation. Each button
* will be associated with the same action, but with a different target
* value for that action. Clicking on a particular button will activate
* the action with the target of that button, which will typically cause
* the action’s state to change to that value. Since the action’s state
* is now equal to the target value of the button, the button will now
* be rendered as active (and the other buttons, with different targets,
* rendered inactive).
* @param target_value a #GVariant to set as the target value, or %NULL
*/
set_action_target_value(target_value?: GLib.Variant | null): void;
/**
* Sets the action-name and associated string target value of an
* actionable widget.
*
* `detailed_action_name` is a string in the format accepted by
* g_action_parse_detailed_name().
*
* (Note that prior to version 3.22.25,
* this function is only usable for actions with a simple "s" target, and
* `detailed_action_name` must be of the form `"action::target"` where
* `action` is the action name and `target` is the string to use
* as the target.)
* @param detailed_action_name the detailed action name
*/
set_detailed_action_name(detailed_action_name: string): void;
/**
* Gets the action name for `actionable`.
*
* See gtk_actionable_set_action_name() for more information.
*/
vfunc_get_action_name(): string | null;
/**
* Gets the current target value of `actionable`.
*
* See gtk_actionable_set_action_target_value() for more information.
*/
vfunc_get_action_target_value(): GLib.Variant;
/**
* Specifies the name of the action with which this widget should be
* associated. If `action_name` is %NULL then the widget will be
* unassociated from any previous action.
*
* Usually this function is used when the widget is located (or will be
* located) within the hierarchy of a #GtkApplicationWindow.
*
* Names are of the form “win.save” or “app.quit” for actions on the
* containing #GtkApplicationWindow or its associated #GtkApplication,
* respectively. This is the same form used for actions in the #GMenu
* associated with the window.
* @param action_name an action name, or %NULL
*/
vfunc_set_action_name(action_name?: string | null): void;
/**
* Sets the target value of an actionable widget.
*
* If `target_value` is %NULL then the target value is unset.
*
* The target value has two purposes. First, it is used as the
* parameter to activation of the action associated with the
* #GtkActionable widget. Second, it is used to determine if the widget
* should be rendered as “active” — the widget is active if the state
* is equal to the given target.
*
* Consider the example of associating a set of buttons with a #GAction
* with string state in a typical “radio button” situation. Each button
* will be associated with the same action, but with a different target
* value for that action. Clicking on a particular button will activate
* the action with the target of that button, which will typically cause
* the action’s state to change to that value. Since the action’s state
* is now equal to the target value of the button, the button will now
* be rendered as active (and the other buttons, with different targets,
* rendered inactive).
* @param target_value a #GVariant to set as the target value, or %NULL
*/
vfunc_set_action_target_value(target_value?: GLib.Variant | null): void;
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action’s proxy list.
*
* > Be careful to call this before setting the local
* > copy of the #GtkAction property, since this function uses
* > gtk_activatable_get_related_action() to retrieve the
* > previous action.
* @param action the #GtkAction to set
*/
do_set_related_action(action: Gtk.Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Gtk.Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* > #GtkActivatable implementors need to handle the #GtkActivatable:related-action
* > property and call gtk_activatable_do_set_related_action() when it changes.
* @param action the #GtkAction to set
*/
set_related_action(action: Gtk.Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* > #GtkActivatable implementors need to handle the
* > #GtkActivatable:use-action-appearance property and call
* > gtk_activatable_sync_action_properties() to update `activatable`
* > if needed.
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable:related-action property is set
* or unset and by the implementing class when
* #GtkActivatable:use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Gtk.Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable:related-action property is set
* or unset and by the implementing class when
* #GtkActivatable:use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Gtk.Action | null): void;
/**
* Called to update the activatable when its related action’s properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Gtk.Action, property_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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace Preview {
// Signal callback interfaces
interface Invalidated {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
update: boolean;
}
}
/**
* A widget providing a #GimpPreviewArea plus framework to update the
* preview.
*/
abstract class Preview extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
get update(): boolean;
set update(val: boolean);
// 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: 'invalidated', callback: (_source: this) => void): number;
connect_after(signal: 'invalidated', callback: (_source: this) => void): number;
emit(signal: 'invalidated'): void;
// Virtual methods
/**
* Calls the GimpPreview::draw method. GimpPreview itself doesn't
* implement a default draw method so the behavior is determined by
* the derived class implementing this method.
*
* #GimpDrawablePreview implements gimp_preview_draw() by drawing the
* original, unmodified drawable to the `preview`.
*/
vfunc_draw(): void;
// Conflicted with Gtk.Widget.vfunc_draw
vfunc_draw(...args: never[]): any;
/**
* Calls the GimpPreview::draw_buffer method. GimpPreview itself
* doesn't implement this method so the behavior is determined by the
* derived class implementing this method.
* @param buffer a pixel buffer the size of the preview
* @param rowstride the @buffer's rowstride
*/
vfunc_draw_buffer(buffer: Uint8Array | string, rowstride: number): void;
vfunc_draw_thumb(area: PreviewArea, width: number, height: number): void;
vfunc_invalidated(): void;
vfunc_set_cursor(): void;
/**
* Transforms from image to widget coordinates.
* @param src_x horizontal position on the previewed image
* @param src_y vertical position on the previewed image
*/
vfunc_transform(src_x: number, src_y: number): [number, number];
/**
* Transforms from widget to image coordinates.
* @param src_x horizontal position relative to the preview area's origin
* @param src_y vertical position relative to preview area's origin
*/
vfunc_untransform(src_x: number, src_y: number): [number, number];
// Methods
/**
* Calls the GimpPreview::draw method. GimpPreview itself doesn't
* implement a default draw method so the behavior is determined by
* the derived class implementing this method.
*
* #GimpDrawablePreview implements gimp_preview_draw() by drawing the
* original, unmodified drawable to the `preview`.
*/
draw(): void;
/**
* Calls the GimpPreview::draw_buffer method. GimpPreview itself
* doesn't implement this method so the behavior is determined by the
* derived class implementing this method.
* @param buffer a pixel buffer the size of the preview
* @param rowstride the @buffer's rowstride
*/
draw_buffer(buffer: Uint8Array | string, rowstride: number): void;
/**
* In most cases, you shouldn't need to access the #GimpPreviewArea
* that is being used in the `preview`. Sometimes however, you need to.
* For example if you want to receive mouse events from the area. In
* such cases, use gimp_preview_get_area().
* @returns a pointer to the #GimpPreviewArea used in the @preview.
*/
get_area(): PreviewArea;
get_bounds(): [number, number, number, number];
/**
* Gives access to the horizontal #GtkBox at the bottom of the preview
* that contains the update toggle. Derived widgets can use this function
* if they need to add controls to this area.
* @returns the horizontal #GtkBox at the bottom of the preview.
*/
get_controls(): Gtk.Box;
/**
* See gimp_preview_set_default_cursor():
* @returns The @preview's default #GdkCursor.
*/
get_default_cursor(): Gdk.Cursor;
get_frame(): Gtk.AspectFrame;
get_grid(): Gtk.Grid;
get_offsets(): [number, number];
get_position(): [number, number];
get_size(): [number, number];
get_update(): boolean;
/**
* This function starts or renews a short low-priority timeout. When
* the timeout expires, the GimpPreview::invalidated signal is emitted
* which will usually cause the `preview` to be updated.
*
* This function does nothing unless the "Preview" button is checked.
*
* During the emission of the signal a busy cursor is set on the
* toplevel window containing the `preview` and on the preview area
* itself.
*/
invalidate(): void;
/**
* Sets the lower and upper limits for the previewed area. The
* difference between the upper and lower value is used to set the
* maximum size of the #GimpPreviewArea used in the `preview`.
* @param xmin the minimum X value
* @param ymin the minimum Y value
* @param xmax the maximum X value
* @param ymax the maximum Y value
*/
set_bounds(xmin: number, ymin: number, xmax: number, ymax: number): void;
/**
* Sets the default mouse cursor for the preview. Note that this will
* be overridden by a %GDK_FLEUR if the preview has scrollbars, or by a
* %GDK_WATCH when the preview is invalidated.
* @param cursor a #GdkCursor or %NULL
*/
set_default_cursor(cursor: Gdk.Cursor): void;
set_offsets(xoff: number, yoff: number): void;
set_size(width: number, height: number): void;
/**
* Sets the state of the "Preview" check button.
* @param update %TRUE if the preview should invalidate itself when being scrolled or when gimp_preview_invalidate() is being called
*/
set_update(update: boolean): void;
/**
* Transforms from image to widget coordinates.
* @param src_x horizontal position on the previewed image
* @param src_y vertical position on the previewed image
*/
transform(src_x: number, src_y: number): [number, number];
/**
* Transforms from widget to image coordinates.
* @param src_x horizontal position relative to the preview area's origin
* @param src_y vertical position relative to preview area's origin
*/
untransform(src_x: number, src_y: number): [number, number];
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 PreviewArea {
// Constructor properties interface
interface ConstructorProps
extends Gtk.DrawingArea.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
check_custom_color1: Gegl.Color;
checkCustomColor1: Gegl.Color;
check_custom_color2: Gegl.Color;
checkCustomColor2: Gegl.Color;
check_size: Gimp.CheckSize;
checkSize: Gimp.CheckSize;
check_type: Gimp.CheckType;
checkType: Gimp.CheckType;
}
}
/**
* A general purpose preview widget which caches its pixel data.
*/
class PreviewArea extends Gtk.DrawingArea implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
get check_custom_color1(): Gegl.Color;
set check_custom_color1(val: Gegl.Color);
get checkCustomColor1(): Gegl.Color;
set checkCustomColor1(val: Gegl.Color);
get check_custom_color2(): Gegl.Color;
set check_custom_color2(val: Gegl.Color);
get checkCustomColor2(): Gegl.Color;
set checkCustomColor2(val: Gegl.Color);
get check_size(): Gimp.CheckSize;
set check_size(val: Gimp.CheckSize);
get checkSize(): Gimp.CheckSize;
set checkSize(val: Gimp.CheckSize);
get check_type(): Gimp.CheckType;
set check_type(val: Gimp.CheckType);
get checkType(): Gimp.CheckType;
set checkType(val: Gimp.CheckType);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PreviewArea;
// Methods
/**
* Composites `buf1` on `buf2` with the given `opacity,` draws the result
* to `area` and queues a redraw on the given rectangle.
*
* Since GIMP 2.2
* @param x x offset in preview
* @param y y offset in preview
* @param width buffer width
* @param height buffer height
* @param type the #GimpImageType of @buf1 and @buf2
* @param buf1 a #guchar buffer that contains the pixel data for the lower layer
* @param rowstride1 rowstride of @buf1
* @param buf2 a #guchar buffer that contains the pixel data for the upper layer
* @param rowstride2 rowstride of @buf2
* @param opacity The opacity of the first layer.
*/
blend(
x: number,
y: number,
width: number,
height: number,
type: Gimp.ImageType | null,
buf1: Uint8Array | string,
rowstride1: number,
buf2: Uint8Array | string,
rowstride2: number,
opacity: number,
): void;
/**
* Draws `buf` on `area` and queues a redraw on the given rectangle.
*
* Since GIMP 2.2
* @param x x offset in preview
* @param y y offset in preview
* @param width buffer width
* @param height buffer height
* @param type the #GimpImageType of @buf
* @param buf a #guchar buffer that contains the preview pixel data.
* @param rowstride rowstride of @buf
*/
draw(
x: number,
y: number,
width: number,
height: number,
type: Gimp.ImageType | null,
buf: Uint8Array | string,
rowstride: number,
): void;
// Conflicted with Gtk.Widget.draw
draw(...args: never[]): any;
/**
* Fills the given rectangle of `area` in the given color and queues a
* redraw.
*
* Since GIMP 2.2
* @param x x offset in preview
* @param y y offset in preview
* @param width width of the rectangle to fill
* @param height height of the rectangle to fill
* @param red red component of the fill color (0-255)
* @param green green component of the fill color (0-255)
* @param blue red component of the fill color (0-255)
*/
fill(x: number, y: number, width: number, height: number, red: number, green: number, blue: number): void;
/**
* Gets the preview area size
*/
get_size(): [number, number];
/**
* Composites `buf1` on `buf2` with the given `mask,` draws the result on
* `area` and queues a redraw on the given rectangle.
*
* Since GIMP 2.2
* @param x x offset in preview
* @param y y offset in preview
* @param width buffer width
* @param height buffer height
* @param type the #GimpImageType of @buf1 and @buf2
* @param buf1 a #guchar buffer that contains the pixel data for the lower layer
* @param rowstride1 rowstride of @buf1
* @param buf2 a #guchar buffer that contains the pixel data for the upper layer
* @param rowstride2 rowstride of @buf2
* @param mask a #guchar buffer representing the mask of the second layer.
* @param rowstride_mask rowstride for the mask.
*/
mask(
x: number,
y: number,
width: number,
height: number,
type: Gimp.ImageType | null,
buf1: Uint8Array | string,
rowstride1: number,
buf2: Uint8Array | string,
rowstride2: number,
mask: Uint8Array | string,
rowstride_mask: number,
): void;
/**
* Creates a popup menu that allows one to configure the size and type of
* the checkerboard pattern that the `area` uses to visualize transparency.
* @param event the button event that causes the menu to popup or %NULL
*/
menu_popup(event?: Gdk.EventButton | null): void;
/**
* Reset any previous drawing done through [class`GimpUi`.PreviewArea] functions.
*/
reset(): void;
/**
* Sets the color management configuration to use with this preview area.
* @param config a #GimpColorConfig object.
*/
set_color_config(config: Gimp.ColorConfig): void;
/**
* Sets the colormap for the #GimpPreviewArea widget. You need to
* call this function before you use gimp_preview_area_draw() with
* an image type of %GIMP_INDEXED_IMAGE or %GIMP_INDEXEDA_IMAGE.
*
* Since GIMP 2.2
* @param colormap a #guchar buffer that contains the colormap
* @param num_colors the number of colors in the colormap
*/
set_colormap(colormap: Uint8Array | string, num_colors: number): void;
/**
* Usually a #GimpPreviewArea fills the size that it is
* allocated. This function allows you to limit the preview area to a
* maximum size. If a larger size is allocated for the widget, the
* preview will draw itself centered into the allocated area.
* @param width the maximum width in pixels or -1 to unset the limit
* @param height the maximum height in pixels or -1 to unset the limit
*/
set_max_size(width: number, height: number): void;
/**
* Sets the offsets of the previewed area. This information is used
* when drawing the checkerboard and to determine the dither offsets.
* @param x horizontal offset
* @param y vertical offset
*/
set_offsets(x: number, y: 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;
/**
* 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 ProcBrowserDialog {
// Signal callback interfaces
interface RowActivated {
(): void;
}
interface SelectionChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
/**
* The dialog for the procedure and plugin browsers.
*/
class ProcBrowserDialog extends Dialog implements Atk.ImplementorIface, Gtk.Buildable {
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: 'row-activated', callback: (_source: this) => void): number;
connect_after(signal: 'row-activated', callback: (_source: this) => void): number;
emit(signal: 'row-activated'): void;
connect(signal: 'selection-changed', callback: (_source: this) => void): number;
connect_after(signal: 'selection-changed', callback: (_source: this) => void): number;
emit(signal: 'selection-changed'): void;
// Methods
/**
* Retrieves the name of the currently selected procedure.
* @returns The name of the selected procedure of %NULL if no procedure is selected.
*/
get_selected(): string | null;
// 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 ProcedureDialog {
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
config: Gimp.ProcedureConfig;
procedure: Gimp.Procedure;
}
}
class ProcedureDialog extends Dialog implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
get config(): Gimp.ProcedureConfig;
set config(val: Gimp.ProcedureConfig);
get procedure(): Gimp.Procedure;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
procedure: Gimp.Procedure,
config: Gimp.ProcedureConfig,
title?: string | null,
): ProcedureDialog;
// Conflicted with Gtk.Dialog.new
static ['new'](...args: never[]): any;
// Virtual methods
vfunc_fill_end(procedure: Gimp.Procedure, config: Gimp.ProcedureConfig): void;
vfunc_fill_start(procedure: Gimp.Procedure, config: Gimp.ProcedureConfig): void;
// Methods
/**
* Creates and populates a new #GtkBox with widgets corresponding to
* every listed `properties`. If the list is empty, the created box will
* be filled by the whole list of properties of the associated
* #GimpProcedure, in the defined order. This is similar of how
* gimp_procedure_dialog_fill() works except that it creates a new
* widget which is not inside `dialog` itself.
*
* The `container_id` must be a unique ID which is neither the name of a
* property of the #GimpProcedureConfig associated to `dialog,` nor is it
* the ID of any previously created container. This ID can later be used
* together with property names to be packed in other containers or
* inside `dialog` itself.
* @param container_id a container identifier.
* @param properties the list of property names.
* @returns the #GtkBox representing @property. The object belongs to @dialog and must not be freed.
*/
fill_box(container_id: string, properties?: string[] | null): Gtk.Widget;
/**
* Creates a new #GtkExpander and packs `title_id` as its title
* and `contents_id` as content.
* If `title_id` represents a boolean property, its value will be used to
* expand the #GtkExpander. If `invert_title` is TRUE, then expand binding is
* inverted.
*
* The `container_id` must be a unique ID which is neither the name of a
* property of the #GimpProcedureConfig associated to `dialog,` nor is it
* the ID of any previously created container. This ID can later be used
* together with property names to be packed in other containers or
* inside `dialog` itself.
* @param container_id a container identifier.
* @param title_id the identifier for the title widget.
* @param invert_title whether to use the opposite value of @title_id if it represents a boolean widget.
* @param contents_id the identifier for the contents.
* @returns the #GtkWidget representing @container_id. The object belongs to @dialog and must not be freed.
*/
fill_expander(
container_id: string,
title_id: string | null,
invert_title: boolean,
contents_id?: string | null,
): Gtk.Widget;
/**
* Creates and populates a new #GtkFlowBox with widgets corresponding to
* every listed `properties`. If the list is empty, the created flowbox
* will be filled by the whole list of properties of the associated
* #GimpProcedure, in the defined order. This is similar of how
* gimp_procedure_dialog_fill() works except that it creates a new
* widget which is not inside `dialog` itself.
*
* The `container_id` must be a unique ID which is neither the name of a
* property of the #GimpProcedureConfig associated to `dialog,` nor is it
* the ID of any previously created container. This ID can later be used
* together with property names to be packed in other containers or
* inside `dialog` itself.
* @param container_id a container identifier.
* @param properties the list of property names.
* @returns the #GtkFlowBox representing @property. The object belongs to @dialog and must not be freed.
*/
fill_flowbox(container_id: string, properties?: string[] | null): Gtk.Widget;
/**
* Creates a new #GtkFrame and packs `title_id` as its title and
* `contents_id` as its child.
* If `title_id` represents a boolean property, its value will be used to
* renders `contents_id` sensitive or not. If `invert_title` is TRUE, then
* sensitivity binding is inverted.
*
* The `container_id` must be a unique ID which is neither the name of a
* property of the #GimpProcedureConfig associated to `dialog,` nor is it
* the ID of any previously created container. This ID can later be used
* together with property names to be packed in other containers or
* inside `dialog` itself.
* @param container_id a container identifier.
* @param title_id the identifier for the title widget.
* @param invert_title whether to use the opposite value of @title_id if it represents a boolean widget.
* @param contents_id the identifier for the contents.
* @returns the #GtkWidget representing @container_id. The object belongs to @dialog and must not be freed.
*/
fill_frame(
container_id: string,
title_id: string | null,
invert_title: boolean,
contents_id?: string | null,
): Gtk.Widget;
/**
* Populate `dialog` with the widgets corresponding to every listed
* properties. If the list is %NULL, `dialog` will be filled by the whole
* list of properties of the associated #GimpProcedure, in the defined
* order:
*
* ```c
* gimp_procedure_dialog_fill_list (dialog, NULL);
* ```
*
* Nevertheless if you only wish to display a partial list of
* properties, or if you wish to change the display order, then you have
* to give an explicit list:
*
* ```c
* gimp_procedure_dialog_fill (dialog, "property-1", "property-2", NULL);
* ```
*
*
* Note: you do not have to call gimp_procedure_dialog_get_widget() on
* every property before calling this function unless you want a given
* property to be represented by an alternative widget type. By default,
* each property will get a default representation according to its
* type.
* @param properties the list of property names.
*/
fill(properties?: string[] | null): void;
/**
* Creates and populates a new #GtkNotebook with widgets corresponding to every
* listed properties.
* This is similar of how gimp_procedure_dialog_fill_list() works except that it
* creates a new widget which is not inside `dialog` itself.
*
* The `container_id` must be a unique ID which is neither the name of a
* property of the #GimpProcedureConfig associated to `dialog,` nor is it
* the ID of any previously created container. This ID can later be used
* together with property names to be packed in other containers or
* inside `dialog` itself.
* @param container_id a container identifier.
* @param label_list the list of label IDs.
* @param page_list the list of page IDs.
* @returns the #GtkNotebook representing @property. The object belongs to @dialog and must not be freed.
*/
fill_notebook(container_id: string, label_list: string[], page_list: string[]): Gtk.Widget;
/**
* Creates and populates a new #GtkPaned containing widgets corresponding to
* `child1`_id and `child2`_id.
* This is similar of how gimp_procedure_dialog_fill() works except that it
* creates a new widget which is not inside `dialog` itself.
*
* The `container_id` must be a unique ID which is neither the name of a
* property of the #GimpProcedureConfig associated to `dialog,` nor is it
* the ID of any previously created container. This ID can later be used
* together with property names to be packed in other containers or
* inside `dialog` itself.
* @param container_id a container identifier.
* @param orientation
* @param child1_id the first child's ID.
* @param child2_id the second child's ID.
* @returns the #GtkPaned representing @property. The object belongs to @dialog and must not be freed.
*/
fill_paned(
container_id: string,
orientation: Gtk.Orientation | null,
child1_id?: string | null,
child2_id?: string | null,
): Gtk.Widget;
/**
* Creates and populates a new #GtkScrolledWindow with a widget corresponding
* to the declared content id.
*
* The `container_id` must be a unique ID which is neither the name of a
* property of the #GimpProcedureConfig associated to `dialog,` nor is it
* the ID of any previously created container. This ID can later be used
* together with property names to be packed in other containers or
* inside `dialog` itself.
* @param container_id a container identifier.
* @param contents_id The identifier for the contents.
* @returns the #GtkScrolledWindow representing @contents_id. The object belongs to @dialog and must not be freed.
*/
fill_scrolled_window(container_id: string, contents_id: string): Gtk.Widget;
/**
* Creates a new widget for `property` which must necessarily be a
* #GeglColor property.
* This must be used instead of gimp_procedure_dialog_get_widget() when
* you want a #GimpLabelColor which is not customizable for a color
* property, or when to set a specific `type`.
*
* If a widget has already been created for this procedure, it will be
* returned instead (whatever its actual widget type).
* @param property name of the #GeglColor property to build a widget for. It must be a property of the #GimpProcedure @dialog has been created for.
* @param editable whether the color can be edited or is only for display.
* @param type the #GimpColorAreaType.
* @returns a #GimpLabelColor representing @property. The object belongs to @dialog and must not be freed.
*/
get_color_widget(property: string, editable: boolean, type: ColorAreaType | null): Gtk.Widget;
/**
* Gets or creates a new #GimpDrawablePreview for `drawable`.
* If a widget with the `preview_id` has already been created for
* this procedure, it will be returned instead.
*
* The `preview_id` ID can later be used together with property names
* to be packed in other containers or inside `dialog` itself.
* @param preview_id the ID of #GimpDrawablePreview.
* @param drawable the #GimpDrawable.
* @returns the #GtkWidget representing @preview_id. The object belongs to @dialog and must not be freed.
*/
get_drawable_preview(preview_id: string, drawable: Gimp.Drawable): Gtk.Widget;
/**
* Creates a new #GimpLabelIntWidget for `property` which must
* necessarily be an integer or boolean property.
* This must be used instead of gimp_procedure_dialog_get_widget() when
* you want to create a combo box from an integer property.
*
* If a widget has already been created for this procedure, it will be
* returned instead (whatever its actual widget type).
* @param property name of the int property to build a combo for. It must be a property of the #GimpProcedure @dialog has been created for.
* @param store the #GimpIntStore which will be used.
* @returns the #GtkWidget representing @property. The object belongs to @dialog and must not be freed.
*/
get_int_combo(property: string, store: IntStore): Gtk.Widget;
/**
* Creates a new #GimpLabelIntRadioFrame for `property` which must
* necessarily be an integer, enum or boolean property.
* This must be used instead of gimp_procedure_dialog_get_widget() when
* you want to create a group of %GtkRadioButton-s from an integer
* property.
*
* If a widget has already been created for this procedure, it will be
* returned instead (whatever its actual widget type).
* @param property name of the int property to build radio buttons for. It must be a property of the #GimpProcedure @dialog has been created for.
* @param store the #GimpIntStore which will be used.
* @returns the #GtkWidget representing @property. The object belongs to @dialog and must not be freed.
*/
get_int_radio(property: string, store: IntStore): Gtk.Widget;
/**
* Creates a new #GtkLabel with `text`. It can be useful for packing
* textual information in between property settings.
*
* If `label_id` is an existing string property of the #GimpProcedureConfig
* associated to `dialog,` then it will sync to the property value. In this case,
* `text` should be %NULL.
*
* If `label_id` is a unique ID which is neither the name of a property of the
* #GimpProcedureConfig associated to `dialog,` nor is it the ID of any
* previously created label or container, it will be initialized to `text`. This
* ID can later be used together with property names to be packed in other
* containers or inside `dialog` itself.
* @param label_id the label for the #GtkLabel.
* @param text the text for the label.
* @param is_markup whether @text is formatted with Pango markup.
* @param with_mnemonic whether @text contains a mnemonic character.
* @returns the #GtkWidget representing @label_id. The object belongs to @dialog and must not be freed.
*/
get_label(label_id: string, text: string, is_markup: boolean, with_mnemonic: boolean): Gtk.Widget;
/**
* Creates a new #GimpScaleEntry for `property` which must necessarily be
* an integer or double property.
* This can be used instead of gimp_procedure_dialog_get_widget() in
* particular if you want to tweak the display factor. A typical example
* is showing a [0.0, 1.0] range as [0.0, 100.0] instead (`factor` = 100.0).
*
* If a widget has already been created for this procedure, it will be
* returned instead (whatever its actual widget type).
* @param property name of the int property to build a combo for. It must be a property of the #GimpProcedure @dialog has been created for.
* @param factor a display factor for the range shown by the widget.
* @returns the #GtkWidget representing @property. The object belongs to @dialog and must not be freed.
*/
get_scale_entry(property: string, factor: number): Gtk.Widget;
/**
* Creates a new #GimpSizeEntry for `property` which must necessarily be
* an integer or double property. The associated `unit_property` must be
* a GimpUnit or integer property.
*
* If a widget has already been created for this procedure, it will be
* returned instead (whatever its actual widget type).
* @param property name of the int property to build an entry for. It must be a property of the #GimpProcedure @dialog has been created for.
* @param property_is_pixel when %TRUE, the property value is in pixels, and in the selected unit otherwise.
* @param unit_property name of unit property.
* @param unit_format a printf-like unit-format string used for unit labels.
* @param update_policy how the automatic pixel <-> real-world-unit calculations should be done.
* @param resolution the resolution (in dpi) for the field.
* @returns the #GtkWidget representing @property. The object belongs to @dialog and must not be freed.
*/
get_size_entry(
property: string,
property_is_pixel: boolean,
unit_property: string,
unit_format: string,
update_policy: SizeEntryUpdatePolicy | null,
resolution: number,
): Gtk.Widget;
/**
* Creates a new #GimpSpinScale for `property` which must necessarily be
* an integer or double property.
* This can be used instead of gimp_procedure_dialog_get_widget() in
* particular if you want to tweak the display factor. A typical example
* is showing a [0.0, 1.0] range as [0.0, 100.0] instead (`factor` = 100.0).
*
* If a widget has already been created for this procedure, it will be
* returned instead (whatever its actual widget type).
* @param property name of the int or double property to build a #GimpSpinScale for. It must be a property of the #GimpProcedure @dialog has been created for.
* @param factor a display factor for the range shown by the widget. It must be set to 1.0 for integer properties.
* @returns the #GtkWidget representing @property. The object belongs to @dialog and must not be freed.
*/
get_spin_scale(property: string, factor: number): Gtk.Widget;
/**
* Creates a new #GtkWidget for `property` according to the property
* type. The following types are possible:
*
* - %G_TYPE_PARAM_BOOLEAN:
* * %GTK_TYPE_CHECK_BUTTON (default)
* * %GTK_TYPE_SWITCH
* - %G_TYPE_PARAM_INT or %G_TYPE_PARAM_DOUBLE:
* * %GIMP_TYPE_LABEL_SPIN (default): a spin button with a label.
* * %GIMP_TYPE_SCALE_ENTRY: a scale entry with label.
* * %GIMP_TYPE_SPIN_SCALE: a spin scale with label embedded.
* * %GIMP_TYPE_SPIN_BUTTON: a spin button with no label.
* - %G_TYPE_PARAM_STRING:
* * %GIMP_TYPE_LABEL_ENTRY (default): an entry with a label.
* * %GTK_TYPE_ENTRY: an entry with no label.
* * %GTK_TYPE_TEXT_VIEW: a text view with no label.
* - %GIMP_TYPE_CHOICE:
* * %GTK_TYPE_COMBO_BOX (default): a combo box displaying every
* choice.
* * %GIMP_TYPE_INT_RADIO_FRAME: a frame with radio buttons.
* - %GEGL_TYPE_COLOR:
* * %GIMP_TYPE_LABEL_COLOR (default): a color button with a label.
* Please use gimp_procedure_dialog_get_color_widget() for a
* non-editable color area with a label.
* * %GIMP_TYPE_COLOR_BUTTON: a color button with no label.
* * %GIMP_TYPE_COLOR_AREA: a color area with no label.
* - %GIMP_TYPE_PARAM_FILE:
* * %GTK_FILE_CHOOSER_BUTTON (default): generic file chooser widget
* using the action mode of the param spec.
* Note that it won't work with a [enum`Gimp`.FileChooserAction.ANY]
* action. If you intend to display a widget for a file param
* spec, you should always set it to a more specific action.
* See [method`Gimp`.Procedure.add_file_argument].
* - %G_TYPE_PARAM_UNIT:
* * %GIMP_TYPE_UNIT_COMBO_BOX
*
* If the `widget_type` is not supported for the actual type of
* `property,` the function will fail. To keep the default, set to
* %G_TYPE_NONE.
*
* If a widget has already been created for this procedure, it will be
* returned instead (even if with a different `widget_type)`.
* @param property name of the property to build a widget for. It must be a property of the #GimpProcedure @dialog has been created for.
* @param widget_type alternative widget type. %G_TYPE_NONE will create the default type of widget for the associated property type.
* @returns the #GtkWidget representing @property. The object belongs to @dialog and must not be freed.
*/
get_widget(property: string, widget_type: GObject.GType): Gtk.Widget;
/**
* Show `dialog` and only returns when the user finished interacting with
* it (either validating choices or canceling).
* @returns %TRUE if the dialog was validated, %FALSE otherwise.
*/
run(): boolean;
// Conflicted with GimpUi.Dialog.run
run(...args: never[]): any;
/**
* Changes the "OK" button's label of `dialog` to `ok_label`.
* @param ok_label a label to replace the OK button's text.
*/
set_ok_label(ok_label: string): void;
/**
* Sets sensitivity of the widget associated to `property` in `dialog`. If
* `config` is %NULL, then it is set to the value of `sensitive`.
* Otherwise `sensitive` is ignored and sensitivity is bound to the value
* of `config_property` of `config` (or the negation of this value
* if `config_reverse` is %TRUE).
* @param property name of a property of the #GimpProcedure @dialog has been created for.
* @param sensitive whether the widget associated to @property should be sensitive.
* @param config an optional config object.
* @param config_property name of a property of @config.
* @param config_invert whether to negate the value of @config_property.
*/
set_sensitive(
property: string,
sensitive: boolean,
config: GObject.Object | null,
config_property: string | null,
config_invert: boolean,
): void;
// Conflicted with Gtk.Widget.set_sensitive
set_sensitive(...args: never[]): any;
/**
* Sets sensitivity of the widget associated to `property` in `dialog` if the
* value of `config_property` in `config` is equal to one of `values`.
*
* If `config` is %NULL, then the configuration object of `dialog` is used.
*
* If `in_values` is FALSE, then the widget is set sensitive if the value of
* `config_property` is **not** in `values`.
* @param property name of a property of the #GimpProcedure @dialog has been created for.
* @param config an optional config object (if %NULL, @property's config will be used).
* @param config_property name of a property of @config.
* @param values an array of GValues which could be values of @config_property.
* @param in_values whether @property should be sensitive when @config_property is one of @values, or the opposite.
*/
set_sensitive_if_in(
property: string,
config: GObject.Object | null,
config_property: string,
values: Gimp.ValueArray,
in_values: 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 ProgressBar {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ProgressBar.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* A widget providing a progress bar that automatically redirects any
* progress calls to itself.
*/
class ProgressBar extends Gtk.ProgressBar implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ProgressBar;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 ResourceChooser {
// Signal callback interfaces
interface ResourceSet {
(resource: GObject.Object, dialog_closing: boolean): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
label: string;
resource: Gimp.Resource;
title: string;
}
}
/**
* A button which pops up a resource selection dialog.
*
* Responsibilities:
*
* - implementing outer container widget,
* - managing clicks and popping up a remote chooser,
* - having a resource property,
* - signaling when user selects resource
* - receiving drag,
* - triggering draws of the button interior (by subclass) and draws of remote popup chooser.
*
* Collaborations:
*
* - owned by GimpProcedureDialog via GimpPropWidget
* - resource property usually bound to a GimpConfig for a GimpPluginProcedure.
* - communicates using GimpResourceSelect with remote GimpPDBDialog,
* to choose an installed GimpResource owned by core.
*
* Subclass responsibilities:
*
* - creating interior widgets
* - drawing the interior (a preview of the chosen resource)
* - declaring which interior widgets are drag destinations
* - declaring which interior widgets are clickable (generate "clicked" signal)
* - generate "clicked" (delegating to GtkButton or implementing from mouse events)
*/
abstract class ResourceChooser extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* Label text with mnemonic.
*/
get label(): string;
/**
* The currently selected resource.
*/
get resource(): Gimp.Resource;
set resource(val: Gimp.Resource);
/**
* The title to be used for the resource selection popup dialog.
*/
get title(): string;
// 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: 'resource-set',
callback: (_source: this, resource: GObject.Object, dialog_closing: boolean) => void,
): number;
connect_after(
signal: 'resource-set',
callback: (_source: this, resource: GObject.Object, dialog_closing: boolean) => void,
): number;
emit(signal: 'resource-set', resource: GObject.Object, dialog_closing: boolean): void;
// Virtual methods
vfunc_draw_interior(): void;
vfunc_resource_set(resource: Gimp.Resource, dialog_closing: boolean): void;
// Methods
/**
* Returns the label widget.
* @returns the [class@Gtk.Widget] showing the label text.
*/
get_label(): Gtk.Widget;
/**
* Gets the currently selected resource.
* @returns an internal copy of the resource which must not be freed.
*/
get_resource(): Gimp.Resource;
/**
* Sets the currently selected resource.
* This will select the resource in both the button and any chooser popup.
* @param resource Resource to set.
*/
set_resource(resource: Gimp.Resource): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 Ruler {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
lower: number;
max_size: number;
maxSize: number;
orientation: Gtk.Orientation;
position: number;
unit: Gimp.Unit;
upper: number;
}
}
/**
* A ruler widget with configurable unit and orientation.
*/
class Ruler extends Gtk.Widget implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
get lower(): number;
set lower(val: number);
get max_size(): number;
set max_size(val: number);
get maxSize(): number;
set maxSize(val: number);
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
get position(): number;
set position(val: number);
get unit(): Gimp.Unit;
set unit(val: Gimp.Unit);
get upper(): number;
set upper(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](orientation: Gtk.Orientation): Ruler;
// Methods
/**
* Adds a "track widget" to the ruler. The ruler will connect to
* GtkWidget:motion-notify-event: on the track widget and update its
* position marker accordingly. The marker is correctly updated also
* for the track widget's children, regardless of whether they are
* ordinary children of off-screen children.
* @param widget the track widget to add
*/
add_track_widget(widget: Gtk.Widget): void;
get_position(): number;
/**
* Retrieves values indicating the range and current position of a #GimpRuler.
* See gimp_ruler_set_range().
*/
get_range(): [number, number, number];
get_unit(): Gimp.Unit;
/**
* Removes a previously added track widget from the ruler. See
* gimp_ruler_add_track_widget().
* @param widget the track widget to remove
*/
remove_track_widget(widget: Gtk.Widget): void;
/**
* This sets the position of the ruler.
* @param position the position to set the ruler to
*/
set_position(position: number): void;
/**
* This sets the range of the ruler.
* @param lower the lower limit of the ruler
* @param upper the upper limit of the ruler
* @param max_size the maximum size of the ruler used when calculating the space to leave for the text
*/
set_range(lower: number, upper: number, max_size: number): void;
/**
* This sets the unit of the ruler.
* @param unit the #GimpUnit to set the ruler to
*/
set_unit(unit: Gimp.Unit): 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: Gtk.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: Gtk.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: Gtk.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: Gtk.Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under ``.
* @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: Gtk.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: Gtk.Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the
* [GtkBuilder UI definition][BUILDER-UI]
* used to construct the `buildable`.
* @returns the name set with gtk_buildable_set_name()
*/
get_name(): string;
/**
* Called when the builder finishes the parsing of a
* [GtkBuilder UI definition][BUILDER-UI].
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Gtk.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: Gtk.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: Gtk.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: Gtk.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: Gtk.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: Gtk.Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under ``.
* @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: Gtk.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: Gtk.Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the
* [GtkBuilder UI definition][BUILDER-UI]
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* [GtkBuilder UI definition][BUILDER-UI].
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Gtk.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: Gtk.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 ScaleEntry {
// Constructor properties interface
interface ConstructorProps
extends LabelSpin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* This widget is a #GtkGrid showing a #GtkSpinButton and a #GtkScale
* bound together. It also displays a #GtkLabel which is used as
* mnemonic on the #GtkSpinButton.
*/
class ScaleEntry extends LabelSpin implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](text: string, value: number, lower: number, upper: number, digits: number): ScaleEntry;
// Conflicted with Gtk.Grid.new
static ['new'](...args: never[]): any;
// Methods
get_logarithmic(): boolean;
/**
* This function returns the #GtkRange packed in `entry`. This can be
* useful if you need to customize some aspects of the widget
*
* By default, it is a #GtkScale, but it can be any other type of
* #GtkRange if a subclass overrode the new_range_widget() protected
* method.
* @returns The #GtkRange contained in @entry.
*/
get_range(): Gtk.Range;
/**
* By default the #GtkSpinButton and #GtkScale will have the same range.
* In some case, you want to set a different range. In particular when
* the finale range is huge, the #GtkScale might become nearly useless
* as every tiny slider move would dramatically update the value. In
* this case, it is common to set the #GtkScale to a smaller common
* range, while the #GtkSpinButton would allow for the full allowed
* range.
* This function allows this. Obviously the #GtkAdjustment of both
* widgets would be synced but if the set value is out of the #GtkScale
* range, the slider would simply show at one extreme.
*
* If `limit_scale` is %FALSE though, it would sync back both widgets
* range to the new values.
*
* Note that the step and page increments are updated when the range is
* updated according to some common usage algorithm which should work if
* you don't have very specific needs. If you want to customize the step
* increments yourself, you may call gimp_label_spin_set_increments()
* @param lower the lower value for the whole widget if @limit_scale is %FALSE, or only for the #GtkScale if %TRUE.
* @param upper the upper value for the whole widget if @limit_scale is %FALSE, or only for the #GtkSpinButton if %TRUE.
* @param limit_scale Whether the range should only apply to the #GtkScale or if it should share its #GtkAdjustement with the #GtkSpinButton. If %TRUE, both @lower and @upper must be included in current #GtkSpinButton range.
*/
set_bounds(lower: number, upper: number, limit_scale: boolean): void;
/**
* Sets whether `entry'`s scale widget will behave in a linear
* or logarithmic fashion. Useful when an entry has to attend large
* ranges, but smaller selections on that range require a finer
* adjustment.
* @param logarithmic a boolean value to set or reset logarithmic behavior of the scale widget
*/
set_logarithmic(logarithmic: 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 ScrolledPreview {
// Constructor properties interface
interface ConstructorProps
extends Preview.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* A widget providing a #GimpPreview enhanced by scrolling capabilities.
*/
abstract class ScrolledPreview extends Preview implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* While the `preview` is frozen, it is not going to redraw itself in
* response to scroll events.
*
* This function should only be used to implement widgets derived from
* #GimpScrolledPreview. There is no point in calling this from a plug-in.
*/
freeze(): void;
get_adjustments(): [Gtk.Adjustment, Gtk.Adjustment];
set_policy(hscrollbar_policy: Gtk.PolicyType | null, vscrollbar_policy: Gtk.PolicyType | null): void;
set_position(x: number, y: number): void;
/**
* While the `preview` is frozen, it is not going to redraw itself in
* response to scroll events.
*
* This function should only be used to implement widgets derived from
* #GimpScrolledPreview. There is no point in calling this from a plug-in.
*/
thaw(): 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 SizeEntry {
// Signal callback interfaces
interface RefvalChanged {
(): void;
}
interface UnitChanged {
(): void;
}
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Grid.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* This widget is used to enter pixel distances/sizes and resolutions.
*
* You can specify the number of fields the widget should provide. For
* each field automatic mappings are performed between the field's
* "reference value" and its "value".
*
* There is a #GimpUnitComboBox right of the entry fields which lets
* you specify the #GimpUnit of the displayed values.
*
* For each field, there can be one or two #GtkSpinButton's to enter
* "value" and "reference value". If you specify `show_refval` as
* %FALSE in gimp_size_entry_new() there will be only one
* #GtkSpinButton and the #GimpUnitComboBox will contain an item for
* selecting GIMP_UNIT_PIXEL.
*
* The "reference value" is either of GIMP_UNIT_PIXEL or dpi,
* depending on which #GimpSizeEntryUpdatePolicy you specify in
* gimp_size_entry_new(). The "value" is either the size in pixels
* mapped to the size in a real-world-unit (see #GimpUnit) or the dpi
* value mapped to pixels per real-world-unit.
*/
class SizeEntry extends Gtk.Grid implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
number_of_fields: number,
unit: Gimp.Unit,
unit_format: string,
menu_show_pixels: boolean,
menu_show_percent: boolean,
show_refval: boolean,
spinbutton_width: number,
update_policy: SizeEntryUpdatePolicy,
): SizeEntry;
// Conflicted with Gtk.Grid.new
static ['new'](...args: never[]): any;
// 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: 'refval-changed', callback: (_source: this) => void): number;
connect_after(signal: 'refval-changed', callback: (_source: this) => void): number;
emit(signal: 'refval-changed'): void;
connect(signal: 'unit-changed', callback: (_source: this) => void): number;
connect_after(signal: 'unit-changed', callback: (_source: this) => void): number;
emit(signal: 'unit-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;
// Methods
/**
* Adds an input field to the #GimpSizeEntry.
*
* The new input field will have the index 0. If you specified `show_refval`
* as %TRUE in gimp_size_entry_new() you have to pass an additional
* #GtkSpinButton to hold the reference value. If `show_refval` was %FALSE,
* `refval_spinbutton` will be ignored.
* @param value_spinbutton The spinbutton to display the field's value.
* @param refval_spinbutton The spinbutton to display the field's reference value.
*/
add_field(value_spinbutton: Gtk.SpinButton, refval_spinbutton?: Gtk.SpinButton | null): void;
/**
* Attaches a #GtkLabel to the #GimpSizeEntry (which is a #GtkGrid).
* @param text The text of the label.
* @param row The row where the label will be attached.
* @param column The column where the label will be attached.
* @param alignment The horizontal alignment of the label.
* @returns A pointer to the new #GtkLabel widget.
*/
attach_label(text: string, row: number, column: number, alignment: number): Gtk.Widget;
/**
* You shouldn't fiddle with the internals of a #GimpSizeEntry but
* if you want to set tooltips using gimp_help_set_help_data() you
* can use this function to get a pointer to the spinbuttons.
* @param field the index of the widget you want to get a pointer to
* @returns a #GtkWidget pointer that you can attach a tooltip to.
*/
get_help_widget(field: number): Gtk.Widget;
get_n_fields(): number;
/**
* Returns the reference value for field # `field` of the #GimpSizeEntry.
*
* The reference value is either a distance in pixels or a resolution
* in dpi, depending on which #GimpSizeEntryUpdatePolicy you chose in
* gimp_size_entry_new().
* @param field The index of the field you want to know the reference value of.
* @returns The reference value of the chosen @field.
*/
get_refval(field: number): number;
/**
* Returns the #GimpUnit the user has selected in the #GimpSizeEntry's
* #GimpUnitComboBox.
* @returns The sizeentry's unit.
*/
get_unit(): Gimp.Unit;
get_unit_combo(): UnitComboBox;
get_update_policy(): SizeEntryUpdatePolicy;
/**
* Returns the value of field # `field` of the #GimpSizeEntry.
*
* The `value` returned is a distance or resolution
* in the #GimpUnit the user has selected in the #GimpSizeEntry's
* #GimpUnitComboBox.
*
* NOTE: In most cases you won't be interested in this value because the
* #GimpSizeEntry's purpose is to shield the programmer from unit
* calculations. Use gimp_size_entry_get_refval() instead.
* @param field The index of the field you want to know the value of.
* @returns The value of the chosen @field.
*/
get_value(field: number): number;
/**
* This function is rather ugly and just a workaround for the fact that
* it's impossible to implement gtk_widget_grab_focus() for a #GtkGrid (is this actually true after the Table->Grid conversion?).
*/
grab_focus(): void;
/**
* Iterates over all entries in the #GimpSizeEntry and calls
* gtk_entry_set_activates_default() on them.
* @param setting %TRUE to activate window's default widget on Enter keypress
*/
set_activates_default(setting: boolean): void;
/**
* This function allows you set up a #GimpSizeEntry so that sub-pixel
* sizes can be entered.
* @param digits the number of digits to display for a pixel size
*/
set_pixel_digits(digits: number): void;
/**
* Sets the reference value for field # `field` of the #GimpSizeEntry.
*
* The `refval` passed is either a distance in pixels or a resolution in dpi,
* depending on which #GimpSizeEntryUpdatePolicy you chose in
* gimp_size_entry_new().
* @param field The index of the field you want to set the reference value for.
* @param refval The new reference value for @field.
*/
set_refval(field: number, refval: number): void;
/**
* Limits the range of possible reference values which can be entered in
* field # `field` of the #GimpSizeEntry.
*
* The current reference value of the `field` will be clamped to fit in the
* `field'`s new boundaries.
* @param field The index of the field you want to set the reference value boundaries for.
* @param lower The new lower boundary of the reference value of the chosen @field.
* @param upper The new upper boundary of the reference value of the chosen @field.
*/
set_refval_boundaries(field: number, lower: number, upper: number): void;
/**
* Sets the decimal digits of field # `field` of the #GimpSizeEntry to
* `digits`.
*
* If you don't specify this value explicitly, the reference value's number
* of digits will equal to 0 for #GIMP_SIZE_ENTRY_UPDATE_SIZE and to 2 for
* #GIMP_SIZE_ENTRY_UPDATE_RESOLUTION.
* @param field The index of the field you want to set the reference value for.
* @param digits The new number of decimal digits for the #GtkSpinButton which displays @field's reference value.
*/
set_refval_digits(field: number, digits: number): void;
/**
* Sets the resolution (in dpi) for field # `field` of the #GimpSizeEntry.
*
* The `resolution` passed will be clamped to fit in
* [#GIMP_MIN_RESOLUTION..#GIMP_MAX_RESOLUTION].
*
* This function does nothing if the #GimpSizeEntryUpdatePolicy specified in
* gimp_size_entry_new() doesn't equal to #GIMP_SIZE_ENTRY_UPDATE_SIZE.
* @param field The index of the field you want to set the resolution for.
* @param resolution The new resolution (in dpi) for the chosen @field.
* @param keep_size %TRUE if the @field's size in pixels should stay the same. %FALSE if the @field's size in units should stay the same.
*/
set_resolution(field: number, resolution: number, keep_size: boolean): void;
/**
* Sets the pixel values for field # `field` of the #GimpSizeEntry
* which will be treated as 0% and 100%.
*
* These values will be used if you specified `menu_show_percent` as %TRUE
* in gimp_size_entry_new() and the user has selected GIMP_UNIT_PERCENT in
* the #GimpSizeEntry's #GimpUnitComboBox.
*
* This function does nothing if the #GimpSizeEntryUpdatePolicy specified in
* gimp_size_entry_new() doesn't equal to GIMP_SIZE_ENTRY_UPDATE_SIZE.
* @param field The index of the field you want to set the size for.
* @param lower The reference value which will be treated as 0%.
* @param upper The reference value which will be treated as 100%.
*/
set_size(field: number, lower: number, upper: number): void;
/**
* Sets the #GimpSizeEntry's unit. The reference value for all fields will
* stay the same but the value in units or pixels per unit will change
* according to which #GimpSizeEntryUpdatePolicy you chose in
* gimp_size_entry_new().
* @param unit The new unit.
*/
set_unit(unit: Gimp.Unit): void;
/**
* Sets the value for field # `field` of the #GimpSizeEntry.
*
* The `value` passed is treated to be a distance or resolution
* in the #GimpUnit the user has selected in the #GimpSizeEntry's
* #GimpUnitComboBox.
*
* NOTE: In most cases you won't be interested in this value because the
* #GimpSizeEntry's purpose is to shield the programmer from unit
* calculations. Use gimp_size_entry_set_refval() instead.
* @param field The index of the field you want to set a value for.
* @param value The new value for @field.
*/
set_value(field: number, value: number): void;
/**
* Limits the range of possible values which can be entered in field # `field`
* of the #GimpSizeEntry.
*
* The current value of the `field` will be clamped to fit in the `field'`s
* new boundaries.
*
* NOTE: In most cases you won't be interested in this function because the
* #GimpSizeEntry's purpose is to shield the programmer from unit
* calculations. Use gimp_size_entry_set_refval_boundaries() instead.
* Whatever you do, don't mix these calls. A size entry should either
* be clamped by the value or the reference value.
* @param field The index of the field you want to set value boundaries for.
* @param lower The new lower boundary of the value of the chosen @field.
* @param upper The new upper boundary of the value of the chosen @field.
*/
set_value_boundaries(field: number, lower: number, upper: number): void;
/**
* Controls whether a unit menu is shown in the size entry. If
* `show` is %TRUE, the menu is shown; otherwise it is hidden.
* @param show Boolean
*/
show_unit_menu(show: boolean): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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 SpinButton {
// Constructor properties interface
interface ConstructorProps
extends Gtk.SpinButton.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.Editable.ConstructorProps,
Gtk.Orientable.ConstructorProps {}
}
/**
* #GimpSpinButton is a drop-in replacement for #GtkSpinButton, with the
* following changes:
*
* - When the spin-button loses focus, its adjustment value is only
* updated if the entry text has been changed.
*
* - When the spin-button's "wrap" property is TRUE, values input through the
* entry are wrapped around.
*
* - Modifiers can be used during scrolling for smaller/bigger increments.
*/
class SpinButton
extends Gtk.SpinButton
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.Editable, Gtk.Orientable
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](adjustment: Gtk.Adjustment | null, climb_rate: number, digits: number): SpinButton;
// Conflicted with Gtk.Entry.new
static ['new'](...args: never[]): any;
static new_with_range(min: number, max: number, step: number): SpinButton;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Gtk.Orientation;
set orientation(val: Gtk.Orientation);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Gtk.Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable’s new orientation.
*/
set_orientation(orientation: Gtk.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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace SpinScale {
// Constructor properties interface
interface ConstructorProps
extends SpinButton.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.Editable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
label: string;
}
}
class SpinScale
extends SpinButton
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.Editable, Gtk.Orientable
{
static $gtype: GObject.GType;
// Properties
get label(): string;
set label(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](adjustment: Gtk.Adjustment, label: string, digits: number): SpinScale;
// Conflicted with GimpUi.SpinButton.new
static ['new'](...args: never[]): any;
// Methods
get_constrain_drag(): boolean;
get_gamma(): number;
get_label(): string;
/**
* If `scale` has been set with a mnemonic key in its label text, this function
* returns the keyval used for the mnemonic accelerator.
* @returns the keyval usable for accelerators, or [const@Gdk.KEY_VoidSymbol].
*/
get_mnemonic_keyval(): number;
get_scale_limits(lower: number, upper: number): boolean;
/**
* If `constrain_drag` is TRUE, dragging the scale with the pointer will
* only result into integer values. It will still possible to set the
* scale to fractional values (if the spin scale "digits" is above 0)
* for instance with keyboard edit.
* @param constrain whether constraining to integer values when dragging with pointer.
*/
set_constrain_drag(constrain: boolean): void;
set_gamma(gamma: number): void;
set_label(label: string): void;
set_scale_limits(lower: number, upper: number): void;
unset_scale_limits(): void;
// Inherited properties
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace StringComboBox {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {
ellipsize: Pango.EllipsizeMode;
id_column: number;
idColumn: number;
label_column: number;
labelColumn: number;
value: string;
}
}
/**
* A #GtkComboBox subclass to select strings.
*/
class StringComboBox
extends Gtk.ComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Properties
/**
* Specifies the preferred place to ellipsize text in the combo-box,
* if the cell renderer does not have enough room to display the
* entire string.
*/
get ellipsize(): Pango.EllipsizeMode;
set ellipsize(val: Pango.EllipsizeMode);
/**
* The column in the associated GtkTreeModel that holds unique
* string IDs.
*/
get id_column(): number;
/**
* The column in the associated GtkTreeModel that holds unique
* string IDs.
*/
get idColumn(): number;
/**
* The column in the associated GtkTreeModel that holds strings to
* be used as labels in the combo-box.
*/
get label_column(): number;
/**
* The column in the associated GtkTreeModel that holds strings to
* be used as labels in the combo-box.
*/
get labelColumn(): number;
/**
* The active value (different from the "active" property of
* GtkComboBox which is the active index).
*/
get value(): string;
set value(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](model: Gtk.TreeModel, id_column: number, label_column: number): StringComboBox;
// Conflicted with Gtk.ComboBox.new
static ['new'](...args: never[]): any;
// Methods
/**
* Retrieves the value of the selected (active) item in the `combo_box`.
* @returns newly allocated ID string or %NULL if nothing was selected
*/
get_active(): string;
// Conflicted with Gtk.ComboBox.get_active
get_active(...args: never[]): any;
/**
* Looks up the item that belongs to the given `id` and makes it the
* selected item in the `combo_box`.
* @param id the ID of the item to select
* @returns %TRUE on success or %FALSE if there was no item for this value.
*/
set_active(id: string): boolean;
// Conflicted with Gtk.ComboBox.set_active
set_active(...args: never[]): any;
/**
* Sets a function that is used to decide about the sensitivity of
* rows in the `combo_box`. Use this if you want to set certain rows
* insensitive.
*
* Calling gtk_widget_queue_draw() on the `combo_box` will cause the
* sensitivity to be updated.
* @param func a function that returns a boolean value, or %NULL to unset
*/
set_sensitivity(func: StringSensitivityFunc): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`.
*
* The `column` is the column of the model to get a value from, and the
* `attribute` is the parameter on `cell` to be set from the value. So for
* example if column 2 of the model contains strings, you could have the
* “text” attribute of a #GtkCellRendererText get its values from column 2.
* @param cell a #GtkCellRenderer
* @param attribute an attribute on the renderer
* @param column the column position on the model to get the attribute from
*/
add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell a #GtkCellRenderer to clear the attribute mapping on
*/
clear_attributes(cell: Gtk.CellRenderer): void;
/**
* Returns the underlying #GtkCellArea which might be `cell_layout`
* if called on a #GtkCellArea or might be %NULL if no #GtkCellArea
* is used by `cell_layout`.
* @returns the cell area used by @cell_layout, or %NULL in case no cell area is used.
*/
get_area(): Gtk.CellArea | null;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): Gtk.CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
pack_end(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
pack_start(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`.
*
* Note that `cell` has already to be packed into `cell_layout`
* for this to function properly.
* @param cell a #GtkCellRenderer to reorder
* @param position new position to insert @cell at
*/
reorder(cell: Gtk.CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`.
*
* This function is used instead of the standard attributes mapping
* for setting the column value, and should set the value of `cell_layout’`s
* cell renderer(s) as appropriate.
*
* `func` may be %NULL to remove a previously set function.
* @param cell a #GtkCellRenderer
* @param func the #GtkCellLayoutDataFunc to use, or %NULL
*/
set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`.
*
* The `column` is the column of the model to get a value from, and the
* `attribute` is the parameter on `cell` to be set from the value. So for
* example if column 2 of the model contains strings, you could have the
* “text” attribute of a #GtkCellRendererText get its values from column 2.
* @param cell a #GtkCellRenderer
* @param attribute an attribute on the renderer
* @param column the column position on the model to get the attribute from
*/
vfunc_add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell a #GtkCellRenderer to clear the attribute mapping on
*/
vfunc_clear_attributes(cell: Gtk.CellRenderer): void;
/**
* Returns the underlying #GtkCellArea which might be `cell_layout`
* if called on a #GtkCellArea or might be %NULL if no #GtkCellArea
* is used by `cell_layout`.
*/
vfunc_get_area(): Gtk.CellArea | null;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): Gtk.CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
vfunc_pack_end(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
vfunc_pack_start(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`.
*
* Note that `cell` has already to be packed into `cell_layout`
* for this to function properly.
* @param cell a #GtkCellRenderer to reorder
* @param position new position to insert @cell at
*/
vfunc_reorder(cell: Gtk.CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`.
*
* This function is used instead of the standard attributes mapping
* for setting the column value, and should set the value of `cell_layout’`s
* cell renderer(s) as appropriate.
*
* `func` may be %NULL to remove a previously set function.
* @param cell a #GtkCellRenderer
* @param func the #GtkCellLayoutDataFunc to use, or %NULL
*/
vfunc_set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace UnitComboBox {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.CellEditable.ConstructorProps,
Gtk.CellLayout.ConstructorProps {}
}
/**
* #GimpUnitComboBox selects units stored in a #GimpUnitStore.
*/
class UnitComboBox
extends Gtk.ComboBox
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): UnitComboBox;
static new_with_model(model: UnitStore): UnitComboBox;
// Methods
/**
* Returns the #GimpUnit currently selected in the combo box.
* @returns The selected #GimpUnit.
*/
get_active(): Gimp.Unit;
// Conflicted with Gtk.ComboBox.get_active
get_active(...args: never[]): any;
/**
* Sets `unit` as the currently selected #GimpUnit on `combo`.
* @param unit a #GimpUnit
*/
set_active(unit: Gimp.Unit): void;
// Conflicted with Gtk.ComboBox.set_active
set_active(...args: never[]): any;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
/**
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
get expand(): boolean;
set expand(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the widget should grab focus when it is clicked with the mouse.
*
* This property is only relevant for widgets that can take focus.
*
* Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
* GtkComboBox) implemented this property individually.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* How to distribute horizontal space if widget gets extra space, see #GtkAlign
*/
get halign(): Gtk.Align;
set halign(val: Gtk.Align);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
get has_focus(): boolean;
set has_focus(val: boolean);
get hasFocus(): boolean;
set hasFocus(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkWidget::query-tooltip on `widget`.
* A value of %TRUE indicates that `widget` can have a tooltip, in this case
* the widget will be queried using #GtkWidget::query-tooltip to determine
* whether it will provide a tooltip or not.
*
* Note that setting this property to %TRUE for the first time will change
* the event masks of the GdkWindows of this widget to include leave-notify
* and motion-notify events. This cannot and will not be undone when the
* property is set to %FALSE again.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get height_request(): number;
set height_request(val: number);
get heightRequest(): number;
set heightRequest(val: number);
/**
* Whether to expand horizontally. See gtk_widget_set_hexpand().
*/
get hexpand(): boolean;
set hexpand(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpand_set(): boolean;
set hexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set().
*/
get hexpandSet(): boolean;
set hexpandSet(val: boolean);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
/**
* Sets all four sides' margin at once. If read, returns max
* margin on any side.
*/
get margin(): number;
set margin(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_bottom(): number;
set margin_bottom(val: number);
/**
* Margin on bottom side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginBottom(): number;
set marginBottom(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_end(): number;
set margin_end(val: number);
/**
* Margin on end of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginEnd(): number;
set marginEnd(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_left(): number;
set margin_left(val: number);
/**
* Margin on left side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginLeft(): number;
set marginLeft(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_right(): number;
set margin_right(val: number);
/**
* Margin on right side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginRight(): number;
set marginRight(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_start(): number;
set margin_start(val: number);
/**
* Margin on start of widget, horizontally. This property supports
* left-to-right and right-to-left text directions.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginStart(): number;
set marginStart(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get margin_top(): number;
set margin_top(val: number);
/**
* Margin on top side of widget.
*
* This property adds margin outside of the widget's normal size
* request, the margin will be added in addition to the size from
* gtk_widget_set_size_request() for example.
*/
get marginTop(): number;
set marginTop(val: number);
get name(): string;
set name(val: string);
get no_show_all(): boolean;
set no_show_all(val: boolean);
get noShowAll(): boolean;
set noShowAll(val: boolean);
/**
* The requested opacity of the widget. See gtk_widget_set_opacity() for
* more details about window opacity.
*
* Before 3.8 this was only available in GtkWindow
*/
get opacity(): number;
set opacity(val: number);
get parent(): Gtk.Container;
set parent(val: Gtk.Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scale_factor(): number;
/**
* The scale factor of the widget. See gtk_widget_get_scale_factor() for
* more details about widget scaling.
*/
get scaleFactor(): number;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* The style of the widget, which contains information about how it will look (colors, etc).
*/
get style(): Gtk.Style;
set style(val: Gtk.Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_markup(): string;
set tooltip_markup(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the [Pango text markup language][PangoMarkupFormat].
* Also see gtk_tooltip_set_markup().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipMarkup(): string;
set tooltipMarkup(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltip_text(): string;
set tooltip_text(val: string);
/**
* Sets the text of tooltip to be the given string.
*
* Also see gtk_tooltip_set_text().
*
* This is a convenience property which will take care of getting the
* tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
* will automatically be set to %TRUE and there will be taken care of
* #GtkWidget::query-tooltip in the default signal handler.
*
* Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup
* are set, the last one wins.
*/
get tooltipText(): string;
set tooltipText(val: string);
/**
* How to distribute vertical space if widget gets extra space, see #GtkAlign
*/
get valign(): Gtk.Align;
set valign(val: Gtk.Align);
/**
* Whether to expand vertically. See gtk_widget_set_vexpand().
*/
get vexpand(): boolean;
set vexpand(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpand_set(): boolean;
set vexpand_set(val: boolean);
/**
* Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set().
*/
get vexpandSet(): boolean;
set vexpandSet(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`.
*
* The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from
* gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type.
*
* gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for
* editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done.
*
* Note that the `cell_editable` is created on-demand for the current edit; its
* lifetime is temporary and does not persist across other edits and/or cells.
* @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`.
*
* The `column` is the column of the model to get a value from, and the
* `attribute` is the parameter on `cell` to be set from the value. So for
* example if column 2 of the model contains strings, you could have the
* “text” attribute of a #GtkCellRendererText get its values from column 2.
* @param cell a #GtkCellRenderer
* @param attribute an attribute on the renderer
* @param column the column position on the model to get the attribute from
*/
add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell a #GtkCellRenderer to clear the attribute mapping on
*/
clear_attributes(cell: Gtk.CellRenderer): void;
/**
* Returns the underlying #GtkCellArea which might be `cell_layout`
* if called on a #GtkCellArea or might be %NULL if no #GtkCellArea
* is used by `cell_layout`.
* @returns the cell area used by @cell_layout, or %NULL in case no cell area is used.
*/
get_area(): Gtk.CellArea | null;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): Gtk.CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
pack_end(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
pack_start(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`.
*
* Note that `cell` has already to be packed into `cell_layout`
* for this to function properly.
* @param cell a #GtkCellRenderer to reorder
* @param position new position to insert @cell at
*/
reorder(cell: Gtk.CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`.
*
* This function is used instead of the standard attributes mapping
* for setting the column value, and should set the value of `cell_layout’`s
* cell renderer(s) as appropriate.
*
* `func` may be %NULL to remove a previously set function.
* @param cell a #GtkCellRenderer
* @param func the #GtkCellLayoutDataFunc to use, or %NULL
*/
set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`.
*
* The `column` is the column of the model to get a value from, and the
* `attribute` is the parameter on `cell` to be set from the value. So for
* example if column 2 of the model contains strings, you could have the
* “text” attribute of a #GtkCellRendererText get its values from column 2.
* @param cell a #GtkCellRenderer
* @param attribute an attribute on the renderer
* @param column the column position on the model to get the attribute from
*/
vfunc_add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell a #GtkCellRenderer to clear the attribute mapping on
*/
vfunc_clear_attributes(cell: Gtk.CellRenderer): void;
/**
* Returns the underlying #GtkCellArea which might be `cell_layout`
* if called on a #GtkCellArea or might be %NULL if no #GtkCellArea
* is used by `cell_layout`.
*/
vfunc_get_area(): Gtk.CellArea | null;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): Gtk.CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
vfunc_pack_end(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell a #GtkCellRenderer
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout
*/
vfunc_pack_start(cell: Gtk.CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`.
*
* Note that `cell` has already to be packed into `cell_layout`
* for this to function properly.
* @param cell a #GtkCellRenderer to reorder
* @param position new position to insert @cell at
*/
vfunc_reorder(cell: Gtk.CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`.
*
* This function is used instead of the standard attributes mapping
* for setting the column value, and should set the value of `cell_layout’`s
* cell renderer(s) as appropriate.
*
* `func` may be %NULL to remove a previously set function.
* @param cell a #GtkCellRenderer
* @param func the #GtkCellLayoutDataFunc to use, or %NULL
*/
vfunc_set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | 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;
/**
* For widgets that can be “activated” (buttons, menu items, etc.)
* this function activates them. Activation is what happens when you
* press Enter on a widget during key navigation. If `widget` isn't
* activatable, the function returns %FALSE.
* @returns %TRUE if the widget was activatable
*/
activate(): boolean;
/**
* Installs an accelerator for this `widget` in `accel_group` that causes
* `accel_signal` to be emitted if the accelerator is activated.
* The `accel_group` needs to be added to the widget’s toplevel via
* gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION.
* Accelerators added through this function are not user changeable during
* runtime. If you want to support accelerators that can be changed by the
* user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
* gtk_menu_item_set_accel_path() instead.
* @param accel_signal widget signal to emit on accelerator activation
* @param accel_group accel group for this widget, added to its toplevel
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE
*/
add_accelerator(
accel_signal: string,
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: Gtk.AccelFlags | null,
): void;
/**
* Adds the device events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_device_events() for details.
* @param device a #GdkDevice
* @param events an event mask, see #GdkEventMask
*/
add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() and the
* [input handling overview][event-masks] for details.
* @param events an event mask, see #GdkEventMask
*/
add_events(events: number): void;
/**
* Adds a widget to the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). Note the
* list of mnemonic labels for the widget is cleared when the
* widget is destroyed, so the caller must make sure to update
* its internal state at this point as well, by using a connection
* to the #GtkWidget::destroy signal or a weak notifier.
* @param label a #GtkWidget that acts as a mnemonic label for @widget
*/
add_mnemonic_label(label: Gtk.Widget): void;
/**
* Queues an animation frame update and adds a callback to be called
* before each frame. Until the tick callback is removed, it will be
* called frequently (usually at the frame rate of the output device
* or as quickly as the application can be repainted, whichever is
* slower). For this reason, is most suitable for handling graphics
* that change every frame or every few frames. The tick callback does
* not automatically imply a relayout or repaint. If you want a
* repaint or relayout, and aren’t changing widget properties that
* would trigger that (for example, changing the text of a #GtkLabel),
* then you will have to call gtk_widget_queue_resize() or
* gtk_widget_queue_draw_area() yourself.
*
* gdk_frame_clock_get_frame_time() should generally be used for timing
* continuous animations and
* gdk_frame_timings_get_predicted_presentation_time() if you are
* trying to display isolated frames at particular times.
*
* This is a more convenient alternative to connecting directly to the
* #GdkFrameClock::update signal of #GdkFrameClock, since you don't
* have to worry about when a #GdkFrameClock is assigned to a widget.
* @param callback function to call for updating animations
* @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback()
*/
add_tick_callback(callback: Gtk.TickCallback): number;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
* @returns %TRUE if the accelerator can be activated.
*/
can_activate_accel(signal_id: number): boolean;
/**
* This function is used by custom widget implementations; if you're
* writing an app, you’d use gtk_widget_grab_focus() to move the focus
* to a particular widget, and gtk_container_set_focus_chain() to
* change the focus tab order. So you may want to investigate those
* functions instead.
*
* gtk_widget_child_focus() is called by containers as the user moves
* around the window using keyboard shortcuts. `direction` indicates
* what kind of motion is taking place (up, down, left, right, tab
* forward, tab backward). gtk_widget_child_focus() emits the
* #GtkWidget::focus signal; widgets override the default handler
* for this signal in order to implement appropriate focus behavior.
*
* The default ::focus handler for a widget should return %TRUE if
* moving in `direction` left the focus on a focusable location inside
* that widget, and %FALSE if moving in `direction` moved the focus
* outside the widget. If returning %TRUE, widgets normally
* call gtk_widget_grab_focus() to place the focus accordingly;
* if returning %FALSE, they don’t modify the current focus location.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: Gtk.DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
child_notify(child_property: string): void;
// Conflicted with Gtk.Container.child_notify
child_notify(...args: never[]): any;
/**
* Same as gtk_widget_path(), but always uses the name of a widget’s type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Computes whether a container should give this widget extra space
* when possible. Containers should check this, rather than
* looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand().
*
* This function already checks whether the widget is visible, so
* visibility does not need to be checked separately. Non-visible
* widgets are not expanded.
*
* The computed expand value uses either the expand setting explicitly
* set on the widget itself, or, if none has been explicitly set,
* the widget may expand if some of its children do.
* @param orientation expand direction
* @returns whether widget tree rooted here should be expanded
*/
compute_expand(orientation: Gtk.Orientation | null): boolean;
/**
* Creates a new #PangoContext with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget. See also gtk_widget_get_pango_context().
* @returns the new #PangoContext
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
* If you keep a #PangoLayout created in this way around, you need
* to re-create it when the widget #PangoContext is replaced.
* This can be tracked by using the #GtkWidget::screen-changed signal
* on the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text?: string | null): Pango.Layout;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
destroy(): void;
/**
* This function sets *`widget_pointer` to %NULL if `widget_pointer` !=
* %NULL. It’s intended to be used as a callback connected to the
* “destroy” signal of a widget. You connect gtk_widget_destroyed()
* as a signal handler, and pass the address of your widget variable
* as user data. Then when the widget is destroyed, the variable will
* be set to %NULL. Useful for example to avoid multiple copies
* of the same dialog.
* @param widget_pointer address of a variable that contains @widget
*/
destroyed(widget_pointer: Gtk.Widget): Gtk.Widget;
/**
* Returns %TRUE if `device` has been shadowed by a GTK+
* device grab on another widget, so it would stop sending
* events to `widget`. This may be used in the
* #GtkWidget::grab-notify signal to check for specific
* devices. See gtk_device_grab_add().
* @param device a #GdkDevice
* @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget.
*/
device_is_shadowed(device: Gdk.Device): boolean;
/**
* This function is equivalent to gtk_drag_begin_with_coordinates(),
* passing -1, -1 as coordinates.
* @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, or %NULL if none can be obtained.
* @returns the context for this drag
*/
drag_begin(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event?: Gdk.Event | null,
): Gdk.DragContext;
/**
* 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 to get information about the drag.
*
* Generally there are three cases when you want to start a drag by hand by
* calling this function:
*
* 1. During a #GtkWidget::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 #GtkWidget::button-press-event handler.
*
* 2. During a #GtkWidget::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 #GtkWidget::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 really cannot pass a real event, pass %NULL instead.
* @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, or %NULL if none can be obtained.
* @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position
* @returns the context for this drag
*/
drag_begin_with_coordinates(
targets: Gtk.TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event | null,
x: number,
y: number,
): 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 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.
*/
drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
/**
* Add the image targets supported by #GtkSelectionData 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().
*/
drag_dest_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_dest_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_dest_add_uri_targets(): void;
/**
* Looks for a match between the supported targets of `context` and the
* `dest_target_list,` returning the first matching target, otherwise
* returning %GDK_NONE. `dest_target_list` should usually be the return
* value from gtk_drag_dest_get_target_list(), but some widgets may
* have different valid targets for different parts of the widget; in
* that case, they will have to implement a drag_motion handler that
* passes the correct target list to this function.
* @param context drag context
* @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget).
* @returns first target that the source offers and the dest can accept, or %GDK_NONE
*/
drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_dest_get_target_list(): Gtk.TargetList | null;
/**
* Returns whether the widget has been configured to always
* emit #GtkWidget::drag-motion signals.
* @returns %TRUE if the widget always emits #GtkWidget::drag-motion events
*/
drag_dest_get_track_motion(): 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:
*
* ```c
* 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 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.
*/
drag_dest_set(
flags: Gtk.DestDefaults | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets this widget as a proxy for drops to another window.
* @param proxy_window the window to which to forward drag events
* @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)
* @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow.
*/
drag_dest_set_proxy(
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 target_list list of droppable targets, or %NULL for none
*/
drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Tells the widget to emit #GtkWidget::drag-motion and
* #GtkWidget::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 track_motion whether to accept all targets
*/
drag_dest_set_track_motion(track_motion: boolean): void;
/**
* Clears information about a drop destination set with
* gtk_drag_dest_set(). The widget will no longer receive
* notification of drags.
*/
drag_dest_unset(): void;
/**
* Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a
* #GtkWidget::drag-data-received signal. Failure of the retrieval
* is indicated by the length field of the `selection_data`
* signal parameter being negative. However, when gtk_drag_get_data()
* is called implicitely because the %GTK_DEST_DEFAULT_DROP was set,
* then the widget will not receive notification of failed
* drops.
* @param context the drag context
* @param target the target (form of the data) to retrieve
* @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal
*/
drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
drag_highlight(): void;
/**
* Add the writable image targets supported by #GtkSelectionData 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().
*/
drag_source_add_image_targets(): void;
/**
* Add the text targets supported by #GtkSelectionData 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().
*/
drag_source_add_text_targets(): void;
/**
* Add the URI targets supported by #GtkSelectionData 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().
*/
drag_source_add_uri_targets(): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @returns the #GtkTargetList, or %NULL if none
*/
drag_source_get_target_list(): Gtk.TargetList | null;
/**
* 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 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
*/
drag_source_set(
start_button_mask: Gdk.ModifierType | null,
targets: Gtk.TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to `icon`. See the docs for #GtkIconTheme for more details.
* @param icon A #GIcon
*/
drag_source_set_icon_gicon(icon: Gio.Icon): 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 icon_name name of icon to use
*/
drag_source_set_icon_name(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 pixbuf the #GdkPixbuf for the drag icon
*/
drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param stock_id the ID of the stock icon to use
*/
drag_source_set_icon_stock(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 target_list list of draggable targets, or %NULL for none
*/
drag_source_set_target_list(target_list?: Gtk.TargetList | null): void;
/**
* Undoes the effects of gtk_drag_source_set().
*/
drag_source_unset(): void;
/**
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
drag_unhighlight(): void;
/**
* Draws `widget` to `cr`. The top left corner of the widget will be
* drawn to the currently set origin point of `cr`.
*
* You should pass a cairo context as `cr` argument that is in an
* original state. Otherwise the resulting drawing is undefined. For
* example changing the operator using cairo_set_operator() or the
* line width using cairo_set_line_width() might have unwanted side
* effects.
* You may however change the context’s transform matrix - like with
* cairo_scale(), cairo_translate() or cairo_set_matrix() and clip
* region with cairo_clip() prior to calling this function. Also, it
* is fine to modify the context with cairo_save() and
* cairo_push_group() prior to calling this function.
*
* Note that special-purpose widgets may contain special code for
* rendering to the screen and might appear differently on screen
* and when rendered using gtk_widget_draw().
* @param cr a cairo context to draw to
*/
draw(cr: cairo.Context): void;
/**
* Ensures that `widget` has a style (`widget->`style).
*
* Not a very useful function; most of the time, if you
* want the style, the widget is realized, and realized
* widgets are guaranteed to have a style already.
*/
ensure_style(): void;
/**
* Notifies the user about an input-related error on this widget.
* If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls
* gdk_window_beep(), otherwise it does nothing.
*
* Note that the effect of gdk_window_beep() can be configured in many
* ways, depending on the windowing backend and the desktop environment
* or window manager that is used.
*/
error_bell(): void;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
event(event: Gdk.Event): boolean;
/**
* Stops emission of #GtkWidget::child-notify signals on `widget`. The
* signals are queued until gtk_widget_thaw_child_notify() is called
* on `widget`.
*
* This is the analogue of g_object_freeze_notify() for child properties.
*/
freeze_child_notify(): void;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the #GActionGroup that was registered using `prefix`. The resulting
* #GActionGroup may have been registered to `widget` or any #GtkWidget in its
* ancestry.
*
* If no action group was found matching `prefix,` then %NULL is returned.
* @param prefix The “prefix” of the action group.
* @returns A #GActionGroup or %NULL.
*/
get_action_group(prefix: string): Gio.ActionGroup | null;
/**
* Returns the baseline that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function, and when allocating child
* widgets in #GtkWidget::size_allocate.
* @returns the baseline of the @widget, or -1 if none
*/
get_allocated_baseline(): number;
/**
* Returns the height that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the height of the @widget
*/
get_allocated_height(): number;
/**
* Retrieves the widget’s allocated size.
*
* This function returns the last values passed to
* gtk_widget_size_allocate_with_baseline(). The value differs from
* the size returned in gtk_widget_get_allocation() in that functions
* like gtk_widget_set_halign() can adjust the allocation, but not
* the value returned by this function.
*
* If a widget is not visible, its allocated size is 0.
*/
get_allocated_size(): [Gtk.Allocation, number];
/**
* Returns the width that has currently been allocated to `widget`.
* This function is intended to be used when implementing handlers
* for the #GtkWidget::draw function.
* @returns the width of the @widget
*/
get_allocated_width(): number;
/**
* Retrieves the widget’s allocation.
*
* Note, when implementing a #GtkContainer: a widget’s allocation will
* be its “adjusted” allocation, that is, the widget’s parent
* container typically calls gtk_widget_size_allocate() with an
* allocation, and that allocation is then adjusted (to handle margin
* and alignment for example) before assignment to the widget.
* gtk_widget_get_allocation() returns the adjusted allocation that
* was actually assigned to the widget. The adjusted allocation is
* guaranteed to be completely contained within the
* gtk_widget_size_allocate() allocation, however. So a #GtkContainer
* is guaranteed that its children stay inside the assigned bounds,
* but not that they have exactly the bounds the container assigned.
* There is no way to get the original allocation assigned by
* gtk_widget_size_allocate(), since it isn’t stored; if a container
* implementation needs that information it will have to track it itself.
*/
get_allocation(): Gtk.Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
* the first #GtkBox that’s an ancestor of `widget`. No reference will be
* added to the returned widget; it should not be unreferenced. See note
* about checking for a toplevel #GtkWindow in the docs for
* gtk_widget_get_toplevel().
*
* Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
* considers `widget` to be an ancestor of itself.
* @param widget_type ancestor type
* @returns the ancestor widget, or %NULL if not found
*/
get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* See gtk_widget_set_app_paintable()
* @returns %TRUE if the widget is app paintable
*/
get_app_paintable(): boolean;
/**
* Determines whether `widget` can be a default widget. See
* gtk_widget_set_can_default().
* @returns %TRUE if @widget can be a default widget, %FALSE otherwise
*/
get_can_default(): boolean;
/**
* Determines whether `widget` can own the input focus. See
* gtk_widget_set_can_focus().
* @returns %TRUE if @widget can own the input focus, %FALSE otherwise
*/
get_can_focus(): boolean;
/**
* This function is only for use in widget implementations. Obtains
* `widget->`requisition, unless someone has forced a particular
* geometry on the widget (e.g. with gtk_widget_set_size_request()),
* in which case it returns that geometry instead of the widget's
* requisition.
*
* This function differs from gtk_widget_size_request() in that
* it retrieves the last size request value from `widget->`requisition,
* while gtk_widget_size_request() actually calls the "size_request" method
* on `widget` to compute the size request and fill in `widget->`requisition,
* and only then returns `widget->`requisition.
*
* Because this function does not call the “size_request” method, it
* can only be used when you know that `widget->`requisition is
* up-to-date, that is, gtk_widget_size_request() has been called
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*/
get_child_requisition(): Gtk.Requisition;
/**
* Gets the value set with gtk_widget_set_child_visible().
* If you feel a need to use this function, your code probably
* needs reorganization.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @returns %TRUE if the widget is mapped with the parent.
*/
get_child_visible(): boolean;
/**
* Retrieves the widget’s clip area.
*
* The clip area is the area in which all of `widget'`s drawing will
* happen. Other toolkits call it the bounding box.
*
* Historically, in GTK+ the clip area has been equal to the allocation
* retrieved via gtk_widget_get_allocation().
*/
get_clip(): Gtk.Allocation;
/**
* Returns the clipboard object for the given selection to
* be used with `widget`. `widget` must have a #GdkDisplay
* associated with it, so must be attached to a toplevel
* window.
* @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection.
* @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
*/
get_clipboard(selection: Gdk.Atom): Gtk.Clipboard;
/**
* Obtains the composite name of a widget.
* @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed.
*/
get_composite_name(): string;
/**
* Returns whether `device` can interact with `widget` and its
* children. See gtk_widget_set_device_enabled().
* @param device a #GdkDevice
* @returns %TRUE is @device is enabled for @widget
*/
get_device_enabled(device: Gdk.Device): boolean;
/**
* Returns the events mask for the widget corresponding to an specific device. These
* are the events that the widget will receive when `device` operates on it.
* @param device a #GdkDevice
* @returns device event mask for @widget
*/
get_device_events(device: Gdk.Device): Gdk.EventMask;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): Gtk.TextDirection;
/**
* Get the #GdkDisplay for the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow at the top.
*
* In general, you should only create display specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkDisplay for the toplevel for this widget.
*/
get_display(): Gdk.Display;
/**
* Determines whether the widget is double buffered.
*
* See gtk_widget_set_double_buffered()
* @returns %TRUE if the widget is double buffered
*/
get_double_buffered(): boolean;
/**
* Returns the event mask (see #GdkEventMask) for the widget. These are the
* events that the widget will receive.
*
* Note: Internally, the widget event mask will be the logical OR of the event
* mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the
* event mask necessary to cater for every #GtkEventController created for the
* widget.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Returns whether the widget should grab focus when it is clicked with the mouse.
* See gtk_widget_set_focus_on_click().
* @returns %TRUE if the widget should grab focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the font map that has been set with gtk_widget_set_font_map().
* @returns A #PangoFontMap, or %NULL
*/
get_font_map(): Pango.FontMap | null;
/**
* Returns the #cairo_font_options_t used for Pango rendering. When not set,
* the defaults font options for the #GdkScreen will be used.
* @returns the #cairo_font_options_t or %NULL if not set
*/
get_font_options(): cairo.FontOptions | null;
/**
* Obtains the frame clock for a widget. The frame clock is a global
* “ticker” that can be used to drive animations and repaints. The
* most common reason to get the frame clock is to call
* gdk_frame_clock_get_frame_time(), in order to get a time to use for
* animating. For example you might record the start of the animation
* with an initial value from gdk_frame_clock_get_frame_time(), and
* then update the animation by calling
* gdk_frame_clock_get_frame_time() again during each repaint.
*
* gdk_frame_clock_request_phase() will result in a new frame on the
* clock, but won’t necessarily repaint any widgets. To repaint a
* widget, you have to use gtk_widget_queue_draw() which invalidates
* the widget (thus scheduling it to receive a draw on the next
* frame). gtk_widget_queue_draw() will also end up requesting a frame
* on the appropriate frame clock.
*
* A widget’s frame clock will not change while the widget is
* mapped. Reparenting a widget (which implies a temporary unmap) can
* change the widget’s frame clock.
*
* Unrealized widgets do not have a frame clock.
* @returns a #GdkFrameClock, or %NULL if widget is unrealized
*/
get_frame_clock(): Gdk.FrameClock | null;
/**
* Gets the value of the #GtkWidget:halign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. Baselines are not supported for horizontal
* alignment.
* @returns the horizontal alignment of @widget
*/
get_halign(): Gtk.Align;
/**
* Returns the current value of the has-tooltip property. See
* #GtkWidget:has-tooltip for more information.
* @returns current value of has-tooltip on @widget.
*/
get_has_tooltip(): boolean;
/**
* Determines whether `widget` has a #GdkWindow of its own. See
* gtk_widget_set_has_window().
* @returns %TRUE if @widget has a window, %FALSE otherwise
*/
get_has_window(): boolean;
/**
* Gets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Containers should use gtk_widget_compute_expand() rather than
* this function, to see whether a widget, or any of its children,
* has the expand flag set. If any child of a widget wants to
* expand, the parent may ask to expand also.
*
* This function only looks at the widget’s own hexpand flag, rather
* than computing whether the entire widget tree rooted at this widget
* wants to expand.
* @returns whether hexpand flag is set
*/
get_hexpand(): boolean;
/**
* Gets whether gtk_widget_set_hexpand() has been used to
* explicitly set the expand flag on this widget.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @returns whether hexpand has been explicitly set
*/
get_hexpand_set(): boolean;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* Gets the value of the #GtkWidget:margin-bottom property.
* @returns The bottom margin of @widget
*/
get_margin_bottom(): number;
/**
* Gets the value of the #GtkWidget:margin-end property.
* @returns The end margin of @widget
*/
get_margin_end(): number;
/**
* Gets the value of the #GtkWidget:margin-left property.
* @returns The left margin of @widget
*/
get_margin_left(): number;
/**
* Gets the value of the #GtkWidget:margin-right property.
* @returns The right margin of @widget
*/
get_margin_right(): number;
/**
* Gets the value of the #GtkWidget:margin-start property.
* @returns The start margin of @widget
*/
get_margin_start(): number;
/**
* Gets the value of the #GtkWidget:margin-top property.
* @returns The top margin of @widget
*/
get_margin_top(): number;
/**
* Returns the modifier mask the `widget’`s windowing system backend
* uses for a particular purpose.
*
* See gdk_keymap_get_modifier_mask().
* @param intent the use case for the modifier mask
* @returns the modifier mask used for @intent.
*/
get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType;
/**
* Returns the current modifier style for the widget. (As set by
* gtk_widget_modify_style().) If no style has previously set, a new
* #GtkRcStyle will be created with all values unset, and set as the
* modifier style for the widget. If you make changes to this rc
* style, you must call gtk_widget_modify_style(), passing in the
* returned rc style, to make sure that your changes take effect.
*
* Caution: passing the style back to gtk_widget_modify_style() will
* normally end up destroying it, because gtk_widget_modify_style() copies
* the passed-in style and sets the copy as the new modifier style,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
* @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref().
*/
get_modifier_style(): Gtk.RcStyle;
/**
* Retrieves the name of a widget. See gtk_widget_set_name() for the
* significance of widget names.
* @returns name of the widget. This string is owned by GTK+ and should not be modified or freed
*/
get_name(): string;
/**
* Returns the current value of the #GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all()
* will affect this widget.
* @returns the current value of the “no-show-all” property.
*/
get_no_show_all(): boolean;
/**
* Fetches the requested opacity for this widget.
* See gtk_widget_set_opacity().
* @returns the requested opacity for this widget.
*/
get_opacity(): number;
/**
* Gets a #PangoContext with the appropriate font map, font description,
* and base direction for this widget. Unlike the context returned
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
* match any changes to the widget’s attributes. This can be tracked
* by using the #GtkWidget::screen-changed signal on the widget.
* @returns the #PangoContext for the widget.
*/
get_pango_context(): Pango.Context;
/**
* Returns the parent container of `widget`.
* @returns the parent container of @widget, or %NULL
*/
get_parent(): Gtk.Widget | null;
/**
* Gets `widget’`s parent window, or %NULL if it does not have one.
* @returns the parent window of @widget, or %NULL if it does not have a parent window.
*/
get_parent_window(): Gdk.Window | null;
/**
* Returns the #GtkWidgetPath representing `widget,` if the widget
* is not connected to a toplevel widget, a partial path will be
* created.
* @returns The #GtkWidgetPath representing @widget
*/
get_path(): Gtk.WidgetPath;
/**
* Obtains the location of the mouse pointer in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(); and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*/
get_pointer(): [number, number];
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves the minimum and natural size of a widget, taking
* into account the widget’s preference for height-for-width management.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement. It can be used
* to deduce toplevel window and menu sizes as well as child widgets in
* free-form containers such as GtkLayout.
*
* Handle with care. Note that the natural height of a height-for-width
* widget will generally be a smaller size than the minimum height, since the required
* height for the natural width is generally smaller than the required height for
* the minimum width.
*
* Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support
* baseline alignment.
*/
get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
get_preferred_width_for_height(height: number): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is always treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_set_receives_default().
* @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
* @returns The #GtkSizeRequestMode preferred by @widget.
*/
get_request_mode(): Gtk.SizeRequestMode;
/**
* Retrieves the widget’s requisition.
*
* This function should only be used by widget implementations in
* order to figure whether the widget’s requisition has actually
* changed after some internal state change (so that they can call
* gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
*
* Normally, gtk_widget_size_request() should be used.
*/
get_requisition(): Gtk.Requisition;
/**
* Get the root window where this widget is located. This function can
* only be called after the widget has been added to a widget
* hierarchy with #GtkWindow at the top.
*
* The root window is useful for such purposes as creating a popup
* #GdkWindow associated with the window. In general, you should only
* create display specific resources when a widget has been realized,
* and you should free those resources when the widget is unrealized.
* @returns the #GdkWindow root window for the toplevel for this widget.
*/
get_root_window(): Gdk.Window;
/**
* Retrieves the internal scale factor that maps from window coordinates
* to the actual device pixels. On traditional systems this is 1, on
* high density outputs, it can be a higher value (typically 2).
*
* See gdk_window_get_scale_factor().
* @returns the scale factor for @widget
*/
get_scale_factor(): number;
/**
* Get the #GdkScreen from the toplevel window associated with
* this widget. This function can only be called after the widget
* has been added to a widget hierarchy with a #GtkWindow
* at the top.
*
* In general, you should only create screen specific
* resources when a widget has been realized, and you should
* free those resources when the widget is unrealized.
* @returns the #GdkScreen for the toplevel for this widget.
*/
get_screen(): Gdk.Screen;
/**
* Returns the widget’s sensitivity (in the sense of returning
* the value that has been set using gtk_widget_set_sensitive()).
*
* The effective sensitivity of a widget is however determined by both its
* own and its parent widget’s sensitivity. See gtk_widget_is_sensitive().
* @returns %TRUE if the widget is sensitive
*/
get_sensitive(): boolean;
/**
* Gets the settings object holding the settings used for this widget.
*
* Note that this function can only be called when the #GtkWidget
* is attached to a toplevel, since the settings object is specific
* to a particular #GdkScreen.
* @returns the relevant #GtkSettings object
*/
get_settings(): Gtk.Settings;
/**
* Gets the size request that was explicitly set for the widget using
* gtk_widget_set_size_request(). A value of -1 stored in `width` or
* `height` indicates that that dimension has not been set explicitly
* and the natural requisition of the widget will be used instead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually request, call gtk_widget_get_preferred_size() instead of
* this function.
*/
get_size_request(): [number, number];
/**
* Returns the widget’s state. See gtk_widget_set_state().
* @returns the state of @widget.
*/
get_state(): Gtk.StateType;
/**
* Returns the widget state as a flag set. It is worth mentioning
* that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
* returned, that is, also based on parent insensitivity, even if
* `widget` itself is sensitive.
*
* Also note that if you are looking for a way to obtain the
* #GtkStateFlags to pass to a #GtkStyleContext method, you
* should look at gtk_style_context_get_state().
* @returns The state flags for widget
*/
get_state_flags(): Gtk.StateFlags;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget’s #GtkStyle
*/
get_style(): Gtk.Style;
/**
* Returns the style context associated to `widget`. The returned object is
* guaranteed to be the same for the lifetime of `widget`.
* @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed.
*/
get_style_context(): Gtk.StyleContext;
/**
* Returns %TRUE if `widget` is multiple pointer aware. See
* gtk_widget_set_support_multidevice() for more information.
* @returns %TRUE if @widget is multidevice aware.
*/
get_support_multidevice(): boolean;
/**
* Fetch an object build from the template XML for `widget_type` in this `widget` instance.
*
* This will only report children which were previously declared with
* gtk_widget_class_bind_template_child_full() or one of its
* variants.
*
* This function is only meant to be called for code which is private to the `widget_type` which
* declared the child and is meant for language bindings which cannot easily make use
* of the GObject structure offsets.
* @param widget_type The #GType to get a template child for
* @param name The “id” of the child defined in the template XML
* @returns The object built in the template XML with the id @name
*/
get_template_child(widget_type: GObject.GType, name: string): T;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string | null;
/**
* Gets the contents of the tooltip for `widget`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string | null;
/**
* Returns the #GtkWindow of the current tooltip. This can be the
* GtkWindow created by default, or the custom tooltip window set
* using gtk_widget_set_tooltip_window().
* @returns The #GtkWindow of the current tooltip.
*/
get_tooltip_window(): Gtk.Window;
/**
* This function returns the topmost widget in the container hierarchy
* `widget` is a part of. If `widget` has no parent widgets, it will be
* returned as the topmost widget. No reference will be added to the
* returned widget; it should not be unreferenced.
*
* Note the difference in behavior vs. gtk_widget_get_ancestor();
* `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
* would return
* %NULL if `widget` wasn’t inside a toplevel window, and if the
* window was inside a #GtkWindow-derived widget which was in turn
* inside the toplevel #GtkWindow. While the second case may
* seem unlikely, it actually happens when a #GtkPlug is embedded
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
*
* ```c
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (GTK_IS_WINDOW (toplevel))
* {
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor.
*/
get_toplevel(): Gtk.Widget;
/**
* Gets the value of the #GtkWidget:valign property.
*
* For backwards compatibility reasons this method will never return
* %GTK_ALIGN_BASELINE, but instead it will convert it to
* %GTK_ALIGN_FILL. If your widget want to support baseline aligned
* children it must use gtk_widget_get_valign_with_baseline(), or
* `g_object_get (widget, "valign", &value, NULL)`, which will
* also report the true value.
* @returns the vertical alignment of @widget, ignoring baseline alignment
*/
get_valign(): Gtk.Align;
/**
* Gets the value of the #GtkWidget:valign property, including
* %GTK_ALIGN_BASELINE.
* @returns the vertical alignment of @widget
*/
get_valign_with_baseline(): Gtk.Align;
/**
* Gets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_get_hexpand() for more detail.
* @returns whether vexpand flag is set
*/
get_vexpand(): boolean;
/**
* Gets whether gtk_widget_set_vexpand() has been used to
* explicitly set the expand flag on this widget.
*
* See gtk_widget_get_hexpand_set() for more detail.
* @returns whether vexpand has been explicitly set
*/
get_vexpand_set(): boolean;
/**
* Determines whether the widget is visible. If you want to
* take into account whether the widget’s parent is also marked as
* visible, use gtk_widget_is_visible() instead.
*
* This function does not check if the widget is obscured in any way.
*
* See gtk_widget_set_visible().
* @returns %TRUE if the widget is visible
*/
get_visible(): boolean;
/**
* Gets the visual that will be used to render `widget`.
* @returns the visual for @widget
*/
get_visual(): Gdk.Visual;
/**
* Returns the widget’s window if it is realized, %NULL otherwise
* @returns @widget’s window.
*/
get_window(): Gdk.Window | null;
/**
* Makes `widget` the current grabbed widget.
*
* This means that interaction with other widgets in the same
* application is blocked and mouse as well as keyboard events
* are delivered to this widget.
*
* If `widget` is not sensitive, it is not set as the current
* grabbed widget and this function does nothing.
*/
grab_add(): void;
/**
* Causes `widget` to become the default widget. `widget` must be able to be
* a default widget; typically you would ensure this yourself
* by calling gtk_widget_set_can_default() with a %TRUE value.
* The default widget is activated when
* the user presses Enter in a window. Default widgets must be
* activatable, that is, gtk_widget_activate() should affect them. Note
* that #GtkEntry widgets require the “activates-default” property
* set to %TRUE before they activate the default widget when Enter
* is pressed and the #GtkEntry is focused.
*/
grab_default(): void;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
grab_focus(): void;
/**
* Removes the grab from the given widget.
*
* You have to pair calls to gtk_grab_add() and gtk_grab_remove().
*
* If `widget` does not have the grab, this function does nothing.
*/
grab_remove(): void;
/**
* Determines whether the widget is currently grabbing events, so it
* is the only widget receiving input events (keyboard and mouse).
*
* See also gtk_grab_add().
* @returns %TRUE if the widget is in the grab_widgets stack
*/
has_grab(): boolean;
/**
* Determines if the widget style has been looked up through the rc mechanism.
* @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise.
*/
has_rc_style(): boolean;
/**
* Checks whether there is a #GdkScreen is associated with
* this widget. All toplevel widgets have an associated
* screen, and all widgets added into a hierarchy with a toplevel
* window at the top.
* @returns %TRUE if there is a #GdkScreen associated with the widget.
*/
has_screen(): boolean;
/**
* Determines if the widget should show a visible indication that
* it has the global input focus. This is a convenience function for
* use in ::draw handlers that takes into account whether focus
* indication should currently be shown in the toplevel window of
* `widget`. See gtk_window_get_focus_visible() for more information
* about focus indication.
*
* To find out if the widget has the global input focus, use
* gtk_widget_has_focus().
* @returns %TRUE if the widget should display a “focus rectangle”
*/
has_visible_focus(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Utility function; intended to be connected to the #GtkWidget::delete-event
* signal on a #GtkWindow. The function calls gtk_widget_hide() on its
* argument, then returns %TRUE. If connected to ::delete-event, the
* result is that clicking the close button for a window (on the
* window frame, top right corner usually) will hide but not destroy
* the window. By default, GTK+ destroys windows when ::delete-event
* is received.
* @returns %TRUE
*/
hide_on_delete(): boolean;
/**
* Returns whether the widget is currently being destroyed.
* This information can sometimes be used to avoid doing
* unnecessary work.
* @returns %TRUE if @widget is being destroyed
*/
in_destruction(): boolean;
/**
* Creates and initializes child widgets defined in templates. This
* function must be called in the instance initializer for any
* class which assigned itself a template using gtk_widget_class_set_template()
*
* It is important to call this function in the instance initializer
* of a #GtkWidget subclass and not in #GObject.constructed() or
* #GObject.constructor() for two reasons.
*
* One reason is that generally derived widgets will assume that parent
* class composite widgets have been created in their instance
* initializers.
*
* Another reason is that when calling g_object_new() on a widget with
* composite templates, it’s important to build the composite widgets
* before the construct properties are set. Properties passed to g_object_new()
* should take precedence over properties set in the private template XML.
*/
init_template(): void;
/**
* Sets an input shape for this widget’s GDK window. This allows for
* windows which react to mouse click in a nonrectangular region, see
* gdk_window_input_shape_combine_region() for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
input_shape_combine_region(region?: cairo.Region | null): void;
/**
* Inserts `group` into `widget`. Children of `widget` that implement
* #GtkActionable can then be associated with actions in `group` by
* setting their “action-name” to
* `prefix`.`action-name`.
*
* If `group` is %NULL, a previously inserted group for `name` is removed
* from `widget`.
* @param name the prefix for actions in @group
* @param group a #GActionGroup, or %NULL
*/
insert_action_group(name: string, group?: Gio.ActionGroup | null): void;
/**
* Computes the intersection of a `widget’`s area and `area,` storing
* the intersection in `intersection,` and returns %TRUE if there was
* an intersection. `intersection` may be %NULL if you’re only
* interested in whether there was an intersection.
* @param area a rectangle
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null];
/**
* Determines whether `widget` is somewhere inside `ancestor,` possibly with
* intermediate containers.
* @param ancestor another #GtkWidget
* @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc.
*/
is_ancestor(ancestor: Gtk.Widget): boolean;
/**
* Whether `widget` can rely on having its alpha channel
* drawn correctly. On X11 this function returns whether a
* compositing manager is running for `widget’`s screen.
*
* Please note that the semantics of this call will change
* in the future if used on a widget that has a composited
* window in its hierarchy (as set by gdk_window_set_composited()).
* @returns %TRUE if the widget can rely on its alpha channel being drawn correctly.
*/
is_composited(): boolean;
/**
* Determines whether `widget` can be drawn to. A widget can be drawn
* to if it is mapped and visible.
* @returns %TRUE if @widget is drawable, %FALSE otherwise
*/
is_drawable(): boolean;
/**
* Returns the widget’s effective sensitivity, which means
* it is sensitive itself and also its parent widget is sensitive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget.
*
* Currently only #GtkWindow and #GtkInvisible (and out-of-process
* #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent
* widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): boolean;
/**
* Determines whether the widget and all its parents are marked as
* visible.
*
* This function does not check if the widget is obscured in any way.
*
* See also gtk_widget_get_visible() and gtk_widget_set_visible()
* @returns %TRUE if the widget and all its parents are visible
*/
is_visible(): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
* @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
*/
keynav_failed(direction: Gtk.DirectionType | null): boolean;
/**
* Lists the closures used by `widget` for accelerator group connections
* with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
* The closures can be used to monitor accelerator changes on `widget,`
* by connecting to the `GtkAccelGroup:`:accel-changed signal of the
* #GtkAccelGroup of a closure which can be found out with
* gtk_accel_group_from_accel_closure().
* @returns a newly allocated #GList of closures
*/
list_accel_closures(): GObject.Closure[];
/**
* Retrieves a %NULL-terminated array of strings containing the prefixes of
* #GActionGroup's available to `widget`.
* @returns a %NULL-terminated array of strings.
*/
list_action_prefixes(): string[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is the target of a mnemonic (see for example,
* gtk_label_set_mnemonic_widget()).
*
* The widgets in the list are not individually referenced. If you
* want to iterate through the list and perform actions involving
* callbacks that might destroy the widgets, you
* must call `g_list_foreach (result,
* (GFunc)g_object_ref, NULL)` first, and then unref all the
* widgets afterwards.
* @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it.
*/
list_mnemonic_labels(): Gtk.Widget[];
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
map(): void;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
* @returns %TRUE if the signal has been handled
*/
mnemonic_activate(group_cycling: boolean): boolean;
/**
* Sets the base color for a widget in a particular state.
* All other style values are left untouched. The base color
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > base color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the base color on that.
* @param state the state for which to set the base color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
*/
modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* > Note that “no window” widgets (which have the %GTK_NO_WINDOW
* > flag set) draw on their parent container’s window and thus may
* > not draw any background themselves. This is the case for e.g.
* > #GtkLabel.
* >
* > To modify the background of such widgets, you have to set the
* > background color on their parent; if you want to set the background
* > of a rectangular area around a label, try placing the label in
* > a #GtkEventBox widget and setting the background color on that.
* @param state the state for which to set the background color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
*/
modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the #GtkWidget
* cursor-color and secondary-cursor-color
* style properties.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
* @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
*/
modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void;
/**
* Sets the foreground color for a widget in a particular state.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param state the state for which to set the foreground color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
*/
modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the font to use for a widget.
*
* All other style values are left untouched.
* See also gtk_widget_modify_style().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font()
*/
modify_font(font_desc?: Pango.FontDescription | null): void;
/**
* Modifies style values on the widget.
*
* Modifications made using this technique take precedence over
* style values set via an RC file, however, they will be overridden
* if a style is explicitly set on the widget using gtk_widget_set_style().
* The #GtkRcStyle-struct is designed so each field can either be
* set or unset, so it is possible, using this function, to modify some
* style values and leave the others unchanged.
*
* Note that modifications made with this function are not cumulative
* with previous calls to gtk_widget_modify_style() or with such
* functions as gtk_widget_modify_fg(). If you wish to retain
* previous values, you must first call gtk_widget_get_modifier_style(),
* make your modifications to the returned style, then call
* gtk_widget_modify_style() with that style. On the other hand,
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
* @param style the #GtkRcStyle-struct holding the style modifications
*/
modify_style(style: Gtk.RcStyle): void;
/**
* Sets the text color for a widget in a particular state.
*
* All other style values are left untouched.
* The text color is the foreground color used along with the
* base color (see gtk_widget_modify_base()) for widgets such
* as #GtkEntry and #GtkTextView.
* See also gtk_widget_modify_style().
* @param state the state for which to set the text color
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
*/
modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the background color to use for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color().
* @param state the state for which to set the background color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color()
*/
override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the color to use for a widget.
*
* All other style values are left untouched.
*
* This function does not act recursively. Setting the color of a
* container does not affect its children. Note that some widgets that
* you may not think of as containers, for instance #GtkButtons,
* are actually containers.
*
* This API is mostly meant as a quick way for applications to
* change a widget appearance. If you are developing a widgets
* library and intend this change to be themeable, it is better
* done by setting meaningful CSS classes in your
* widget/container implementation through gtk_style_context_add_class().
*
* This way, your widget library can install a #GtkCssProvider
* with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order
* to provide a default styling for those widgets that need so, and
* this theming may fully overridden by the user’s theme.
*
* Note that for complex widgets this may bring in undesired
* results (such as uniform background color everywhere), in
* these cases it is better to fully style such widgets through a
* #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority.
* @param state the state for which to set the color
* @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color()
*/
override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* cursor-color and secondary-cursor-color
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in `primary` and `secondary` will be ignored.
* @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
* @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor().
*/
override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void;
/**
* Sets the font to use for a widget. All other style values are
* left untouched. See gtk_widget_override_color().
* @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font()
*/
override_font(font_desc?: Pango.FontDescription | null): void;
/**
* Sets a symbolic color for a widget.
*
* All other style values are left untouched.
* See gtk_widget_override_color() for overriding the foreground
* or background color.
* @param name the name of the symbolic color to modify
* @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color()
*/
override_symbolic_color(name: string, color?: Gdk.RGBA | null): void;
/**
* Obtains the full path to `widget`. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
* periods. The name of a widget comes from
* gtk_widget_get_name(). Paths are used to apply styles to a widget
* in gtkrc configuration files. Widget names are the type of the
* widget by default (e.g. “GtkButton”) or can be set to an
* application-specific value with gtk_widget_set_name(). By setting
* the name of a widget, you allow users or theme authors to apply
* styles to that specific widget in their gtkrc
* file. `path_reversed_p` fills in the path in reverse order,
* i.e. starting with `widget’`s name instead of starting with the name
* of `widget’`s outermost ancestor.
*/
path(): [number, string, string];
/**
* This function is only for use in widget implementations.
*
* Flags the widget for a rerun of the GtkWidgetClass::size_allocate
* function. Use this function instead of gtk_widget_queue_resize()
* when the `widget'`s size request didn't change but it wants to
* reposition its contents.
*
* An example user of this function is gtk_widget_set_halign().
*/
queue_allocate(): void;
/**
* Mark `widget` as needing to recompute its expand flags. Call
* this function when setting legacy expand child properties
* on the child of a container.
*
* See gtk_widget_compute_expand().
*/
queue_compute_expand(): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Convenience function that calls gtk_widget_queue_draw_region() on
* the region created from the given coordinates.
*
* The region here is specified in widget coordinates.
* Widget coordinates are a bit odd; for historical reasons, they are
* defined as `widget->`window coordinates for widgets that return %TRUE for
* gtk_widget_get_has_window(), and are relative to `widget->`allocation.x,
* `widget->`allocation.y otherwise.
*
* `width` or `height` may be 0, in this case this function does
* nothing. Negative values for `width` and `height` are not allowed.
* @param x x coordinate of upper-left corner of rectangle to redraw
* @param y y coordinate of upper-left corner of rectangle to redraw
* @param width width of region to draw
* @param height height of region to draw
*/
queue_draw_area(x: number, y: number, width: number, height: number): void;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
queue_draw_region(region: cairo.Region): void;
/**
* This function is only for use in widget implementations.
* Flags a widget to have its size renegotiated; should
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there’s enough space for the new text.
*
* Note that you cannot call gtk_widget_queue_resize() on a widget
* from inside its implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.
*/
queue_resize(): void;
/**
* This function works like gtk_widget_queue_resize(),
* except that the widget is not invalidated.
*/
queue_resize_no_redraw(): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
realize(): void;
/**
* Computes the intersection of a `widget’`s area and `region,` returning
* the intersection. The result may be empty, use cairo_region_is_empty() to
* check.
* @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise.
* @returns A newly allocated region holding the intersection of @widget and @region.
*/
region_intersect(region: cairo.Region): cairo.Region;
/**
* Registers a #GdkWindow with the widget and sets it up so that
* the widget receives events for it. Call gtk_widget_unregister_window()
* when destroying the window.
*
* Before 3.8 you needed to call gdk_window_set_user_data() directly to set
* this up. This is now deprecated and you should use gtk_widget_register_window()
* instead. Old code will keep working as is, although some new features like
* transparency might not work perfectly.
* @param window a #GdkWindow
*/
register_window(window: Gdk.Window): void;
/**
* Removes an accelerator from `widget,` previously installed with
* gtk_widget_add_accelerator().
* @param accel_group accel group for this widget
* @param accel_key GDK keyval of the accelerator
* @param accel_mods modifier key combination of the accelerator
* @returns whether an accelerator was installed and could be removed
*/
remove_accelerator(
accel_group: Gtk.AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Removes a widget from the list of mnemonic labels for
* this widget. (See gtk_widget_list_mnemonic_labels()). The widget
* must have previously been added to the list with
* gtk_widget_add_mnemonic_label().
* @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Gtk.Widget): void;
/**
* Removes a tick callback previously registered with
* gtk_widget_add_tick_callback().
* @param id an id returned by gtk_widget_add_tick_callback()
*/
remove_tick_callback(id: number): void;
/**
* A convenience function that uses the theme settings for `widget`
* to look up `stock_id` and render it to a pixbuf. `stock_id` should
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size`
* should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a
* string that identifies the widget or code doing the rendering, so
* that theme engines can special-case rendering for that widget or
* code.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be
* freed after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @param detail render detail to pass to theme engine
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null;
/**
* A convenience function that uses the theme engine and style
* settings for `widget` to look up `stock_id` and render it to
* a pixbuf. `stock_id` should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size
* such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
* after use with g_object_unref().
* @param stock_id a stock ID
* @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
* @returns a new pixbuf, or %NULL if the stock ID wasn’t known
*/
render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null;
/**
* Moves a widget from one #GtkContainer to another, handling reference
* count issues to avoid destroying the widget.
* @param new_parent a #GtkContainer to move the widget into
*/
reparent(new_parent: Gtk.Widget): void;
/**
* Reset the styles of `widget` and all descendents, so when
* they are looked up again, they get the correct values
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
*/
reset_rc_styles(): void;
/**
* Updates the style context of `widget` and all descendants
* by updating its widget path. #GtkContainers may want
* to use this on a child when reordering it in a way that a different
* style might apply to it. See also gtk_container_get_path_for_child().
*/
reset_style(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event on a widget. This function is not normally used
* directly. The only time it is used is when propagating an expose
* event to a windowless child widget (gtk_widget_get_has_window() is %FALSE),
* and that is normally done using gtk_container_propagate_draw().
*
* If you want to force an area of a window to be redrawn,
* use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
* To cause the redraw to be done immediately, follow that call
* with a call to gdk_window_process_updates().
* @param event a expose #GdkEvent
* @returns return from the event signal emission (%TRUE if the event was handled)
*/
send_expose(event: Gdk.Event): number;
/**
* Sends the focus change `event` to `widget`
*
* This function is not meant to be used by applications. The only time it
* should be used is when it is necessary for a #GtkWidget to assign focus
* to a widget that is semantically owned by the first widget even though
* it’s not a direct child - for instance, a search entry in a floating
* window similar to the quick search in #GtkTreeView.
*
* An example of its usage is:
*
*
* ```c
* GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
*
* fevent->focus_change.type = GDK_FOCUS_CHANGE;
* fevent->focus_change.in = TRUE;
* fevent->focus_change.window = _gtk_widget_get_window (widget);
* if (fevent->focus_change.window != NULL)
* g_object_ref (fevent->focus_change.window);
*
* gtk_widget_send_focus_change (widget, fevent);
*
* gdk_event_free (event);
* ```
*
* @param event a #GdkEvent of type GDK_FOCUS_CHANGE
* @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise
*/
send_focus_change(event: Gdk.Event): boolean;
/**
* Given an accelerator group, `accel_group,` and an accelerator path,
* `accel_path,` sets up an accelerator in `accel_group` so whenever the
* key binding that is defined for `accel_path` is pressed, `widget`
* will be activated. This removes any accelerators (for any
* accelerator group) installed by previous calls to
* gtk_widget_set_accel_path(). Associating accelerators with
* paths allows them to be modified by the user and the modifications
* to be saved for future use. (See gtk_accel_map_save().)
*
* This function is a low level function that would most likely
* be used by a menu creation system like #GtkUIManager. If you
* use #GtkUIManager, setting up accelerator paths will be done
* automatically.
*
* Even when you you aren’t using #GtkUIManager, if you only want to
* set up accelerators on menu items gtk_menu_item_set_accel_path()
* provides a somewhat more convenient interface.
*
* 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 to look up the accelerator
* @param accel_group a #GtkAccelGroup.
*/
set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void;
/**
* Sets the widget’s allocation. This should not be used
* directly, but from within a widget’s size_allocate method.
*
* The allocation set should be the “adjusted” or actual
* allocation. If you’re implementing a #GtkContainer, you want to use
* gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
* The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
* allocation inside gtk_widget_size_allocate() to create an adjusted
* allocation.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Gtk.Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::draw handler.
*
* This is a hint to the widget and does not affect the behavior of
* the GTK+ core; many widgets ignore this flag entirely. For widgets
* that do pay attention to the flag, such as #GtkEventBox and #GtkWindow,
* the effect is to suppress default themed drawing of the widget's
* background. (Children of the widget will still be drawn.) The application
* is then entirely responsible for drawing the widget background.
*
* Note that the background is still drawn when the widget is mapped.
* @param app_paintable %TRUE if the application will paint on the widget
*/
set_app_paintable(app_paintable: boolean): void;
/**
* Specifies whether `widget` can be a default widget. See
* gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param can_default whether or not @widget can be a default widget.
*/
set_can_default(can_default: boolean): void;
/**
* Specifies whether `widget` can own the input focus. See
* gtk_widget_grab_focus() for actually setting the input focus on a
* widget.
* @param can_focus whether or not @widget can own the input focus.
*/
set_can_focus(can_focus: boolean): void;
/**
* Sets whether `widget` should be mapped along with its when its parent
* is mapped and `widget` has been shown with gtk_widget_show().
*
* The child visibility can be set for widget before it is added to
* a container with gtk_widget_set_parent(), to avoid mapping
* children unnecessary before immediately unmapping them. However
* it will be reset to its default state of %TRUE when the widget
* is removed from a container.
*
* Note that changing the child visibility of a widget does not
* queue a resize on the widget. Most of the time, the size of
* a widget is computed from all visible children, whether or
* not they are mapped. If this is not the case, the container
* can queue a resize itself.
*
* This function is only useful for container implementations and
* never should be called by an application.
* @param is_visible if %TRUE, @widget should be mapped along with its parent.
*/
set_child_visible(is_visible: boolean): void;
/**
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
* It must be called after gtk_widget_set_allocation() (or after chaining up
* to the parent class), because that function resets the clip.
*
* The clip set should be the area that `widget` draws on. If `widget` is a
* #GtkContainer, the area must contain all children's clips.
*
* If this function is not called by `widget` during a ::size-allocate handler,
* the clip will be set to `widget'`s allocation.
* @param clip a pointer to a #GtkAllocation to copy from
*/
set_clip(clip: Gtk.Allocation): void;
/**
* Sets a widgets composite name. The widget must be
* a composite child of its parent; see gtk_widget_push_composite_child().
* @param name the name to set
*/
set_composite_name(name: string): void;
/**
* Enables or disables a #GdkDevice to interact with `widget`
* and all its children.
*
* It does so by descending through the #GdkWindow hierarchy
* and enabling the same mask that is has for core events
* (i.e. the one that gdk_window_get_events() returns).
* @param device a #GdkDevice
* @param enabled whether to enable the device
*/
set_device_enabled(device: Gdk.Device, enabled: boolean): void;
/**
* Sets the device event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive from `device`. Keep
* in mind that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_device_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with windowless widgets (which return
* %FALSE from gtk_widget_get_has_window());
* to get events on those widgets, place them inside a #GtkEventBox
* and receive events on the event box.
* @param device a #GdkDevice
* @param events event mask
*/
set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void;
/**
* Sets the reading direction on a particular widget. This direction
* controls the primary direction for widgets containing text,
* and also the direction in which the children of a container are
* packed. The ability to set the direction is present in order
* so that correct localization into languages with right-to-left
* reading directions can be done. Generally, applications will
* let the default reading direction present, except for containers
* where the containers are arranged in an order that is explicitly
* visual rather than logical (such as buttons for text justification).
*
* If the direction is set to %GTK_TEXT_DIR_NONE, then the value
* set by gtk_widget_set_default_direction() will be used.
* @param dir the new direction
*/
set_direction(dir: Gtk.TextDirection | null): void;
/**
* Widgets are double buffered by default; you can use this function
* to turn off the buffering. “Double buffered” simply means that
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_draw_frame() draws the
* buffer to the screen. The result is that users see the window
* update in one smooth step, and don’t see individual graphics
* primitives being rendered.
*
* In very simple terms, double buffered widgets don’t flicker,
* so you would only use this function to turn off double buffering
* if you had special needs and really knew what you were doing.
*
* Note: if you turn off double-buffering, you have to handle
* expose events, since even the clearing to the background color or
* pixmap will not happen automatically (as it is done in
* gdk_window_begin_draw_frame()).
*
* In 3.10 GTK and GDK have been restructured for translucent drawing. Since
* then expose events for double-buffered widgets are culled into a single
* event to the toplevel GDK window. If you now unset double buffering, you
* will cause a separate rendering pass for every widget. This will likely
* cause rendering problems - in particular related to stacking - and usually
* increases rendering times significantly.
* @param double_buffered %TRUE to double-buffer a widget
*/
set_double_buffered(double_buffered: boolean): void;
/**
* Sets the event mask (see #GdkEventMask) for a widget. The event
* mask determines which events a widget will receive. Keep in mind
* that different widgets have different default event masks, and by
* changing the event mask you may disrupt a widget’s functionality,
* so be careful. This function must be called while a widget is
* unrealized. Consider gtk_widget_add_events() for widgets that are
* already realized, or if you want to preserve the existing event
* mask. This function can’t be used with widgets that have no window.
* (See gtk_widget_get_has_window()). To get events on those widgets,
* place them inside a #GtkEventBox and receive events on the event
* box.
* @param events event mask
*/
set_events(events: number): void;
/**
* Sets whether the widget should grab focus when it is clicked with the mouse.
* Making mouse clicks not grab focus is useful in places like toolbars where
* you don’t want the keyboard focus removed from the main area of the
* application.
* @param focus_on_click whether the widget should grab focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the font map to use for Pango rendering. When not set, the widget
* will inherit the font map from its parent.
* @param font_map a #PangoFontMap, or %NULL to unset any previously set font map
*/
set_font_map(font_map?: Pango.FontMap | null): void;
/**
* Sets the #cairo_font_options_t used for Pango rendering in this widget.
* When not set, the default font options for the #GdkScreen will be used.
* @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options.
*/
set_font_options(options?: cairo.FontOptions | null): void;
/**
* Sets the horizontal alignment of `widget`.
* See the #GtkWidget:halign property.
* @param align the horizontal alignment
*/
set_halign(align: Gtk.Align | null): void;
/**
* Sets the has-tooltip property on `widget` to `has_tooltip`. See
* #GtkWidget:has-tooltip for more information.
* @param has_tooltip whether or not @widget has a tooltip.
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Specifies whether `widget` has a #GdkWindow of its own. Note that
* all realized widgets have a non-%NULL “window” pointer
* (gtk_widget_get_window() never returns a %NULL window when a widget
* is realized), but for many of them it’s actually the #GdkWindow of
* one of its parent widgets. Widgets that do not create a %window for
* themselves in #GtkWidget::realize must announce this by
* calling this function with `has_window` = %FALSE.
*
* This function should only be called by widget implementations,
* and they should call it in their init() function.
* @param has_window whether or not @widget has a window.
*/
set_has_window(has_window: boolean): void;
/**
* Sets whether the widget would like any available extra horizontal
* space. When a user resizes a #GtkWindow, widgets with expand=TRUE
* generally receive the extra space. For example, a list or
* scrollable area or document in your window would often be set to
* expand.
*
* Call this function to set the expand flag if you would like your
* widget to become larger horizontally when the window has extra
* room.
*
* By default, widgets automatically expand if any of their children
* want to expand. (To see if a widget will automatically expand given
* its current children and state, call gtk_widget_compute_expand(). A
* container can decide how the expandability of children affects the
* expansion of the container by overriding the compute_expand virtual
* method on #GtkWidget.).
*
* Setting hexpand explicitly with this function will override the
* automatic expand behavior.
*
* This function forces the widget to expand or not to expand,
* regardless of children. The override occurs because
* gtk_widget_set_hexpand() sets the hexpand-set property (see
* gtk_widget_set_hexpand_set()) which causes the widget’s hexpand
* value to be used, rather than looking at children and widget state.
* @param expand whether to expand
*/
set_hexpand(expand: boolean): void;
/**
* Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will
* be used.
*
* The hexpand-set property will be set automatically when you call
* gtk_widget_set_hexpand() to set hexpand, so the most likely
* reason to use this function would be to unset an explicit expand
* flag.
*
* If hexpand is set, then it overrides any computed
* expand value based on child widgets. If hexpand is not
* set, then the expand value depends on whether any
* children of the widget would like to expand.
*
* There are few reasons to use this function, but it’s here
* for completeness and consistency.
* @param set value for hexpand-set property
*/
set_hexpand_set(set: boolean): void;
/**
* Marks the widget as being mapped.
*
* This function should only ever be called in a derived widget's
* “map” or “unmap” implementation.
* @param mapped %TRUE to mark the widget as mapped
*/
set_mapped(mapped: boolean): void;
/**
* Sets the bottom margin of `widget`.
* See the #GtkWidget:margin-bottom property.
* @param margin the bottom margin
*/
set_margin_bottom(margin: number): void;
/**
* Sets the end margin of `widget`.
* See the #GtkWidget:margin-end property.
* @param margin the end margin
*/
set_margin_end(margin: number): void;
/**
* Sets the left margin of `widget`.
* See the #GtkWidget:margin-left property.
* @param margin the left margin
*/
set_margin_left(margin: number): void;
/**
* Sets the right margin of `widget`.
* See the #GtkWidget:margin-right property.
* @param margin the right margin
*/
set_margin_right(margin: number): void;
/**
* Sets the start margin of `widget`.
* See the #GtkWidget:margin-start property.
* @param margin the start margin
*/
set_margin_start(margin: number): void;
/**
* Sets the top margin of `widget`.
* See the #GtkWidget:margin-top property.
* @param margin the top margin
*/
set_margin_top(margin: number): void;
/**
* Widgets can be named, which allows you to refer to them from a
* CSS file. You can apply a style to widgets with a particular name
* in the CSS file. See the documentation for the CSS syntax (on the
* same page as the docs for #GtkStyleContext).
*
* Note that the CSS syntax has certain special characters to delimit
* and represent elements in a selector (period, #, >, *...), so using
* these will make your widget impossible to match by name. Any combination
* of alphanumeric symbols, dashes and underscores will suffice.
* @param name name for the widget
*/
set_name(name: string): void;
/**
* Sets the #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() will affect this widget.
*
* This is mostly for use in constructing widget hierarchies with externally
* controlled visibility, see #GtkUIManager.
* @param no_show_all the new value for the “no-show-all” property
*/
set_no_show_all(no_show_all: boolean): void;
/**
* Request the `widget` to be rendered partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
* are clamped to the [0,1] range.).
* This works on both toplevel widget, and child widgets, although there
* are some limitations:
*
* For toplevel widgets this depends on the capabilities of the windowing
* system. On X11 this has any effect only on X screens with a compositing manager
* running. See gtk_widget_is_composited(). On Windows it should work
* always, although setting a window’s opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesn’t work if any affected widget has a native window, or
* disables double buffering.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
/**
* This function is useful only when implementing subclasses of
* #GtkContainer.
* Sets the container as the parent of `widget,` and takes care of
* some details such as updating the state and style of the child
* to reflect its new location. The opposite function is
* gtk_widget_unparent().
* @param parent parent container
*/
set_parent(parent: Gtk.Widget): void;
/**
* Sets a non default parent window for `widget`.
*
* For #GtkWindow classes, setting a `parent_window` effects whether
* the window is a toplevel window or can be embedded into other
* widgets.
*
* For #GtkWindow classes, this needs to be called before the
* window is realized.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized. This function must only be
* called after all #GdkWindows for the `widget` have been created
* and registered.
*
* This function should only ever be called in a derived widget's
* “realize” or “unrealize” implementation.
* @param realized %TRUE to mark the widget as realized
*/
set_realized(realized: boolean): void;
/**
* Specifies whether `widget` will be treated as the default widget
* within its toplevel when it has the focus, even if another widget
* is the default.
*
* See gtk_widget_grab_default() for details about the meaning of
* “default”.
* @param receives_default whether or not @widget can be a default widget.
*/
set_receives_default(receives_default: boolean): void;
/**
* Sets whether the entire widget is queued for drawing when its size
* allocation changes. By default, this setting is %TRUE and
* the entire widget is redrawn on every size change. If your widget
* leaves the upper left unchanged when made bigger, turning this
* setting off will improve performance.
*
* Note that for widgets where gtk_widget_get_has_window() is %FALSE
* setting this flag to %FALSE turns off all allocation on resizing:
* the widget will not even redraw if its position changes; this is to
* allow containers that don’t draw anything to avoid excess
* invalidations. If you set this flag on a widget with no window that
* does draw on `widget->`window, you are
* responsible for invalidating both the old and new allocation of the
* widget when the widget is moved and responsible for invalidating
* regions newly when the widget increases size.
* @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
*/
set_redraw_on_allocate(redraw_on_allocate: boolean): void;
/**
* Sets the sensitivity of a widget. A widget is sensitive if the user
* can interact with it. Insensitive widgets are “grayed out” and the
* user can’t interact with them. Insensitive widgets are known as
* “inactive”, “disabled”, or “ghosted” in some other toolkits.
* @param sensitive %TRUE to make the widget sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the minimum size of a widget; that is, the widget’s size
* request will be at least `width` by `height`. You can use this
* function to force a widget to be larger than it normally would be.
*
* In most cases, gtk_window_set_default_size() is a better choice for
* toplevel windows than this function; setting the default size will
* still allow users to shrink the window. Setting the size request
* will force them to leave the window at least as large as the size
* request. When dealing with window sizes,
* gtk_window_set_geometry_hints() can be a useful function as well.
*
* Note the inherent danger of setting any fixed size - themes,
* translations into other languages, different fonts, and user action
* can all change the appropriate size for a given widget. So, it's
* basically impossible to hardcode a size that will always be
* correct.
*
* The size request of a widget is the smallest size a widget can
* accept while still functioning well and drawing itself correctly.
* However in some strange cases a widget may be allocated less than
* its requested size, and in many cases a widget may be allocated more
* space than it requested.
*
* If the size request in a given direction is -1 (unset), then
* the “natural” size request of the widget will be used instead.
*
* The size request set here does not include any margin from the
* #GtkWidget properties margin-left, margin-right, margin-top, and
* margin-bottom, but it does include pretty much all other padding
* or border properties set by any subclass of #GtkWidget.
* @param width width @widget should request, or -1 to unset
* @param height height @widget should request, or -1 to unset
*/
set_size_request(width: number, height: number): void;
/**
* This function is for use in widget implementations. Sets the state
* of a widget (insensitive, prelighted, etc.) Usually you should set
* the state using wrapper functions such as gtk_widget_set_sensitive().
* @param state new state for @widget
*/
set_state(state: Gtk.StateType | null): void;
/**
* This function is for use in widget implementations. Turns on flag
* values in the current widget state (insensitive, prelighted, etc.).
*
* This function accepts the values %GTK_STATE_FLAG_DIR_LTR and
* %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's
* direction, use gtk_widget_set_direction().
*
* It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
* will be propagated down to all non-internal children if `widget` is a
* #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
* down to all #GtkContainer children by different means than turning on the
* state flag down the hierarchy, both gtk_widget_get_state_flags() and
* gtk_widget_is_sensitive() will make use of these.
* @param flags State flags to turn on
* @param clear Whether to clear state before turning on @flags
*/
set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void;
/**
* Used to set the #GtkStyle for a widget (`widget->`style). Since
* GTK 3, this function does nothing, the passed in style is ignored.
* @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Gtk.Style | null): void;
/**
* Enables or disables multiple pointer awareness. If this setting is %TRUE,
* `widget` will start receiving multiple, per device enter/leave events. Note
* that if custom #GdkWindows are created in #GtkWidget::realize,
* gdk_window_set_support_multidevice() will have to be called manually on them.
* @param support_multidevice %TRUE to support input from multiple devices.
*/
set_support_multidevice(support_multidevice: boolean): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the [Pango text markup language][PangoMarkupFormat].
*
* This function will take care of setting #GtkWidget:has-tooltip to %TRUE
* and of the default handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @widget, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip. This function will take
* care of setting #GtkWidget:has-tooltip to %TRUE and of the default
* handler for the #GtkWidget::query-tooltip signal.
*
* See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text().
* @param text the contents of the tooltip for @widget
*/
set_tooltip_text(text?: string | null): void;
/**
* Replaces the default window used for displaying
* tooltips with `custom_window`. GTK+ will take care of showing and
* hiding `custom_window` at the right moment, to behave likewise as
* the default tooltip window. If `custom_window` is %NULL, the default
* tooltip window will be used.
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Gtk.Window | null): void;
/**
* Sets the vertical alignment of `widget`.
* See the #GtkWidget:valign property.
* @param align the vertical alignment
*/
set_valign(align: Gtk.Align | null): void;
/**
* Sets whether the widget would like any available extra vertical
* space.
*
* See gtk_widget_set_hexpand() for more detail.
* @param expand whether to expand
*/
set_vexpand(expand: boolean): void;
/**
* Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will
* be used.
*
* See gtk_widget_set_hexpand_set() for more detail.
* @param set value for vexpand-set property
*/
set_vexpand_set(set: boolean): void;
/**
* Sets the visibility state of `widget`. Note that setting this to
* %TRUE doesn’t mean the widget is actually viewable, see
* gtk_widget_get_visible().
*
* This function simply calls gtk_widget_show() or gtk_widget_hide()
* but is nicer to use when the visibility of the widget depends on
* some condition.
* @param visible whether the widget should be shown or not
*/
set_visible(visible: boolean): void;
/**
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new `visual` will not cause `widget` to recreate its windows,
* so you should call this function before `widget` is realized.
* @param visual visual to be used or %NULL to unset a previous one
*/
set_visual(visual?: Gdk.Visual | null): void;
/**
* Sets a widget’s window. This function should only be used in a
* widget’s #GtkWidget::realize implementation. The %window passed is
* usually either new window created with gdk_window_new(), or the
* window of its parent widget as returned by
* gtk_widget_get_parent_window().
*
* Widgets must indicate whether they will create their own #GdkWindow
* by calling gtk_widget_set_has_window(). This is usually done in the
* widget’s init() function.
*
* Note that this function does not add any reference to `window`.
* @param window a #GdkWindow
*/
set_window(window: Gdk.Window): void;
/**
* Sets a shape for this widget’s GDK window. This allows for
* transparent windows etc., see gdk_window_shape_combine_region()
* for more information.
* @param region shape to be added, or %NULL to remove an existing shape
*/
shape_combine_region(region?: cairo.Region | null): void;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
show_all(): void;
/**
* Shows a widget. If the widget is an unmapped toplevel widget
* (i.e. a #GtkWindow that has not yet been shown), enter the main
* loop and wait for the window to actually be mapped. Be careful;
* because the main loop is running, anything can happen during
* this function.
*/
show_now(): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Gtk.Allocation): void;
/**
* This function is only used by #GtkContainer subclasses, to assign a size,
* position and (optionally) baseline to their child widgets.
*
* In this function, the allocation and baseline may be adjusted. It
* will be forced to a 1x1 minimum size, and the
* adjust_size_allocation virtual and adjust_baseline_allocation
* methods on the child will be used to adjust the allocation and
* baseline. Standard adjustments include removing the widget's
* margins, and applying the widget’s #GtkWidget:halign and
* #GtkWidget:valign properties.
*
* If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
* baseline argument is ignored and -1 is used instead.
* @param allocation position and size to be allocated to @widget
* @param baseline The baseline of the child, or -1
*/
size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void;
/**
* This function is typically used when implementing a #GtkContainer
* subclass. Obtains the preferred size of a widget. The container
* uses this information to arrange its child widgets and decide what
* size allocations to give them with gtk_widget_size_allocate().
*
* You can also call this function from an application, with some
* caveats. Most notably, getting a size request requires the widget
* to be associated with a screen, because font information may be
* needed. Multihead-aware applications should keep this in mind.
*
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*/
size_request(): Gtk.Requisition;
/**
* This function attaches the widget’s #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
*
* ```
* widget->style = gtk_style_attach (widget->style, widget->window);
* ```
*
*
* and should only ever be called in a derived widget’s “realize”
* implementation which does not chain up to its parent class'
* “realize” implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*/
style_attach(): void;
/**
* Gets the value of a style property of `widget`.
* @param property_name the name of a style property
* @param value location to return the property value
*/
style_get_property(property_name: string, value: GObject.Value | any): void;
/**
* Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
* This causes all queued #GtkWidget::child-notify signals on `widget` to be
* emitted.
*/
thaw_child_notify(): void;
/**
* Translate coordinates relative to `src_widget’`s allocation to coordinates
* relative to `dest_widget’`s allocations. In order to perform this
* operation, both widgets must be realized, and must share a common
* toplevel.
* @param dest_widget a #GtkWidget
* @param src_x X position relative to @src_widget
* @param src_y Y position relative to @src_widget
* @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE.
*/
translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number];
/**
* Triggers a tooltip query on the display where the toplevel of `widget`
* is located. See gtk_tooltip_trigger_tooltip_query() for more
* information.
*/
trigger_tooltip_query(): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
unmap(): void;
/**
* This function is only for use in widget implementations.
* Should be called by implementations of the remove method
* on #GtkContainer, to dissociate a child from the container.
*/
unparent(): void;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
unrealize(): void;
/**
* Unregisters a #GdkWindow from the widget that was previously set up with
* gtk_widget_register_window(). You need to call this when the window is
* no longer used by the widget, such as when you destroy it.
* @param window a #GdkWindow
*/
unregister_window(window: Gdk.Window): void;
/**
* This function is for use in widget implementations. Turns off flag
* values for the current widget state (insensitive, prelighted, etc.).
* See gtk_widget_set_state_flags().
* @param flags State flags to turn off
*/
unset_state_flags(flags: Gtk.StateFlags | null): void;
vfunc_adjust_baseline_allocation(baseline: number): void;
vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void;
/**
* Convert an initial size allocation assigned
* by a #GtkContainer using gtk_widget_size_allocate(), into an actual
* size allocation to be used by the widget. adjust_size_allocation
* adjusts to a child widget’s actual allocation
* from what a parent container computed for the
* child. The adjusted allocation must be entirely within the original
* allocation. In any custom implementation, chain up to the default
* #GtkWidget implementation of this method, which applies the margin
* and alignment properties of #GtkWidget. Chain up
* before performing your own adjustments so your
* own adjustments remove more allocation after the #GtkWidget base
* class has already removed margin and alignment. The natural size
* passed in should be adjusted in the same way as the allocated size,
* which allows adjustments to perform alignments or other changes
* based on natural size.
* @param orientation
* @param minimum_size
* @param natural_size
* @param allocated_pos
* @param allocated_size
*/
vfunc_adjust_size_allocation(
orientation: Gtk.Orientation,
minimum_size: number,
natural_size: number,
allocated_pos: number,
allocated_size: number,
): void;
/**
* Convert an initial size request from a widget's
* #GtkSizeRequestMode virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
* adjust_size_request adjusts from a child widget's
* original request to what a parent container should
* use for layout. The `for_size` argument will be -1 if the request should
* not be for a particular size in the opposing orientation, i.e. if the
* request is not height-for-width or width-for-height. If `for_size` is
* greater than -1, it is the proposed allocation in the opposing
* orientation that we need the request for. Implementations of
* adjust_size_request should chain up to the default implementation,
* which applies #GtkWidget’s margin properties and imposes any values
* from gtk_widget_set_size_request(). Chaining up should be last,
* after your subclass adjusts the request, so
* #GtkWidget can apply constraints and add the margin properly.
* @param orientation
* @param minimum_size
* @param natural_size
*/
vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void;
/**
* Signal will be emitted when a button
* (typically from a mouse) is pressed.
* @param event
*/
vfunc_button_press_event(event: Gdk.EventButton): boolean;
/**
* Signal will be emitted when a button
* (typically from a mouse) is released.
* @param event
*/
vfunc_button_release_event(event: Gdk.EventButton): boolean;
/**
* Determines whether an accelerator that activates the signal
* identified by `signal_id` can currently be activated.
* This is done by emitting the #GtkWidget::can-activate-accel
* signal on `widget;` if the signal isn’t overridden by a
* handler or in a derived widget, then the default check is
* that the widget must be sensitive, and the widget and all
* its ancestors mapped.
* @param signal_id the ID of a signal installed on @widget
*/
vfunc_can_activate_accel(signal_id: number): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* [child property][child-properties] `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
*
* Also see gtk_container_child_notify().
* @param child_property the name of a child property installed on the class of @widget’s parent
*/
vfunc_child_notify(child_property: GObject.ParamSpec): void;
/**
* Signal emitted when the composited status of
* widgets screen changes. See gdk_screen_is_composited().
*/
vfunc_composited_changed(): void;
/**
* Computes whether a container should give this
* widget extra space when possible.
* @param hexpand_p
* @param vexpand_p
*/
vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void;
/**
* Signal will be emitted when the size, position or
* stacking of the widget’s window has changed.
* @param event
*/
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
/**
* Signal emitted when a redirected window belonging to
* widget gets drawn into.
* @param event
*/
vfunc_damage_event(event: Gdk.EventExpose): boolean;
/**
* Signal emitted if a user requests that a toplevel
* window is closed.
* @param event
*/
vfunc_delete_event(event: Gdk.EventAny): boolean;
/**
* Destroys a widget.
*
* When a widget is destroyed all references it holds on other objects
* will be released:
*
* - if the widget is inside a container, it will be removed from its
* parent
* - if the widget is a container, all its children will be destroyed,
* recursively
* - if the widget is a top level, it will be removed from the list
* of top level widgets that GTK+ maintains internally
*
* It's expected that all references held on the widget will also
* be released; you should connect to the #GtkWidget::destroy signal
* if you hold a reference to `widget` and you wish to remove it when
* this function is called. It is not necessary to do so if you are
* implementing a #GtkContainer, as you'll be able to use the
* #GtkContainerClass.remove() virtual function for that.
*
* It's important to notice that gtk_widget_destroy() will only cause
* the `widget` to be finalized if no additional references, acquired
* using g_object_ref(), are held on it. In case additional references
* are in place, the `widget` will be in an "inert" state after calling
* this function; `widget` will still point to valid memory, allowing you
* to release the references you hold, but you may not query the widget's
* own state.
*
* You should typically call this function on top level widgets, and
* rarely on child widgets.
*
* See also: gtk_container_remove()
*/
vfunc_destroy(): void;
/**
* Signal is emitted when a #GdkWindow is destroyed.
* @param event
*/
vfunc_destroy_event(event: Gdk.EventAny): boolean;
/**
* Signal emitted when the text direction of a
* widget changes.
* @param previous_direction
*/
vfunc_direction_changed(previous_direction: Gtk.TextDirection): void;
/**
* Seldomly overidden.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* Signal emitted on the drag source when a drag is
* started.
* @param context
*/
vfunc_drag_begin(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag
* with the action %GDK_ACTION_MOVE is successfully completed.
* @param context
*/
vfunc_drag_data_delete(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when the drop
* site requests the data which is dragged.
* @param context
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the
* dragged data has been received.
* @param context
* @param x
* @param y
* @param selection_data
* @param info
* @param time_
*/
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: Gtk.SelectionData,
info: number,
time_: number,
): void;
/**
* Signal emitted on the drop site when the user drops the
* data onto the widget.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted on the drag source when a drag is
* finished.
* @param context
*/
vfunc_drag_end(context: Gdk.DragContext): void;
/**
* Signal emitted on the drag source when a drag has
* failed.
* @param context
* @param result
*/
vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean;
/**
* Signal emitted on the drop site when the cursor leaves
* the widget.
* @param context
* @param time_
*/
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
/**
* signal emitted on the drop site when the user moves
* the cursor over the widget during a drag.
* @param context
* @param x
* @param y
* @param time_
*/
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
/**
* Signal emitted when a widget is supposed to render itself.
* @param cr
*/
vfunc_draw(cr: cairo.Context): boolean;
/**
* Signal event will be emitted when the pointer
* enters the widget’s window.
* @param event
*/
vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean;
/**
* Rarely-used function. This function is used to emit
* the event signals on a widget (those signals should never
* be emitted without using this function to do so).
* If you want to synthesize an event though, don’t use this function;
* instead, use gtk_main_do_event() so the event will behave as if
* it were in the event queue. Don’t synthesize expose events; instead,
* use gdk_window_invalidate_rect() to invalidate a region of the
* window.
* @param event a #GdkEvent
*/
vfunc_event(event: Gdk.Event): boolean;
vfunc_focus(direction: Gtk.DirectionType): boolean;
/**
* Signal emitted when the keyboard focus enters the
* widget’s window.
* @param event
*/
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
/**
* Signal emitted when the keyboard focus leaves the
* widget’s window.
* @param event
*/
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If accessibility support is not available, this #AtkObject
* instance may be a no-op. Likewise, if no class-specific #AtkObject
* implementation is available for the widget instance in question,
* it will inherit an #AtkObject implementation from the first ancestor
* class for which such an implementation is defined.
*
* The documentation of the
* [ATK](http://developer.gnome.org/atk/stable/)
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
/**
* Retrieves a widget’s initial minimum and natural height.
*
* This call is specific to width-for-height requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_height(): [number, number];
/**
* Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
* the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means
* that no baseline is requested for this widget.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
* and by any #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation, or -1 if none
*/
vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number];
/**
* Retrieves a widget’s minimum and natural height if it would be given
* the specified `width`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param width the width which is available for allocation
*/
vfunc_get_preferred_height_for_width(width: number): [number, number];
/**
* Retrieves a widget’s initial minimum and natural width.
*
* This call is specific to height-for-width requests.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
*/
vfunc_get_preferred_width(): [number, number];
/**
* Retrieves a widget’s minimum and natural width if it would be given
* the specified `height`.
*
* The returned request will be modified by the
* GtkWidgetClass::adjust_size_request virtual method and by any
* #GtkSizeGroups that have been applied. That is, the returned request
* is the one that should be used for layout, not necessarily the one
* returned by the widget itself.
* @param height the height which is available for allocation
*/
vfunc_get_preferred_width_for_height(height: number): [number, number];
/**
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* #GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.
*/
vfunc_get_request_mode(): Gtk.SizeRequestMode;
/**
* Signal emitted when a pointer or keyboard grab
* on a window belonging to widget gets broken.
* @param event
*/
vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean;
/**
* Causes `widget` to have the keyboard focus for the #GtkWindow it's
* inside. `widget` must be a focusable widget, such as a #GtkEntry;
* something like #GtkFrame won’t work.
*
* More precisely, it must have the %GTK_CAN_FOCUS flag set. Use
* gtk_widget_set_can_focus() to modify that flag.
*
* The widget also needs to be realized and mapped. This is indicated by the
* related signals. Grabbing the focus immediately after creating the widget
* will likely fail and cause critical warnings.
*/
vfunc_grab_focus(): void;
/**
* Signal emitted when a widget becomes shadowed by a
* GTK+ grab (not a pointer or keyboard grab) on another widget, or
* when it becomes unshadowed due to a grab being removed.
* @param was_grabbed
*/
vfunc_grab_notify(was_grabbed: boolean): void;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
vfunc_hide(): void;
/**
* Signal emitted when the anchored state of a
* widget changes.
* @param previous_toplevel
*/
vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void;
/**
* Signal emitted when a key is pressed.
* @param event
*/
vfunc_key_press_event(event: Gdk.EventKey): boolean;
/**
* Signal is emitted when a key is released.
* @param event
*/
vfunc_key_release_event(event: Gdk.EventKey): boolean;
/**
* This function should be called whenever keyboard navigation within
* a single widget hits a boundary. The function emits the
* #GtkWidget::keynav-failed signal on the widget and its return
* value should be interpreted in a way similar to the return value of
* gtk_widget_child_focus():
*
* When %TRUE is returned, stay in the widget, the failed keyboard
* navigation is OK and/or there is nowhere we can/should move the
* focus to.
*
* When %FALSE is returned, the caller should continue with keyboard
* navigation outside the widget, e.g. by calling
* gtk_widget_child_focus() on the widget’s toplevel.
*
* The default ::keynav-failed handler returns %FALSE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType it returns %TRUE.
*
* Whenever the default handler returns %TRUE, it also calls
* gtk_widget_error_bell() to notify the user of the failed keyboard
* navigation.
*
* A use case for providing an own implementation of ::keynav-failed
* (either by connecting to it or by overriding it) would be a row of
* #GtkEntry widgets where the user should be able to navigate the
* entire row with the cursor keys, as e.g. known from user interfaces
* that require entering license keys.
* @param direction direction of focus movement
*/
vfunc_keynav_failed(direction: Gtk.DirectionType): boolean;
/**
* Will be emitted when the pointer leaves the
* widget’s window.
* @param event
*/
vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be mapped if it isn’t already.
*/
vfunc_map(): void;
/**
* Signal emitted when the widget’s window is mapped.
* @param event
*/
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
/**
* Signal emitted when the pointer moves over
* the widget’s #GdkWindow.
* @param event
*/
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
/**
* Signal emitted when a change of focus is requested
* @param direction
*/
vfunc_move_focus(direction: Gtk.DirectionType): void;
/**
* Signal emitted when a new parent has been set on a
* widget.
* @param previous_parent
*/
vfunc_parent_set(previous_parent: Gtk.Widget): void;
/**
* Signal emitted whenever a widget should pop up a
* context menu.
*/
vfunc_popup_menu(): boolean;
/**
* Signal will be emitted when a property on
* the widget’s window has been changed or deleted.
* @param event
*/
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
/**
* Signal emitted when “has-tooltip” is %TRUE and the
* hover timeout has expired with the cursor hovering “above”
* widget; or emitted when widget got focus in keyboard mode.
* @param x
* @param y
* @param keyboard_tooltip
* @param tooltip
*/
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
/**
* Invalidates the area of `widget` defined by `region` by calling
* gdk_window_invalidate_region() on the widget’s window and all its
* child windows. Once the main loop becomes idle (after the current
* batch of events has been processed, roughly), the window will
* receive expose events for the union of all regions that have been
* invalidated.
*
* Normally you would only use this function in widget
* implementations. You might also use it to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
* @param region region to draw
*/
vfunc_queue_draw_region(region: cairo.Region): void;
/**
* Creates the GDK (windowing system) resources associated with a
* widget. For example, `widget->`window will be created when a widget
* is realized. Normally realization happens implicitly; if you show
* a widget and all its parent containers, then the widget will be
* realized and mapped automatically.
*
* Realizing a widget requires all
* the widget’s parent widgets to be realized; calling
* gtk_widget_realize() realizes the widget’s parents in addition to
* `widget` itself. If a widget is not yet inside a toplevel window
* when you realize it, bad things will happen.
*
* This function is primarily used in widget implementations, and
* isn’t very useful otherwise. Many times when you think you might
* need it, a better approach is to connect to a signal that will be
* called after the widget is realized automatically, such as
* #GtkWidget::draw. Or simply g_signal_connect () to the
* #GtkWidget::realize signal.
*/
vfunc_realize(): void;
/**
* Signal emitted when the screen of a widget has
* changed.
* @param previous_screen
*/
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
/**
* Signal emitted when a button in the 4 to 7 range is
* pressed.
* @param event
*/
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
/**
* Signal will be emitted when the the
* widget’s window has lost ownership of a selection.
* @param event
*/
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void;
/**
* Signal will be emitted when another
* client requests ownership of the selection owned by the widget's
* window.
* @param event
*/
vfunc_selection_request_event(event: Gdk.EventSelection): boolean;
/**
* Flags a widget to be displayed. Any widget that isn’t shown will
* not appear on the screen. If you want to show all the widgets in a
* container, it’s easier to call gtk_widget_show_all() on the
* container, instead of individually showing the widgets.
*
* Remember that you have to show the containers containing a widget,
* in addition to the widget itself, before it will appear onscreen.
*
* When a toplevel container is shown, it is immediately realized and
* mapped; other shown widgets are realized and mapped when their
* toplevel container is realized and mapped.
*/
vfunc_show(): void;
/**
* Recursively shows a widget, and any child widgets (if the widget is
* a container).
*/
vfunc_show_all(): void;
vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
*
* In this function, the allocation may be adjusted. It will be forced
* to a 1x1 minimum size, and the adjust_size_allocation virtual
* method on the child will be used to adjust the allocation. Standard
* adjustments include removing the widget’s margins, and applying the
* widget’s #GtkWidget:halign and #GtkWidget:valign properties.
*
* For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
* instead.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Gtk.Allocation): void;
/**
* Signal emitted when the widget state
* changes. Deprecated: 3.0
* @param previous_state
*/
vfunc_state_changed(previous_state: Gtk.StateType): void;
/**
* Signal emitted when the widget state changes,
* see gtk_widget_get_state_flags().
* @param previous_state_flags
*/
vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void;
/**
* Signal emitted when a new style has been set on a
* widget. Deprecated: 3.0
* @param previous_style
*/
vfunc_style_set(previous_style: Gtk.Style): void;
/**
* Signal emitted when the GtkStyleContext of a widget
* is changed.
*/
vfunc_style_updated(): void;
/**
* Signal emitted when a touch event happens
* @param event
*/
vfunc_touch_event(event: Gdk.EventTouch): boolean;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it’s currently mapped.
*/
vfunc_unmap(): void;
/**
* Signal will be emitted when the widget’s window is
* unmapped.
* @param event
*/
vfunc_unmap_event(event: Gdk.EventAny): boolean;
/**
* This function is only useful in widget implementations.
* Causes a widget to be unrealized (frees all GDK resources
* associated with the widget, such as `widget->`window).
*/
vfunc_unrealize(): void;
/**
* Signal emitted when the widget’s window is
* obscured or unobscured.
* @param event
*/
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
/**
* Signal emitted when the state of the toplevel
* window associated to the widget changes.
* @param event
*/
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace UnitStore {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gtk.TreeModel.ConstructorProps {
has_percent: boolean;
hasPercent: boolean;
has_pixels: boolean;
hasPixels: boolean;
long_format: string;
longFormat: string;
num_values: number;
numValues: number;
short_format: string;
shortFormat: string;
}
}
/**
* A model for #GimpUnit views
*/
class UnitStore extends GObject.Object implements Gtk.TreeModel {
static $gtype: GObject.GType;
// Properties
get has_percent(): boolean;
set has_percent(val: boolean);
get hasPercent(): boolean;
set hasPercent(val: boolean);
get has_pixels(): boolean;
set has_pixels(val: boolean);
get hasPixels(): boolean;
set hasPixels(val: boolean);
get long_format(): string;
set long_format(val: string);
get longFormat(): string;
set longFormat(val: string);
get num_values(): number;
get numValues(): number;
get short_format(): string;
set short_format(val: string);
get shortFormat(): string;
set shortFormat(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](num_values: number): UnitStore;
// Methods
get_has_percent(): boolean;
get_has_pixels(): boolean;
get_nth_value(unit: Gimp.Unit, index: number): number;
set_has_percent(has_percent: boolean): void;
set_has_pixels(has_pixels: boolean): void;
set_pixel_value(index: number, value: number): void;
set_resolution(index: number, resolution: number): void;
// Inherited methods
/**
* Creates a new #GtkTreeModel, with `child_model` as the child_model
* and `root` as the virtual root.
* @param root A #GtkTreePath or %NULL.
* @returns A new #GtkTreeModel.
*/
filter_new(root?: Gtk.TreePath | null): Gtk.TreeModel;
/**
* Calls func on each node in model in a depth-first fashion.
*
* If `func` returns %TRUE, then the tree ceases to be walked,
* and gtk_tree_model_foreach() returns.
* @param func a function to be called on each row
*/
foreach(func: Gtk.TreeModelForeachFunc): void;
/**
* Returns the type of the column.
* @param index_ the column index
* @returns the type of the column
*/
get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface.
*
* The flags are a bitwise combination of #GtkTreeModelFlags.
* The flags supported should not change during the lifetime
* of the `tree_model`.
* @returns the flags supported by this interface
*/
get_flags(): Gtk.TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`. If `path` does
* not exist, `iter` is set to an invalid iterator and %FALSE is returned.
* @param path the #GtkTreePath-struct
* @returns %TRUE, if @iter was set
*/
get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter];
/**
* Initializes `iter` with the first iterator in the tree
* (the one at the path "0") and returns %TRUE. Returns
* %FALSE if the tree is empty.
* @returns %TRUE, if @iter was set
*/
get_iter_first(): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to a valid iterator pointing to `path_string,` if it
* exists. Otherwise, `iter` is left invalid and %FALSE is returned.
* @param path_string a string representation of a #GtkTreePath-struct
* @returns %TRUE, if @iter was set
*/
get_iter_from_string(path_string: string): [boolean, Gtk.TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
* @returns the number of columns
*/
get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath-struct referenced by `iter`.
*
* This path should be freed with gtk_tree_path_free().
* @param iter the #GtkTreeIter-struct
* @returns a newly-created #GtkTreePath-struct
*/
get_path(iter: Gtk.TreeIter): Gtk.TreePath;
/**
* Generates a string representation of the iter.
*
* This string is a “:” separated list of numbers.
* For example, “4:10:0:3” would be an acceptable
* return value for this string.
* @param iter a #GtkTreeIter-struct
* @returns a newly-allocated string. Must be freed with g_free().
*/
get_string_from_iter(iter: Gtk.TreeIter): string;
/**
* Initializes and sets `value` to that at `column`.
*
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter the #GtkTreeIter-struct
* @param column the column to lookup the value at
*/
get_value(iter: Gtk.TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`.
*
* If `parent` has no children, %FALSE is returned and `iter` is
* set to be invalid. `parent` will remain a valid node after this
* function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* `gtk_tree_model_get_iter_first (tree_model, iter);`
* @param parent the #GtkTreeIter-struct, or %NULL
* @returns %TRUE, if @iter has been set to the first child
*/
iter_children(parent?: Gtk.TreeIter | null): [boolean, Gtk.TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter the #GtkTreeIter-struct to test for children
* @returns %TRUE if @iter has children
*/
iter_has_child(iter: Gtk.TreeIter): boolean;
/**
* Returns the number of children that `iter` has.
*
* As a special case, if `iter` is %NULL, then the number
* of toplevel nodes is returned.
* @param iter the #GtkTreeIter-struct, or %NULL
* @returns the number of children of @iter
*/
iter_n_children(iter?: Gtk.TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level.
*
* If there is no next `iter,` %FALSE is returned and `iter` is set
* to be invalid.
* @param iter the #GtkTreeIter-struct
* @returns %TRUE if @iter has been changed to the next node
*/
iter_next(iter: Gtk.TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index.
*
* The first index is 0. If `n` is too big, or `parent` has no children,
* `iter` is set to an invalid iterator and %FALSE is returned. `parent`
* will remain a valid node after this function has been called. As a
* special case, if `parent` is %NULL, then the `n-th` root node
* is set.
* @param parent the #GtkTreeIter-struct to get the child from, or %NULL.
* @param n the index of the desired child
* @returns %TRUE, if @parent has an @n-th child
*/
iter_nth_child(parent: Gtk.TreeIter | null, n: number): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to be the parent of `child`.
*
* If `child` is at the toplevel, and doesn’t have a parent, then
* `iter` is set to an invalid iterator and %FALSE is returned.
* `child` will remain a valid node after this function has been
* called.
*
* `iter` will be initialized before the lookup is performed, so `child`
* and `iter` cannot point to the same memory location.
* @param child the #GtkTreeIter-struct
* @returns %TRUE, if @iter is set to the parent of @child
*/
iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to point to the previous node at the current level.
*
* If there is no previous `iter,` %FALSE is returned and `iter` is
* set to be invalid.
* @param iter the #GtkTreeIter-struct
* @returns %TRUE if @iter has been changed to the previous node
*/
iter_previous(iter: Gtk.TreeIter): boolean;
/**
* Lets the tree ref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let
* caching models know when nodes are being displayed (and hence,
* whether or not to cache that node). Being displayed means a node
* is in an expanded branch, regardless of whether the node is currently
* visible in the viewport. For example, a file-system based model
* would not want to keep the entire file-hierarchy in memory,
* just the sections that are currently being displayed by
* every current view.
*
* A model should be expected to be able to get an iter independent
* of its reffed state.
* @param iter the #GtkTreeIter-struct
*/
ref_node(iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-changed signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-deleted signal on `tree_model`.
*
* This should be called by models after a row has been removed.
* The location pointed to by `path` should be the location that
* the row previously was at. It may not be a valid location anymore.
*
* Nodes that are deleted are not unreffed, this means that any
* outstanding references on the deleted node should not be released.
* @param path a #GtkTreePath-struct pointing to the previous location of the deleted row
*/
row_deleted(path: Gtk.TreePath): void;
/**
* Emits the #GtkTreeModel::row-has-child-toggled signal on
* `tree_model`. This should be called by models after the child
* state of a node changes.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-inserted signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the inserted row
* @param iter a valid #GtkTreeIter-struct pointing to the inserted row
*/
row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::rows-reordered signal on `tree_model`.
*
* This should be called by models when their rows have been
* reordered.
* @param path a #GtkTreePath-struct pointing to the tree node whose children have been reordered
* @param iter a valid #GtkTreeIter-struct pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order`[newpos] = oldpos`
*/
rows_reordered(path: Gtk.TreePath, iter: Gtk.TreeIter | null, new_order: number[]): void;
/**
* Lets the tree unref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons. For more information on what
* this means, see gtk_tree_model_ref_node().
*
* Please note that nodes that are deleted are not unreffed.
* @param iter the #GtkTreeIter-struct
*/
unref_node(iter: Gtk.TreeIter): void;
/**
* Returns the type of the column.
* @param index_ the column index
*/
vfunc_get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface.
*
* The flags are a bitwise combination of #GtkTreeModelFlags.
* The flags supported should not change during the lifetime
* of the `tree_model`.
*/
vfunc_get_flags(): Gtk.TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`. If `path` does
* not exist, `iter` is set to an invalid iterator and %FALSE is returned.
* @param path the #GtkTreePath-struct
*/
vfunc_get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
*/
vfunc_get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath-struct referenced by `iter`.
*
* This path should be freed with gtk_tree_path_free().
* @param iter the #GtkTreeIter-struct
*/
vfunc_get_path(iter: Gtk.TreeIter): Gtk.TreePath;
/**
* Initializes and sets `value` to that at `column`.
*
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter the #GtkTreeIter-struct
* @param column the column to lookup the value at
*/
vfunc_get_value(iter: Gtk.TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`.
*
* If `parent` has no children, %FALSE is returned and `iter` is
* set to be invalid. `parent` will remain a valid node after this
* function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* `gtk_tree_model_get_iter_first (tree_model, iter);`
* @param parent the #GtkTreeIter-struct, or %NULL
*/
vfunc_iter_children(parent?: Gtk.TreeIter | null): [boolean, Gtk.TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter the #GtkTreeIter-struct to test for children
*/
vfunc_iter_has_child(iter: Gtk.TreeIter): boolean;
/**
* Returns the number of children that `iter` has.
*
* As a special case, if `iter` is %NULL, then the number
* of toplevel nodes is returned.
* @param iter the #GtkTreeIter-struct, or %NULL
*/
vfunc_iter_n_children(iter?: Gtk.TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level.
*
* If there is no next `iter,` %FALSE is returned and `iter` is set
* to be invalid.
* @param iter the #GtkTreeIter-struct
*/
vfunc_iter_next(iter: Gtk.TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index.
*
* The first index is 0. If `n` is too big, or `parent` has no children,
* `iter` is set to an invalid iterator and %FALSE is returned. `parent`
* will remain a valid node after this function has been called. As a
* special case, if `parent` is %NULL, then the `n-th` root node
* is set.
* @param parent the #GtkTreeIter-struct to get the child from, or %NULL.
* @param n the index of the desired child
*/
vfunc_iter_nth_child(parent: Gtk.TreeIter | null, n: number): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to be the parent of `child`.
*
* If `child` is at the toplevel, and doesn’t have a parent, then
* `iter` is set to an invalid iterator and %FALSE is returned.
* `child` will remain a valid node after this function has been
* called.
*
* `iter` will be initialized before the lookup is performed, so `child`
* and `iter` cannot point to the same memory location.
* @param child the #GtkTreeIter-struct
*/
vfunc_iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter];
/**
* Sets `iter` to point to the previous node at the current level.
*
* If there is no previous `iter,` %FALSE is returned and `iter` is
* set to be invalid.
* @param iter the #GtkTreeIter-struct
*/
vfunc_iter_previous(iter: Gtk.TreeIter): boolean;
/**
* Lets the tree ref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let
* caching models know when nodes are being displayed (and hence,
* whether or not to cache that node). Being displayed means a node
* is in an expanded branch, regardless of whether the node is currently
* visible in the viewport. For example, a file-system based model
* would not want to keep the entire file-hierarchy in memory,
* just the sections that are currently being displayed by
* every current view.
*
* A model should be expected to be able to get an iter independent
* of its reffed state.
* @param iter the #GtkTreeIter-struct
*/
vfunc_ref_node(iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-changed signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
vfunc_row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-deleted signal on `tree_model`.
*
* This should be called by models after a row has been removed.
* The location pointed to by `path` should be the location that
* the row previously was at. It may not be a valid location anymore.
*
* Nodes that are deleted are not unreffed, this means that any
* outstanding references on the deleted node should not be released.
* @param path a #GtkTreePath-struct pointing to the previous location of the deleted row
*/
vfunc_row_deleted(path: Gtk.TreePath): void;
/**
* Emits the #GtkTreeModel::row-has-child-toggled signal on
* `tree_model`. This should be called by models after the child
* state of a node changes.
* @param path a #GtkTreePath-struct pointing to the changed row
* @param iter a valid #GtkTreeIter-struct pointing to the changed row
*/
vfunc_row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Emits the #GtkTreeModel::row-inserted signal on `tree_model`.
* @param path a #GtkTreePath-struct pointing to the inserted row
* @param iter a valid #GtkTreeIter-struct pointing to the inserted row
*/
vfunc_row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
/**
* Lets the tree unref the node.
*
* This is an optional method for models to implement.
* To be more specific, models may ignore this call as it exists
* primarily for performance reasons. For more information on what
* this means, see gtk_tree_model_ref_node().
*
* Please note that nodes that are deleted are not unreffed.
* @param iter the #GtkTreeIter-struct
*/
vfunc_unref_node(iter: Gtk.TreeIter): 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 VectorLoadProcedureDialog {
// Constructor properties interface
interface ConstructorProps
extends ProcedureDialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
class VectorLoadProcedureDialog extends ProcedureDialog implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
procedure: Gimp.VectorLoadProcedure,
config: Gimp.ProcedureConfig,
extracted_data?: Gimp.VectorLoadData | null,
file?: Gio.File | null,
): VectorLoadProcedureDialog;
// Conflicted with GimpUi.ProcedureDialog.new
static ['new'](...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;
/**
* 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 ZoomModel {
// Signal callback interfaces
interface Zoomed {
(old_factor: number, new_factor: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
fraction: string;
maximum: number;
minimum: number;
percentage: string;
value: number;
}
}
/**
* A model for zoom values.
*/
class ZoomModel extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The zoom factor expressed as a fraction.
*/
get fraction(): string;
/**
* The maximum zoom factor.
*/
get maximum(): number;
set maximum(val: number);
/**
* The minimum zoom factor.
*/
get minimum(): number;
set minimum(val: number);
/**
* The zoom factor expressed as percentage.
*/
get percentage(): string;
/**
* The zoom factor.
*/
get value(): number;
set value(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ZoomModel;
// 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: 'zoomed',
callback: (_source: this, old_factor: number, new_factor: number) => void,
): number;
connect_after(
signal: 'zoomed',
callback: (_source: this, old_factor: number, new_factor: number) => void,
): number;
emit(signal: 'zoomed', old_factor: number, new_factor: number): void;
// Static methods
/**
* Utility function to calculate a new scale factor.
* @param zoom_type the zoom type
* @param scale ignored unless @zoom_type == %GIMP_ZOOM_TO
* @param delta the delta from a smooth zoom event
*/
static zoom_step(zoom_type: ZoomType, scale: number, delta: number): number;
// Methods
/**
* Retrieves the current zoom factor of `model`.
* @returns the current scale factor Since GIMP 2.4
*/
get_factor(): number;
/**
* Retrieves the current zoom factor of `model` as a fraction.
*
* Since GIMP 2.4
*/
get_fraction(): [number, number];
/**
* Sets the allowed range of the `model`.
*
* Since GIMP 2.4
* @param min new lower limit for zoom factor
* @param max new upper limit for zoom factor
*/
set_range(min: number, max: number): void;
/**
* Since GIMP 2.4
* @param zoom_type the #GimpZoomType
* @param scale ignored unless @zoom_type == %GIMP_ZOOM_TO
*/
zoom(zoom_type: ZoomType | null, scale: number): void;
}
namespace ZoomPreview {
// Constructor properties interface
interface ConstructorProps
extends ScrolledPreview.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
drawable: Gimp.Drawable;
model: ZoomModel;
}
}
/**
* A drawable preview with zooming capabilities.
*/
class ZoomPreview extends ScrolledPreview implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
get drawable(): Gimp.Drawable;
/**
* The #GimpZoomModel used by this #GimpZoomPreview.
*/
get model(): ZoomModel;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static new_from_drawable(drawable: Gimp.Drawable): ZoomPreview;
static new_with_model_from_drawable(drawable: Gimp.Drawable, model: ZoomModel): ZoomPreview;
// Methods
/**
* Returns the drawable the #GimpZoomPreview is attached to.
* @returns the drawable that was passed to gimp_zoom_preview_new_from_drawable().
*/
get_drawable(): Gimp.Drawable;
/**
* Returns the zoom factor the preview is currently using.
* @returns the current zoom factor
*/
get_factor(): number;
/**
* Returns the #GimpZoomModel the preview is using.
* @returns a pointer to the #GimpZoomModel owned by the @preview
*/
get_model(): ZoomModel;
/**
* Returns the scaled image data of the part of the drawable the
* #GimpZoomPreview is currently showing, as a newly allocated array of guchar.
* This function also allow to get the current width, height and bpp of the
* #GimpZoomPreview.
* @returns newly allocated data that should be released using g_free() when it is not any longer needed
*/
get_source(): [Uint8Array, number, number, number];
// 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;
}
type AspectPreviewClass = typeof AspectPreview;
type BrowserClass = typeof Browser;
type BrushChooserClass = typeof BrushChooser;
type BusyBoxClass = typeof BusyBox;
type ButtonClass = typeof Button;
type CellRendererColorClass = typeof CellRendererColor;
type CellRendererToggleClass = typeof CellRendererToggle;
type ChainButtonClass = typeof ChainButton;
type ColorAreaClass = typeof ColorArea;
type ColorButtonClass = typeof ColorButton;
type ColorDisplayClass = typeof ColorDisplay;
type ColorDisplayStackClass = typeof ColorDisplayStack;
type ColorHexEntryClass = typeof ColorHexEntry;
type ColorNotebookClass = typeof ColorNotebook;
type ColorProfileChooserDialogClass = typeof ColorProfileChooserDialog;
type ColorProfileComboBoxClass = typeof ColorProfileComboBox;
type ColorProfileStoreClass = typeof ColorProfileStore;
type ColorProfileViewClass = typeof ColorProfileView;
type ColorScaleClass = typeof ColorScale;
type ColorScaleEntryClass = typeof ColorScaleEntry;
abstract class ColorScales {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
abstract class ColorSelect {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
type ColorSelectionClass = typeof ColorSelection;
type ColorSelectorClass = typeof ColorSelector;
abstract class Controller {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
type DialogClass = typeof Dialog;
type DrawableChooserClass = typeof DrawableChooser;
type DrawablePreviewClass = typeof DrawablePreview;
type EnumComboBoxClass = typeof EnumComboBox;
type EnumLabelClass = typeof EnumLabel;
type EnumStoreClass = typeof EnumStore;
type ExportProcedureDialogClass = typeof ExportProcedureDialog;
type FileChooserClass = typeof FileChooser;
abstract class FileEntry {
static $gtype: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
type FontChooserClass = typeof FontChooser;
type FrameClass = typeof Frame;
type GradientChooserClass = typeof GradientChooser;
type HintBoxClass = typeof HintBox;
type ImageComboBoxClass = typeof ImageComboBox;
type IntComboBoxClass = typeof IntComboBox;
type IntRadioFrameClass = typeof IntRadioFrame;
type IntStoreClass = typeof IntStore;
type LabelColorClass = typeof LabelColor;
type LabelEntryClass = typeof LabelEntry;
type LabelIntWidgetClass = typeof LabelIntWidget;
type LabelSpinClass = typeof LabelSpin;
type LabelStringWidgetClass = typeof LabelStringWidget;
type LabeledClass = typeof Labeled;
type MemsizeEntryClass = typeof MemsizeEntry;
type NumberPairEntryClass = typeof NumberPairEntry;
type OffsetAreaClass = typeof OffsetArea;
type PageSelectorClass = typeof PageSelector;
type PaletteChooserClass = typeof PaletteChooser;
type PathEditorClass = typeof PathEditor;
type PatternChooserClass = typeof PatternChooser;
type PickButtonClass = typeof PickButton;
type PreviewAreaClass = typeof PreviewArea;
type PreviewClass = typeof Preview;
type ProcBrowserDialogClass = typeof ProcBrowserDialog;
type ProcedureDialogClass = typeof ProcedureDialog;
type ProgressBarClass = typeof ProgressBar;
type ResourceChooserClass = typeof ResourceChooser;
type RulerClass = typeof Ruler;
type ScaleEntryClass = typeof ScaleEntry;
type ScrolledPreviewClass = typeof ScrolledPreview;
type SizeEntryClass = typeof SizeEntry;
type SpinButtonClass = typeof SpinButton;
type SpinScaleClass = typeof SpinScale;
type StringComboBoxClass = typeof StringComboBox;
type UnitComboBoxClass = typeof UnitComboBox;
type UnitStoreClass = typeof UnitStore;
type VectorLoadProcedureDialogClass = typeof VectorLoadProcedureDialog;
type ZoomModelClass = typeof ZoomModel;
type ZoomPreviewClass = typeof ZoomPreview;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GimpUi;
}
declare module 'gi://GimpUi' {
import GimpUi30 from 'gi://GimpUi?version=3.0';
export default GimpUi30;
}
// END