///
///
///
///
///
///
///
///
///
///
///
///
///
///
/**
* 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://Handy?version=1' {
// Module dependencies
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 cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
export namespace Handy {
/**
* Handy-1
*/
/**
* Describes title centering behavior of a [class`HeaderBar]` widget.
*/
/**
* Describes title centering behavior of a [class`HeaderBar]` widget.
*/
export namespace CenteringPolicy {
export const $gtype: GObject.GType;
}
enum CenteringPolicy {
/**
* Keep the title centered when possible
*/
LOOSE,
/**
* Keep the title centered at all cost
*/
STRICT,
}
/**
* Application color schemes for [property`StyleManager:`color-scheme].
*/
/**
* Application color schemes for [property`StyleManager:`color-scheme].
*/
export namespace ColorScheme {
export const $gtype: GObject.GType;
}
enum ColorScheme {
/**
* Inherit the parent color-scheme. When set on the
* [class`StyleManager]` returned by [func`StyleManager`.get_default], it's
* equivalent to `HDY_COLOR_SCHEME_FORCE_LIGHT`.
*/
DEFAULT,
/**
* Always use light appearance.
*/
FORCE_LIGHT,
/**
* Use light appearance unless the system
* prefers dark colors.
*/
PREFER_LIGHT,
/**
* Use dark appearance unless the system prefers
* light colors.
*/
PREFER_DARK,
/**
* Always use dark appearance.
*/
FORCE_DARK,
}
/**
* Describes the possible transitions in a [class`Deck]` widget.
*
* New values may be added to this enumeration over time.
*/
/**
* Describes the possible transitions in a [class`Deck]` widget.
*
* New values may be added to this enumeration over time.
*/
export namespace DeckTransitionType {
export const $gtype: GObject.GType;
}
enum DeckTransitionType {
/**
* Cover the old page or uncover the new page,
* sliding from or towards the end according to orientation, text direction
* and children order
*/
OVER,
/**
* Uncover the new page or cover the old page,
* sliding from or towards the start according to orientation, text direction
* and children order
*/
UNDER,
/**
* Slide from left, right, up or down according
* to the orientation, text direction and the children order
*/
SLIDE,
}
/**
* Describes the possible folding behavior of a [class`Flap]` widget.
*/
/**
* Describes the possible folding behavior of a [class`Flap]` widget.
*/
export namespace FlapFoldPolicy {
export const $gtype: GObject.GType;
}
enum FlapFoldPolicy {
/**
* Disable folding, the flap cannot reach narrow
* sizes.
*/
NEVER,
/**
* Keep the flap always folded.
*/
ALWAYS,
/**
* Fold and unfold the flap based on available
* space.
*/
AUTO,
}
/**
* Describes transitions types of a [class`Flap]` widget.
*
* These enumeration values describe the possible transitions between children
* in a [class`Flap]` widget, as well as which areas can be swiped via
* [property`Flap:`swipe-to-open] and [property`Flap:`swipe-to-close].
*
* New values may be added to this enum over time.
*/
/**
* Describes transitions types of a [class`Flap]` widget.
*
* These enumeration values describe the possible transitions between children
* in a [class`Flap]` widget, as well as which areas can be swiped via
* [property`Flap:`swipe-to-open] and [property`Flap:`swipe-to-close].
*
* New values may be added to this enum over time.
*/
export namespace FlapTransitionType {
export const $gtype: GObject.GType;
}
enum FlapTransitionType {
/**
* The flap slides over the content, which is
* dimmed. When folded, only the flap can be swiped.
*/
OVER,
/**
* The content slides over the flap. Only the
* content can be swiped.
*/
UNDER,
/**
* The flap slides offscreen when hidden,
* neither the flap nor content overlap each other. Both widgets can be
* swiped.
*/
SLIDE,
}
/**
* Describes the child types handled by [class`HeaderGroup]`.
*
* New values may be added to this enumeration over time.
*/
/**
* Describes the child types handled by [class`HeaderGroup]`.
*
* New values may be added to this enumeration over time.
*/
export namespace HeaderGroupChildType {
export const $gtype: GObject.GType;
}
enum HeaderGroupChildType {
/**
* The child is a [class`HeaderBar]`
*/
HEADER_BAR,
/**
* The child is a
* [class`Gtk`.HeaderBar]
*/
GTK_HEADER_BAR,
/**
* The child is a
* [class`HeaderGroup]`
*/
HEADER_GROUP,
}
/**
* Describes the possible transitions in a [class`Leaflet]` widget.
*
* New values may be added to this enumeration over time.
*/
/**
* Describes the possible transitions in a [class`Leaflet]` widget.
*
* New values may be added to this enumeration over time.
*/
export namespace LeafletTransitionType {
export const $gtype: GObject.GType;
}
enum LeafletTransitionType {
/**
* Cover the old page or uncover the new
* page, sliding from or towards the end according to orientation, text
* direction and children order
*/
OVER,
/**
* Uncover the new page or cover the old
* page, sliding from or towards the start according to orientation, text
* direction and children order
*/
UNDER,
/**
* Slide from left, right, up or down
* according to the orientation, text direction and the children order
*/
SLIDE,
}
/**
* Describes the direction of a swipe navigation gesture.
*/
/**
* Describes the direction of a swipe navigation gesture.
*/
export namespace NavigationDirection {
export const $gtype: GObject.GType;
}
enum NavigationDirection {
/**
* Corresponds to start or top, depending on
* orientation and text direction
*/
BACK,
/**
* Corresponds to end or bottom, depending on
* orientation and text direction
*/
FORWARD,
}
/**
* Describes the possible transitions in a [class`Squeezer]` widget.
*/
/**
* Describes the possible transitions in a [class`Squeezer]` widget.
*/
export namespace SqueezerTransitionType {
export const $gtype: GObject.GType;
}
enum SqueezerTransitionType {
/**
* No transition
*/
NONE,
/**
* A cross-fade
*/
CROSSFADE,
}
/**
* Describes the adaptive modes of [class`ViewSwitcher]`.
*/
/**
* Describes the adaptive modes of [class`ViewSwitcher]`.
*/
export namespace ViewSwitcherPolicy {
export const $gtype: GObject.GType;
}
enum ViewSwitcherPolicy {
/**
* Automatically adapt to the best fitting mode
*/
AUTO,
/**
* Force the narrow mode
*/
NARROW,
/**
* Force the wide mode
*/
WIDE,
}
/**
* Computes the ease out for a value.
* @param t the term
* @returns the ease out for @t
*/
function ease_out_cubic(t: number): number;
/**
* Returns the name of a [class`EnumValueObject]`.
*
* This is a default implementation of [callback`ComboRowGetEnumValueNameFunc]`
* to be used with [method`ComboRow`.set_for_enum]. If the enumeration has a
* nickname, it will return it, otherwise it will return its name.
* @param value the value from the enum from which to get a name
* @param user_data unused user data
* @returns a displayable name that represents @value
*/
function enum_value_row_name(value: EnumValueObject, user_data?: any | null): string;
/**
* Checks whether animations are enabled for `widget`.
*
* This should be used when implementing an animated widget to know whether to
* animate it or not.
* @param widget a widget
* @returns whether animations are enabled for @widget
*/
function get_enable_animations(widget: Gtk.Widget): boolean;
/**
* Initializes Libhandy.
*
* Call this function just after initializing GTK, if you are using
* [class`Gtk`.Application] it means it must be called when the
* [signal`Gio`.Application::startup] signal is emitted.
*
* If Libhandy has already been initialized, the function will simply return.
*
* This makes sure translations, types, themes, and icons for the Handy library
* are set up properly.
*/
function init(): void;
interface AvatarImageLoadFunc {
(size: number): GdkPixbuf.Pixbuf | null;
}
interface ComboRowGetEnumValueNameFunc {
(value: EnumValueObject): string;
}
interface ComboRowGetNameFunc {
(item: A): string;
}
namespace ActionRow {
// Signal callback interfaces
interface Activated {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends PreferencesRow.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Actionable.ConstructorProps,
Gtk.Buildable.ConstructorProps {
activatable_widget: Gtk.Widget;
activatableWidget: Gtk.Widget;
icon_name: string;
iconName: string;
subtitle: string;
subtitle_lines: number;
subtitleLines: number;
title_lines: number;
titleLines: number;
use_underline: boolean;
useUnderline: boolean;
}
}
/**
* A [class`Gtk`.ListBoxRow] used to present actions.
*
* The `HdyActionRow` widget can have a title, a subtitle and an icon. The row
* can receive additional widgets at its end, or prefix widgets at its start.
*
* It is convenient to present a preference and its related actions.
*
* `HdyActionRow` is unactivatable by default, giving it an activatable widget
* will automatically make it activatable, but unsetting it won't change the
* row's activatability.
*
* ## HdyActionRow as GtkBuildable
*
* The `HdyActionRow` implementation of the [iface`Gtk`.Buildable] interface
* supports adding a child at its end by specifying “suffix” or omitting the
* “type” attribute of a element.
*
* It also supports adding a child as a prefix widget by specifying “prefix” as
* the “type” attribute of a element.
*
* ## CSS nodes
*
* `HdyActionRow` has a main CSS node with name `row`.
*
* It contains the subnode `box.header` for its main horizontal box, and
* `box.title` for the vertical box containing the title and subtitle labels.
*
* It contains subnodes `label.title` and `label.subtitle` representing
* respectively the title label and subtitle label.
*/
class ActionRow extends PreferencesRow implements Atk.ImplementorIface, Gtk.Actionable, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The activatable widget for this row.
*
* The widget is activated, either by clicking on it, by calling
* [method`ActionRow`.activate], or via mnemonics in the title or the subtitle.
* See the [property`ActionRow:`use-underline] property to enable mnemonics.
*
* The target widget will be activated by emitting the
* [signal`Gtk`.Widget::mnemonic-activate] signal on it.
*/
get activatable_widget(): Gtk.Widget;
set activatable_widget(val: Gtk.Widget);
/**
* The activatable widget for this row.
*
* The widget is activated, either by clicking on it, by calling
* [method`ActionRow`.activate], or via mnemonics in the title or the subtitle.
* See the [property`ActionRow:`use-underline] property to enable mnemonics.
*
* The target widget will be activated by emitting the
* [signal`Gtk`.Widget::mnemonic-activate] signal on it.
*/
get activatableWidget(): Gtk.Widget;
set activatableWidget(val: Gtk.Widget);
/**
* The icon name for this row.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The icon name for this row.
*/
get iconName(): string;
set iconName(val: string);
/**
* The subtitle for this row.
*/
get subtitle(): string;
set subtitle(val: string);
/**
* The number of lines at the end of which the subtitle label will be
* ellipsized.
*
* If the value is 0, the number of lines won't be limited.
*/
get subtitle_lines(): number;
set subtitle_lines(val: number);
/**
* The number of lines at the end of which the subtitle label will be
* ellipsized.
*
* If the value is 0, the number of lines won't be limited.
*/
get subtitleLines(): number;
set subtitleLines(val: number);
/**
* The number of lines at the end of which the title label will be ellipsized.
*
* If the value is 0, the number of lines won't be limited.
*/
get title_lines(): number;
set title_lines(val: number);
/**
* The number of lines at the end of which the title label will be ellipsized.
*
* If the value is 0, the number of lines won't be limited.
*/
get titleLines(): number;
set titleLines(val: number);
/**
* Whether embedded underlines in the title or subtitle indicates a mnemonic.
*
* If true, an underline in the text of the title or subtitle labels indicates
* the next character should be used for the mnemonic accelerator key.
*/
get use_underline(): boolean;
set use_underline(val: boolean);
/**
* Whether embedded underlines in the title or subtitle indicates a mnemonic.
*
* If true, an underline in the text of the title or subtitle labels indicates
* the next character should be used for the mnemonic accelerator key.
*/
get useUnderline(): boolean;
set useUnderline(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ActionRow;
// 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: 'activated', callback: (_source: this) => void): number;
connect_after(signal: 'activated', callback: (_source: this) => void): number;
emit(signal: 'activated'): void;
// Virtual methods
/**
* Activates `self`.
*/
vfunc_activate(): void;
// Methods
/**
* Activates `self`.
*/
activate(): void;
// Conflicted with Gtk.Widget.activate
activate(...args: never[]): any;
/**
* Adds a prefix widget to `self`.
* @param widget the prefix widget
*/
add_prefix(widget: Gtk.Widget): void;
/**
* Gets the widget activated when `self` is activated.
* @returns the activatable widget for @self
*/
get_activatable_widget(): Gtk.Widget | null;
/**
* Gets the icon name for `self`.
* @returns the icon name for @self
*/
get_icon_name(): string;
/**
* Gets the subtitle for `self`.
* @returns the subtitle for @self
*/
get_subtitle(): string | null;
/**
* Gets the number of lines at the end of which the subtitle label will be
* ellipsized.
*
* If the value is 0, the number of lines won't be limited.
* @returns the number of lines at the end of which the subtitle label will be ellipsized
*/
get_subtitle_lines(): number;
/**
* Gets the number of lines at the end of which the title label will be
* ellipsized.
*
* If the value is 0, the number of lines won't be limited.
* @returns the number of lines at the end of which the title label will be ellipsized
*/
get_title_lines(): number;
/**
* Gets whether an embedded underline in the title or subtitle indicates a
* mnemonic.
* @returns whether an embedded underline in the title or subtitle indicates a mnemonic
*/
get_use_underline(): boolean;
/**
* Sets the widget to activate when `self` is activated.
* @param widget the target widget
*/
set_activatable_widget(widget?: Gtk.Widget | null): void;
/**
* Sets the icon name for `self`.
* @param icon_name the icon name
*/
set_icon_name(icon_name: string): void;
/**
* Sets the subtitle for `self`.
* @param subtitle the subtitle
*/
set_subtitle(subtitle?: string | null): void;
/**
* Sets the number of lines at the end of which the subtitle label will be
* ellipsized.
*
* If the value is 0, the number of lines won't be limited.
* @param subtitle_lines the number of lines at the end of which the subtitle label will be ellipsized
*/
set_subtitle_lines(subtitle_lines: number): void;
/**
* Sets the number of lines at the end of which the title label will be
* ellipsized.
*
* If the value is 0, the number of lines won't be limited.
* @param title_lines the number of lines at the end of which the title label will be ellipsized
*/
set_title_lines(title_lines: number): void;
/**
* Sets whether an embedded underline in the title or subtitle indicates a
* mnemonic.
* @param use_underline `TRUE` if underlines in the text indicate mnemonics
*/
set_use_underline(use_underline: 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;
/**
* 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 ApplicationWindow {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ApplicationWindow.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gio.ActionGroup.ConstructorProps,
Gio.ActionMap.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
/**
* A freeform application window.
*
* `HdyApplicationWindow` is a [class`Gtk`.ApplicationWindow] subclass providing
* the same features as [class`Window]`.
*
* See [class`Window]` for details.
*
* Using [method`Gtk`.Application.set_app_menu] and
* [method`Gtk`.Application.set_menubar] is not supported and may result in
* visual glitches.
*/
class ApplicationWindow
extends Gtk.ApplicationWindow
implements Atk.ImplementorIface, Gio.ActionGroup, Gio.ActionMap, Gtk.Buildable
{
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ApplicationWindow;
// Inherited methods
/**
* Emits the [signal`Gio`.ActionGroup::action-added] signal on `action_group`.
*
* This function should only be called by [type`Gio`.ActionGroup] implementations.
* @param action_name the name of an action in the group
*/
action_added(action_name: string): void;
/**
* Emits the [signal`Gio`.ActionGroup::action-enabled-changed] signal on `action_group`.
*
* This function should only be called by [type`Gio`.ActionGroup] implementations.
* @param action_name the name of an action in the group
* @param enabled whether the action is now enabled
*/
action_enabled_changed(action_name: string, enabled: boolean): void;
/**
* Emits the [signal`Gio`.ActionGroup::action-removed] signal on `action_group`.
*
* This function should only be called by [type`Gio`.ActionGroup] implementations.
* @param action_name the name of an action in the group
*/
action_removed(action_name: string): void;
/**
* Emits the [signal`Gio`.ActionGroup::action-state-changed] signal on `action_group`.
*
* This function should only be called by [type`Gio`.ActionGroup] implementations.
* @param action_name the name of an action in the group
* @param state the new state of the named action
*/
action_state_changed(action_name: string, state: GLib.Variant): void;
/**
* Activate the named action within `action_group`.
*
* If the action is expecting a parameter, then the correct type of
* parameter must be given as `parameter`. If the action is expecting no
* parameters then `parameter` must be `NULL`. See
* [method`Gio`.ActionGroup.get_action_parameter_type].
*
* If the [type`Gio`.ActionGroup] implementation supports asynchronous remote
* activation over D-Bus, this call may return before the relevant
* D-Bus traffic has been sent, or any replies have been received. In
* order to block on such asynchronous activation calls,
* [method`Gio`.DBusConnection.flush] should be called prior to the code, which
* depends on the result of the action activation. Without flushing
* the D-Bus connection, there is no guarantee that the action would
* have been activated.
*
* The following code which runs in a remote app instance, shows an
* example of a ‘quit’ action being activated on the primary app
* instance over D-Bus. Here [method`Gio`.DBusConnection.flush] is called
* before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action
* may fail to be activated on the primary instance.
*
* ```c
* // call ‘quit’ action on primary instance
* g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL);
*
* // make sure the action is activated now
* g_dbus_connection_flush (…);
*
* g_debug ("Application has been terminated. Exiting.");
*
* exit (0);
* ```
* @param action_name the name of the action to activate
* @param parameter parameters to the activation
*/
activate_action(action_name: string, parameter?: GLib.Variant | null): void;
/**
* Request for the state of the named action within `action_group` to be
* changed to `value`.
*
* The action must be stateful and `value` must be of the correct type.
* See [method`Gio`.ActionGroup.get_action_state_type].
*
* This call merely requests a change. The action may refuse to change
* its state or may change its state to something other than `value`.
* See [method`Gio`.ActionGroup.get_action_state_hint].
*
* If the `value` GVariant is floating, it is consumed.
* @param action_name the name of the action to request the change on
* @param value the new state
*/
change_action_state(action_name: string, value: GLib.Variant): void;
/**
* Checks if the named action within `action_group` is currently enabled.
*
* An action must be enabled in order to be activated or in order to
* have its state changed from outside callers.
* @param action_name the name of the action to query
* @returns whether the action is currently enabled
*/
get_action_enabled(action_name: string): boolean;
/**
* Queries the type of the parameter that must be given when activating
* the named action within `action_group`.
*
* When activating the action using [method`Gio`.ActionGroup.activate_action],
* the [type`GLib`.Variant] given to that function must be of the type returned
* by this function.
*
* In the case that this function returns `NULL`, you must not give any
* [type`GLib`.Variant], but `NULL` instead.
*
* The parameter type of a particular action will never change but it is
* possible for an action to be removed and for a new action to be added
* with the same name but a different parameter type.
* @param action_name the name of the action to query
* @returns the parameter type
*/
get_action_parameter_type(action_name: string): GLib.VariantType | null;
/**
* Queries the current state of the named action within `action_group`.
*
* If the action is not stateful then `NULL` will be returned. If the
* action is stateful then the type of the return value is the type
* given by [method`Gio`.ActionGroup.get_action_state_type].
*
* The return value (if non-`NULL`) should be freed with
* [method`GLib`.Variant.unref] when it is no longer required.
* @param action_name the name of the action to query
* @returns the current state of the action
*/
get_action_state(action_name: string): GLib.Variant | null;
/**
* Requests a hint about the valid range of values for the state of the
* named action within `action_group`.
*
* If `NULL` is returned it either means that the action is not stateful
* or that there is no hint about the valid range of values for the
* state of the action.
*
* If a [type`GLib`.Variant] array is returned then each item in the array is a
* possible value for the state. If a [type`GLib`.Variant] pair (ie: two-tuple) is
* returned then the tuple specifies the inclusive lower and upper bound
* of valid values for the state.
*
* In any case, the information is merely a hint. It may be possible to
* have a state value outside of the hinted range and setting a value
* within the range may fail.
*
* The return value (if non-`NULL`) should be freed with
* [method`GLib`.Variant.unref] when it is no longer required.
* @param action_name the name of the action to query
* @returns the state range hint
*/
get_action_state_hint(action_name: string): GLib.Variant | null;
/**
* Queries the type of the state of the named action within
* `action_group`.
*
* If the action is stateful then this function returns the
* [type`GLib`.VariantType] of the state. All calls to
* [method`Gio`.ActionGroup.change_action_state] must give a [type`GLib`.Variant] of this
* type and [method`Gio`.ActionGroup.get_action_state] will return a [type`GLib`.Variant]
* of the same type.
*
* If the action is not stateful then this function will return `NULL`.
* In that case, [method`Gio`.ActionGroup.get_action_state] will return `NULL`
* and you must not call [method`Gio`.ActionGroup.change_action_state].
*
* The state type of a particular action will never change but it is
* possible for an action to be removed and for a new action to be added
* with the same name but a different state type.
* @param action_name the name of the action to query
* @returns the state type, if the action is stateful
*/
get_action_state_type(action_name: string): GLib.VariantType | null;
/**
* Checks if the named action exists within `action_group`.
* @param action_name the name of the action to check for
* @returns whether the named action exists
*/
has_action(action_name: string): boolean;
/**
* Lists the actions contained within `action_group`.
*
* The caller is responsible for freeing the list with [func`GLib`.strfreev] when
* it is no longer required.
* @returns a `NULL`-terminated array of the names of the actions in the group
*/
list_actions(): string[];
/**
* Queries all aspects of the named action within an `action_group`.
*
* This function acquires the information available from
* [method`Gio`.ActionGroup.has_action], [method`Gio`.ActionGroup.get_action_enabled],
* [method`Gio`.ActionGroup.get_action_parameter_type],
* [method`Gio`.ActionGroup.get_action_state_type],
* [method`Gio`.ActionGroup.get_action_state_hint] and
* [method`Gio`.ActionGroup.get_action_state] with a single function call.
*
* This provides two main benefits.
*
* The first is the improvement in efficiency that comes with not having
* to perform repeated lookups of the action in order to discover
* different things about it. The second is that implementing
* [type`Gio`.ActionGroup] can now be done by only overriding this one virtual
* function.
*
* The interface provides a default implementation of this function that
* calls the individual functions, as required, to fetch the
* information. The interface also provides default implementations of
* those functions that call this function. All implementations,
* therefore, must override either this function or all of the others.
*
* If the action exists, `TRUE` is returned and any of the requested
* fields (as indicated by having a non-`NULL` reference passed in) are
* filled. If the action doesn’t exist, `FALSE` is returned and the
* fields may or may not have been modified.
* @param action_name the name of an action in the group
* @returns `TRUE` if the action exists, else `FALSE`
*/
query_action(
action_name: string,
): [
boolean,
boolean,
GLib.VariantType | null,
GLib.VariantType | null,
GLib.Variant | null,
GLib.Variant | null,
];
/**
* Emits the [signal`Gio`.ActionGroup::action-added] signal on `action_group`.
*
* This function should only be called by [type`Gio`.ActionGroup] implementations.
* @param action_name the name of an action in the group
*/
vfunc_action_added(action_name: string): void;
/**
* Emits the [signal`Gio`.ActionGroup::action-enabled-changed] signal on `action_group`.
*
* This function should only be called by [type`Gio`.ActionGroup] implementations.
* @param action_name the name of an action in the group
* @param enabled whether the action is now enabled
*/
vfunc_action_enabled_changed(action_name: string, enabled: boolean): void;
/**
* Emits the [signal`Gio`.ActionGroup::action-removed] signal on `action_group`.
*
* This function should only be called by [type`Gio`.ActionGroup] implementations.
* @param action_name the name of an action in the group
*/
vfunc_action_removed(action_name: string): void;
/**
* Emits the [signal`Gio`.ActionGroup::action-state-changed] signal on `action_group`.
*
* This function should only be called by [type`Gio`.ActionGroup] implementations.
* @param action_name the name of an action in the group
* @param state the new state of the named action
*/
vfunc_action_state_changed(action_name: string, state: GLib.Variant): void;
/**
* Activate the named action within `action_group`.
*
* If the action is expecting a parameter, then the correct type of
* parameter must be given as `parameter`. If the action is expecting no
* parameters then `parameter` must be `NULL`. See
* [method`Gio`.ActionGroup.get_action_parameter_type].
*
* If the [type`Gio`.ActionGroup] implementation supports asynchronous remote
* activation over D-Bus, this call may return before the relevant
* D-Bus traffic has been sent, or any replies have been received. In
* order to block on such asynchronous activation calls,
* [method`Gio`.DBusConnection.flush] should be called prior to the code, which
* depends on the result of the action activation. Without flushing
* the D-Bus connection, there is no guarantee that the action would
* have been activated.
*
* The following code which runs in a remote app instance, shows an
* example of a ‘quit’ action being activated on the primary app
* instance over D-Bus. Here [method`Gio`.DBusConnection.flush] is called
* before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action
* may fail to be activated on the primary instance.
*
* ```c
* // call ‘quit’ action on primary instance
* g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL);
*
* // make sure the action is activated now
* g_dbus_connection_flush (…);
*
* g_debug ("Application has been terminated. Exiting.");
*
* exit (0);
* ```
* @param action_name the name of the action to activate
* @param parameter parameters to the activation
*/
vfunc_activate_action(action_name: string, parameter?: GLib.Variant | null): void;
/**
* Request for the state of the named action within `action_group` to be
* changed to `value`.
*
* The action must be stateful and `value` must be of the correct type.
* See [method`Gio`.ActionGroup.get_action_state_type].
*
* This call merely requests a change. The action may refuse to change
* its state or may change its state to something other than `value`.
* See [method`Gio`.ActionGroup.get_action_state_hint].
*
* If the `value` GVariant is floating, it is consumed.
* @param action_name the name of the action to request the change on
* @param value the new state
*/
vfunc_change_action_state(action_name: string, value: GLib.Variant): void;
/**
* Checks if the named action within `action_group` is currently enabled.
*
* An action must be enabled in order to be activated or in order to
* have its state changed from outside callers.
* @param action_name the name of the action to query
*/
vfunc_get_action_enabled(action_name: string): boolean;
/**
* Queries the type of the parameter that must be given when activating
* the named action within `action_group`.
*
* When activating the action using [method`Gio`.ActionGroup.activate_action],
* the [type`GLib`.Variant] given to that function must be of the type returned
* by this function.
*
* In the case that this function returns `NULL`, you must not give any
* [type`GLib`.Variant], but `NULL` instead.
*
* The parameter type of a particular action will never change but it is
* possible for an action to be removed and for a new action to be added
* with the same name but a different parameter type.
* @param action_name the name of the action to query
*/
vfunc_get_action_parameter_type(action_name: string): GLib.VariantType | null;
/**
* Queries the current state of the named action within `action_group`.
*
* If the action is not stateful then `NULL` will be returned. If the
* action is stateful then the type of the return value is the type
* given by [method`Gio`.ActionGroup.get_action_state_type].
*
* The return value (if non-`NULL`) should be freed with
* [method`GLib`.Variant.unref] when it is no longer required.
* @param action_name the name of the action to query
*/
vfunc_get_action_state(action_name: string): GLib.Variant | null;
/**
* Requests a hint about the valid range of values for the state of the
* named action within `action_group`.
*
* If `NULL` is returned it either means that the action is not stateful
* or that there is no hint about the valid range of values for the
* state of the action.
*
* If a [type`GLib`.Variant] array is returned then each item in the array is a
* possible value for the state. If a [type`GLib`.Variant] pair (ie: two-tuple) is
* returned then the tuple specifies the inclusive lower and upper bound
* of valid values for the state.
*
* In any case, the information is merely a hint. It may be possible to
* have a state value outside of the hinted range and setting a value
* within the range may fail.
*
* The return value (if non-`NULL`) should be freed with
* [method`GLib`.Variant.unref] when it is no longer required.
* @param action_name the name of the action to query
*/
vfunc_get_action_state_hint(action_name: string): GLib.Variant | null;
/**
* Queries the type of the state of the named action within
* `action_group`.
*
* If the action is stateful then this function returns the
* [type`GLib`.VariantType] of the state. All calls to
* [method`Gio`.ActionGroup.change_action_state] must give a [type`GLib`.Variant] of this
* type and [method`Gio`.ActionGroup.get_action_state] will return a [type`GLib`.Variant]
* of the same type.
*
* If the action is not stateful then this function will return `NULL`.
* In that case, [method`Gio`.ActionGroup.get_action_state] will return `NULL`
* and you must not call [method`Gio`.ActionGroup.change_action_state].
*
* The state type of a particular action will never change but it is
* possible for an action to be removed and for a new action to be added
* with the same name but a different state type.
* @param action_name the name of the action to query
*/
vfunc_get_action_state_type(action_name: string): GLib.VariantType | null;
/**
* Checks if the named action exists within `action_group`.
* @param action_name the name of the action to check for
*/
vfunc_has_action(action_name: string): boolean;
/**
* Lists the actions contained within `action_group`.
*
* The caller is responsible for freeing the list with [func`GLib`.strfreev] when
* it is no longer required.
*/
vfunc_list_actions(): string[];
/**
* Queries all aspects of the named action within an `action_group`.
*
* This function acquires the information available from
* [method`Gio`.ActionGroup.has_action], [method`Gio`.ActionGroup.get_action_enabled],
* [method`Gio`.ActionGroup.get_action_parameter_type],
* [method`Gio`.ActionGroup.get_action_state_type],
* [method`Gio`.ActionGroup.get_action_state_hint] and
* [method`Gio`.ActionGroup.get_action_state] with a single function call.
*
* This provides two main benefits.
*
* The first is the improvement in efficiency that comes with not having
* to perform repeated lookups of the action in order to discover
* different things about it. The second is that implementing
* [type`Gio`.ActionGroup] can now be done by only overriding this one virtual
* function.
*
* The interface provides a default implementation of this function that
* calls the individual functions, as required, to fetch the
* information. The interface also provides default implementations of
* those functions that call this function. All implementations,
* therefore, must override either this function or all of the others.
*
* If the action exists, `TRUE` is returned and any of the requested
* fields (as indicated by having a non-`NULL` reference passed in) are
* filled. If the action doesn’t exist, `FALSE` is returned and the
* fields may or may not have been modified.
* @param action_name the name of an action in the group
*/
vfunc_query_action(
action_name: string,
): [
boolean,
boolean,
GLib.VariantType | null,
GLib.VariantType | null,
GLib.Variant | null,
GLib.Variant | null,
];
/**
* Adds an action to the `action_map`.
*
* If the action map already contains an action with the same name
* as `action` then the old action is dropped from the action map.
*
* The action map takes its own reference on `action`.
* @param action a [iface@Gio.Action]
*/
add_action(action: Gio.Action): void;
/**
* A convenience function for creating multiple simple actions.
* See Gio.ActionEntryObj for the structure of the action entry.
* @param entries Array of action entries to add
*/
add_action_entries(entries: Gio.ActionEntryObj[]): void;
/**
* Looks up the action with the name `action_name` in `action_map`.
*
* If no such action exists, returns `NULL`.
* @param action_name the name of an action
* @returns a [iface@Gio.Action]
*/
lookup_action(action_name: string): Gio.Action | null;
/**
* Removes the named action from the action map.
*
* If no action of this name is in the map then nothing happens.
* @param action_name the name of the action
*/
remove_action(action_name: string): void;
/**
* Remove actions from a [iface`Gio`.ActionMap]. This is meant as the reverse of
* [method`Gio`.ActionMap.add_action_entries].
*
*
* ```c
* static const GActionEntry entries[] = {
* { "quit", activate_quit },
* { "print-string", activate_print_string, "s" }
* };
*
* void
* add_actions (GActionMap *map)
* {
* g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL);
* }
*
* void
* remove_actions (GActionMap *map)
* {
* g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries));
* }
* ```
* @param entries a pointer to the first item in an array of [struct@Gio.ActionEntry] structs
*/
remove_action_entries(entries: Gio.ActionEntry[]): void;
/**
* Adds an action to the `action_map`.
*
* If the action map already contains an action with the same name
* as `action` then the old action is dropped from the action map.
*
* The action map takes its own reference on `action`.
* @param action a [iface@Gio.Action]
*/
vfunc_add_action(action: Gio.Action): void;
/**
* Looks up the action with the name `action_name` in `action_map`.
*
* If no such action exists, returns `NULL`.
* @param action_name the name of an action
*/
vfunc_lookup_action(action_name: string): Gio.Action | null;
/**
* Removes the named action from the action map.
*
* If no action of this name is in the map then nothing happens.
* @param action_name the name of the action
*/
vfunc_remove_action(action_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 Avatar {
// Constructor properties interface
interface ConstructorProps
extends Gtk.DrawingArea.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
icon_name: string;
iconName: string;
loadable_icon: Gio.LoadableIcon;
loadableIcon: Gio.LoadableIcon;
show_initials: boolean;
showInitials: boolean;
size: number;
text: string;
}
}
/**
* A widget displaying an image, with a generated fallback.
*
* `HdyAvatar` is a widget to display a round avatar.
*
* A provided image is made round before displaying, if no image is given this
* widget generates a round fallback with the initials of the
* [property`Avatar:`text] on top of a colored background.
*
* The color is picked based on the hash of the [property`Avatar:`text].
*
* If [property`Avatar:`show-initials] is set to `FALSE`,
* `avatar-default-symbolic` is shown instead of the initials.
*
* Use [method`Avatar`.set_loadable_icon] or [property`Avatar:`loadable-icon] to
* set a custom image.
*
* ## CSS nodes
*
* `HdyAvatar` has a single CSS node with name `avatar`.
*/
class Avatar extends Gtk.DrawingArea implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The name of an icon to use as a fallback.
*
* If no name is set, the avatar-default-symbolic icon will be used. If the
* name doesn't match a valid icon, it is an error and no icon will be
* displayed. If the icon theme is changed, the image will be updated
* automatically.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The name of an icon to use as a fallback.
*
* If no name is set, the avatar-default-symbolic icon will be used. If the
* name doesn't match a valid icon, it is an error and no icon will be
* displayed. If the icon theme is changed, the image will be updated
* automatically.
*/
get iconName(): string;
set iconName(val: string);
/**
* A [iface`Gio`.LoadableIcon] used to load the avatar.
*/
get loadable_icon(): Gio.LoadableIcon;
set loadable_icon(val: Gio.LoadableIcon);
/**
* A [iface`Gio`.LoadableIcon] used to load the avatar.
*/
get loadableIcon(): Gio.LoadableIcon;
set loadableIcon(val: Gio.LoadableIcon);
/**
* Whether to show the initials or the fallback icon on the generated avatar.
*/
get show_initials(): boolean;
set show_initials(val: boolean);
/**
* Whether to show the initials or the fallback icon on the generated avatar.
*/
get showInitials(): boolean;
set showInitials(val: boolean);
/**
* The avatar size of the avatar.
*/
get size(): number;
set size(val: number);
/**
* Sets the text used to generate the fallback initials and color.
*
* It's only used to generate the color if [property`Avatar:`show-initials] is
* `FALSE`.
*/
get text(): string;
set text(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](size: number, text: string | null, show_initials: boolean): Avatar;
// Conflicted with Gtk.DrawingArea.new
static ['new'](...args: never[]): any;
// Methods
/**
* Renders `self` into a [class`GdkPixbuf`.Pixbuf] at `size` and `scale_factor`.
*
* This can be used to export the fallback avatar.
* @param size the size of the pixbuf
* @param scale_factor the scale factor
* @returns the pixbuf
*/
draw_to_pixbuf(size: number, scale_factor: number): GdkPixbuf.Pixbuf;
/**
* Renders asynchronously `self` into a pixbuf at `size` and `scale_factor`.
*
* This can be used to export the fallback avatar.
* @param size the size of the pixbuf
* @param scale_factor the scale factor
* @param cancellable a cancellable
*/
draw_to_pixbuf_async(
size: number,
scale_factor: number,
cancellable?: Gio.Cancellable | null,
): Promise;
/**
* Renders asynchronously `self` into a pixbuf at `size` and `scale_factor`.
*
* This can be used to export the fallback avatar.
* @param size the size of the pixbuf
* @param scale_factor the scale factor
* @param cancellable a cancellable
* @param callback a [callback@Gio.AsyncReadyCallback] to call when the avatar is generated
*/
draw_to_pixbuf_async(
size: number,
scale_factor: number,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Renders asynchronously `self` into a pixbuf at `size` and `scale_factor`.
*
* This can be used to export the fallback avatar.
* @param size the size of the pixbuf
* @param scale_factor the scale factor
* @param cancellable a cancellable
* @param callback a [callback@Gio.AsyncReadyCallback] to call when the avatar is generated
*/
draw_to_pixbuf_async(
size: number,
scale_factor: number,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes an asynchronous draw of an avatar to a pixbuf.
* @param async_result a [iface@Gio.AsyncResult]
* @returns the resulting pixbuf
*/
draw_to_pixbuf_finish(async_result: Gio.AsyncResult): GdkPixbuf.Pixbuf;
/**
* Gets the name of an icon to use as a fallback.
* @returns the icon name
*/
get_icon_name(): string | null;
/**
* Gets the [iface`Gio`.LoadableIcon] set via [method`Avatar`.set_loadable_icon].
* @returns the [iface@Gio.LoadableIcon]
*/
get_loadable_icon(): Gio.LoadableIcon | null;
/**
* Gets whether initials are used instead of an icon on the fallback avatar.
* @returns whether initials are used instead of an icon as fallback
*/
get_show_initials(): boolean;
/**
* Gets the size of the avatar.
* @returns the size of the avatar
*/
get_size(): number;
/**
* Gets the text used to generate the fallback initials and color.
* @returns the text used to generate the fallback initials and color
*/
get_text(): string | null;
/**
* Sets the name of an icon to use as a fallback.
*
* If no name is set, `avatar-default-symbolic` will be used.
* @param icon_name the name of the icon from the icon theme
*/
set_icon_name(icon_name?: string | null): void;
/**
* A callback which is called when the custom image needs to be reloaded.
*
* It will be called on [property`Avatar:`size] or
* [property`Gtk`.Widget:scale-factor] changes.
* @param load_image callback to set a custom image
* @param destroy destroy notifier for @user_data
*/
set_image_load_func(load_image?: AvatarImageLoadFunc | null, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the [iface`Gio`.LoadableIcon] to use as an avatar.
*
* The previous avatar is displayed till the new avatar is loaded, to
* immediately remove the custom avatar set the loadable-icon to `NULL`.
*
* The [iface`Gio`.LoadableIcon] set via this function is preferred over a set
* [callback`AvatarImageLoadFunc]`.
* @param icon a [iface@Gio.LoadableIcon]
*/
set_loadable_icon(icon?: Gio.LoadableIcon | null): void;
/**
* Sets whether to use initials instead of an icon on the fallback avatar.
* @param show_initials whether to use initials instead of an icon as fallback
*/
set_show_initials(show_initials: boolean): void;
/**
* Sets the size of the avatar.
* @param size the size to be used for the avatar
*/
set_size(size: number): void;
/**
* Set the text used to generate the fallback initials color.
* @param text the text used to get the initials and color
*/
set_text(text?: string | 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 Carousel {
// Signal callback interfaces
interface PageChanged {
(index: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.EventBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps,
Swipeable.ConstructorProps {
allow_long_swipes: boolean;
allowLongSwipes: boolean;
allow_mouse_drag: boolean;
allowMouseDrag: boolean;
allow_scroll_wheel: boolean;
allowScrollWheel: boolean;
animation_duration: number;
animationDuration: number;
interactive: boolean;
n_pages: number;
nPages: number;
position: number;
reveal_duration: number;
revealDuration: number;
spacing: number;
}
}
/**
* A paginated scrolling widget.
*
* The `HdyCarousel` widget can be used to display a set of pages with
* swipe-based navigation between them.
*
* [class`CarouselIndicatorDots]` and [class`CarouselIndicatorLines]` can be used
* to provide page indicators for `HdyCarousel`.
*
* ## CSS nodes
*
* `HdyCarousel` has a single CSS node with name `carousel`.
*/
class Carousel extends Gtk.EventBox implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable, Swipeable {
static $gtype: GObject.GType;
// Properties
/**
* Whether to allow swiping for more than one page at a time.
*
* If the value is `FALSE`, each swipe can only move to the adjacent pages.
*/
get allow_long_swipes(): boolean;
set allow_long_swipes(val: boolean);
/**
* Whether to allow swiping for more than one page at a time.
*
* If the value is `FALSE`, each swipe can only move to the adjacent pages.
*/
get allowLongSwipes(): boolean;
set allowLongSwipes(val: boolean);
/**
* Sets whether the [class`Carousel]` can be dragged with mouse pointer.
*
* If the value is `FALSE`, dragging is only available on touch.
*/
get allow_mouse_drag(): boolean;
set allow_mouse_drag(val: boolean);
/**
* Sets whether the [class`Carousel]` can be dragged with mouse pointer.
*
* If the value is `FALSE`, dragging is only available on touch.
*/
get allowMouseDrag(): boolean;
set allowMouseDrag(val: boolean);
/**
* Whether the widget will respond to scroll wheel events.
*
* If the value is `FALSE`, wheel events will be ignored.
*/
get allow_scroll_wheel(): boolean;
set allow_scroll_wheel(val: boolean);
/**
* Whether the widget will respond to scroll wheel events.
*
* If the value is `FALSE`, wheel events will be ignored.
*/
get allowScrollWheel(): boolean;
set allowScrollWheel(val: boolean);
/**
* Animation duration used by [method`Carousel`.scroll_to], in milliseconds.
*/
get animation_duration(): number;
set animation_duration(val: number);
/**
* Animation duration used by [method`Carousel`.scroll_to], in milliseconds.
*/
get animationDuration(): number;
set animationDuration(val: number);
/**
* Whether the carousel can be navigated.
*
* This can be used to temporarily disable a `HdyCarousel` to only allow
* navigating it in a certain state.
*/
get interactive(): boolean;
set interactive(val: boolean);
/**
* The number of pages in a [class`Carousel]`.
*/
get n_pages(): number;
/**
* The number of pages in a [class`Carousel]`.
*/
get nPages(): number;
/**
* Current scrolling position, unitless.
*
* 1 matches 1 page. Use [method`Carousel`.scroll_to] for changing it.
*/
get position(): number;
/**
* Page reveal duration, in milliseconds.
*/
get reveal_duration(): number;
set reveal_duration(val: number);
/**
* Page reveal duration, in milliseconds.
*/
get revealDuration(): number;
set revealDuration(val: number);
/**
* Spacing between pages in pixels.
*/
get spacing(): number;
set spacing(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Carousel;
// 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: 'page-changed', callback: (_source: this, index: number) => void): number;
connect_after(signal: 'page-changed', callback: (_source: this, index: number) => void): number;
emit(signal: 'page-changed', index: number): void;
// Methods
/**
* Gets whether to allow swiping for more than one page at a time.
* @returns `TRUE` if long swipes are allowed
*/
get_allow_long_swipes(): boolean;
/**
* Sets whether `self` can be dragged with mouse pointer.
* @returns `TRUE` if @self can be dragged with mouse
*/
get_allow_mouse_drag(): boolean;
/**
* Gets whether `self` will respond to scroll wheel events.
* @returns `TRUE` if @self will respond to scroll wheel events
*/
get_allow_scroll_wheel(): boolean;
/**
* Gets animation duration used by [method`Carousel`.scroll_to].
* @returns animation duration, in milliseconds
*/
get_animation_duration(): number;
/**
* Gets whether `self` can be navigated.
* @returns `TRUE` if @self can be swiped
*/
get_interactive(): boolean;
/**
* Gets the number of pages in `self`.
* @returns the number of pages in @self
*/
get_n_pages(): number;
/**
* Gets current scroll position in `self`. It's unitless, 1 matches 1 page.
* @returns the scroll position
*/
get_position(): number;
/**
* Gets duration of the animation used when adding or removing pages, in
* milliseconds.
* @returns the duration
*/
get_reveal_duration(): number;
/**
* Gets spacing between pages in pixels.
* @returns spacing between pages
*/
get_spacing(): number;
/**
* Inserts `child` into `self` at position `position`.
*
* If position is -1, or larger than the number of pages, `child` will be
* appended to the end.
* @param child a widget to add
* @param position the position to insert @child in
*/
insert(child: Gtk.Widget, position: number): void;
/**
* Prepends `child` to `self`.
* @param child a widget to add
*/
prepend(child: Gtk.Widget): void;
/**
* Moves `child` into position `position`.
*
* If position is -1, or larger than the number of pages, `child` will be moved
* to the end.
* @param child a widget to add
* @param position the position to move @child to
*/
reorder(child: Gtk.Widget, position: number): void;
/**
* Scrolls to `widget` position with an animation.
*
* [property`Carousel:`animation-duration] property can be used for controlling
* the duration.
* @param widget a child of @self
*/
scroll_to(widget: Gtk.Widget): void;
/**
* Scrolls to `widget` position with an animation.
* @param widget a child of @self
* @param duration animation duration, in milliseconds
*/
scroll_to_full(widget: Gtk.Widget, duration: number): void;
/**
* Sets whether to allow swiping for more than one page at a time.
* @param allow_long_swipes whether to allow long swipes
*/
set_allow_long_swipes(allow_long_swipes: boolean): void;
/**
* Sets whether `self` can be dragged with mouse pointer.
*
* If `allow_mouse_drag` is `FALSE`, dragging is only available on touch.
* @param allow_mouse_drag whether @self can be dragged with mouse pointer
*/
set_allow_mouse_drag(allow_mouse_drag: boolean): void;
/**
* Sets whether `self` will respond to scroll wheel events.
* @param allow_scroll_wheel whether @self will respond to scroll wheel events
*/
set_allow_scroll_wheel(allow_scroll_wheel: boolean): void;
/**
* Sets animation duration used by [method`Carousel`.scroll_to].
* @param duration animation duration, in milliseconds
*/
set_animation_duration(duration: number): void;
/**
* Sets whether `self` can be navigated.
*
* This can be used to temporarily disable a [class`Carousel]` to only allow
* swiping in a certain state.
* @param interactive whether @self can be swiped
*/
set_interactive(interactive: boolean): void;
/**
* Sets duration of the animation used when adding or removing pages, in
* milliseconds.
* @param reveal_duration the new reveal duration value
*/
set_reveal_duration(reveal_duration: number): void;
/**
* Sets spacing between pages in pixels.
* @param spacing the new spacing value
*/
set_spacing(spacing: number): void;
// 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;
/**
* Emits [signal`Swipeable:`:child-switched] signal.
*
* This should be called when the widget switches visible child widget.
*
* `duration` can be 0 if the child is switched without animation.
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
emit_child_switched(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
* @returns the cancel progress, unitless
*/
get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
* @returns the swipe distance in pixels
*/
get_distance(): number;
/**
* Gets the current progress of `self`.
* @returns the current progress, unitless
*/
get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
* @returns the snap points
*/
get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
get_swipe_area(navigation_direction: NavigationDirection | null, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
* @returns the swipe tracker
*/
get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
switch_child(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
*/
vfunc_get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
*/
vfunc_get_distance(): number;
/**
* Gets the current progress of `self`.
*/
vfunc_get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
*/
vfunc_get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
vfunc_get_swipe_area(navigation_direction: NavigationDirection, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
*/
vfunc_get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
vfunc_switch_child(index: number, duration: 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;
// 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 CarouselIndicatorDots {
// Constructor properties interface
interface ConstructorProps
extends Gtk.DrawingArea.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
carousel: Carousel;
}
}
/**
* A dots indicator for [class`Carousel]`.
*
* The `HdyCarouselIndicatorDots` widget shows a set of dots for each page of a
* given [class`Carousel]`. The dot representing the carousel's active page is
* larger and more opaque than the others, the transition to the active and
* inactive state is gradual to match the carousel's position.
*
* See also [class`CarouselIndicatorLines]`.
*
* ## CSS nodes
*
* `HdyCarouselIndicatorDots` has a single CSS node with name
* `carouselindicatordots`.
*/
class CarouselIndicatorDots
extends Gtk.DrawingArea
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable
{
static $gtype: GObject.GType;
// Properties
/**
* The [class`Carousel]` the indicator uses.
*/
get carousel(): Carousel;
set carousel(val: Carousel);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CarouselIndicatorDots;
// Methods
/**
* Get the [class`Carousel]` the indicator uses.
* @returns the [class@Carousel]
*/
get_carousel(): Carousel | null;
/**
* Sets the [class`Carousel]` to use.
* @param carousel a carousel
*/
set_carousel(carousel?: Carousel | 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 CarouselIndicatorLines {
// Constructor properties interface
interface ConstructorProps
extends Gtk.DrawingArea.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
carousel: Carousel;
}
}
/**
* A lines indicator for [class`Carousel]`.
*
* The `HdyCarouselIndicatorLines` widget shows a set of lines for each page of
* a given [class`Carousel]`. The carousel's active page is shown as another line
* that moves between them to match the carousel's position.
*
* See also [class`CarouselIndicatorDots]`.
*
* ## CSS nodes
*
* `HdyCarouselIndicatorLines` has a single CSS node with name
* `carouselindicatorlines`.
*/
class CarouselIndicatorLines
extends Gtk.DrawingArea
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable
{
static $gtype: GObject.GType;
// Properties
/**
* The displayed carousel.
*/
get carousel(): Carousel;
set carousel(val: Carousel);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CarouselIndicatorLines;
// Methods
/**
* Gets the displayed carousel.
* @returns the displayed carousel
*/
get_carousel(): Carousel | null;
/**
* Sets the [class`Carousel]` to use.
* @param carousel a carousel
*/
set_carousel(carousel?: Carousel | 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 Clamp {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
maximum_size: number;
maximumSize: number;
tightening_threshold: number;
tighteningThreshold: number;
}
}
/**
* A widget constraining its child to a given size.
*
* The `HdyClamp` widget constrains the size of the widget it contains to a
* given maximum size. It will constrain the width if it is horizontal, or the
* height if it is vertical. The expansion of the child from its minimum to its
* maximum size is eased out for a smooth transition.
*
* If the child requires more than the requested maximum size, it will be
* allocated the minimum size it can fit in instead.
*
* ## CSS nodes
*
* `HdyClamp` has a single CSS node with name `clamp`.
*
* The node will get the style classes `.large` when its child reached its
* maximum size, `.small` when the clamp allocates its full size to its child,
* `.medium` in-between, or none if it didn't compute its size yet.
*/
class Clamp extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* The maximum size to allocate the children.
*
* It is the width if the clamp is horizontal, or the height if it is
* vertical.
*/
get maximum_size(): number;
set maximum_size(val: number);
/**
* The maximum size to allocate the children.
*
* It is the width if the clamp is horizontal, or the height if it is
* vertical.
*/
get maximumSize(): number;
set maximumSize(val: number);
/**
* The size above which the child is clamped.
*
* Starting from this size, the layout will tighten its grip on the children,
* slowly allocating less and less of the available size up to the maximum
* allocated size. Below that threshold and below the maximum size, the
* children will be allocated all the available size.
*
* If the threshold is greater than the maximum size to allocate to the
* children, they will be allocated the whole size up to the maximum. If the
* threshold is lower than the minimum size to allocate to the children, that
* size will be used as the tightening threshold.
*
* Effectively, tightening the grip on a child before it reaches its maximum
* size makes transitions to and from the maximum size smoother when resizing.
*/
get tightening_threshold(): number;
set tightening_threshold(val: number);
/**
* The size above which the child is clamped.
*
* Starting from this size, the layout will tighten its grip on the children,
* slowly allocating less and less of the available size up to the maximum
* allocated size. Below that threshold and below the maximum size, the
* children will be allocated all the available size.
*
* If the threshold is greater than the maximum size to allocate to the
* children, they will be allocated the whole size up to the maximum. If the
* threshold is lower than the minimum size to allocate to the children, that
* size will be used as the tightening threshold.
*
* Effectively, tightening the grip on a child before it reaches its maximum
* size makes transitions to and from the maximum size smoother when resizing.
*/
get tighteningThreshold(): number;
set tighteningThreshold(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Clamp;
// Methods
/**
* Gets the maximum size allocated to the children.
* @returns the maximum size to allocate to the children
*/
get_maximum_size(): number;
/**
* Gets the size above which the children are clamped.
* @returns the size above which the children are clamped
*/
get_tightening_threshold(): number;
/**
* Sets the maximum size allocated to the children.
* @param maximum_size the maximum size
*/
set_maximum_size(maximum_size: number): void;
/**
* Sets the size above which the children are clamped.
* @param tightening_threshold the tightening threshold
*/
set_tightening_threshold(tightening_threshold: 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 ComboRow {
// Constructor properties interface
interface ConstructorProps
extends ActionRow.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Actionable.ConstructorProps,
Gtk.Buildable.ConstructorProps {
selected_index: number;
selectedIndex: number;
use_subtitle: boolean;
useSubtitle: boolean;
}
}
/**
* A [class`Gtk`.ListBoxRow] used to choose from a list of items.
*
* The `HdyComboRow` widget allows the user to choose from a list of valid
* choices. The row displays the selected choice. When activated, the row
* displays a popover which allows the user to make a new choice.
*
* The [class`ComboRow]` uses the model-view pattern; the list of valid choices
* is specified in the form of a [iface`Gio`.ListModel], and the display of the
* choices can be adapted to the data in the model via widget creation
* functions.
*
* `HdyComboRow` is [property`Gtk`.ListBoxRow:activatable] if a model is set.
*
* ## CSS nodes
*
* `HdyComboRow` has a main CSS node with name `row`.
*
* Its popover has the node name popover with the `.combo` style class, it
* contains a [class`Gtk`.ScrolledWindow], which in turn contains a
* [class`Gtk`.ListBox], both are accessible via their regular nodes.
*
* A checkmark of node and style class `image.checkmark` in the popover denotes
* the current item.
*/
class ComboRow extends ActionRow implements Atk.ImplementorIface, Gtk.Actionable, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The index of the selected item in its [iface`Gio`.ListModel].
*/
get selected_index(): number;
set selected_index(val: number);
/**
* The index of the selected item in its [iface`Gio`.ListModel].
*/
get selectedIndex(): number;
set selectedIndex(val: number);
/**
* Whether to use the current value as the subtitle.
*
* If you use a custom widget creation function, you will need to give the row
* a name conversion closure with [method`ComboRow`.set_get_name_func].
*
* If `TRUE`, you should not access [property`ActionRow:`subtitle].
*/
get use_subtitle(): boolean;
set use_subtitle(val: boolean);
/**
* Whether to use the current value as the subtitle.
*
* If you use a custom widget creation function, you will need to give the row
* a name conversion closure with [method`ComboRow`.set_get_name_func].
*
* If `TRUE`, you should not access [property`ActionRow:`subtitle].
*/
get useSubtitle(): boolean;
set useSubtitle(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ComboRow;
// Methods
/**
* Binds `model` to `self`.
*
* If `self` was already bound to a model, that previous binding is destroyed.
*
* The contents of `self` are cleared and then filled with widgets that represent
* items from `model`. `self` is updated whenever `model` changes. If `model` is
* `NULL`, `self` is left empty.
* @param model the [iface@Gio.ListModel] to be bound to @self
* @param create_list_widget_func a function that creates widgets for items to display in the list, or `NULL` in case you also passed `NULL` as @model
* @param create_current_widget_func a function that creates widgets for items to display as the selected item, or `NULL` in case you also passed `NULL` as @model
*/
bind_model(
model?: Gio.ListModel | null,
create_list_widget_func?: Gtk.ListBoxCreateWidgetFunc | null,
create_current_widget_func?: Gtk.ListBoxCreateWidgetFunc | null,
): void;
/**
* Binds `model` to `self`.
*
* If `self` was already bound to a model, that previous binding is destroyed.
*
* The contents of `self` are cleared and then filled with widgets that represent
* items from `model`. `self` is updated whenever `model` changes. If `model` is
* `NULL`, `self` is left empty.
*
* This is more convenient to use than [method`ComboRow`.bind_model] if you want
* to represent items of the model with names.
* @param model the [iface@Gio.ListModel] to be bound to @self
* @param get_name_func a function that creates names for items, or `NULL` in case you also passed `NULL` as @model
*/
bind_name_model(model?: Gio.ListModel | null, get_name_func?: ComboRowGetNameFunc | null): void;
/**
* Gets the model bound to `self`.
* @returns the [iface@Gio.ListModel] bound to @self
*/
get_model(): Gio.ListModel | null;
/**
* Gets the index of the selected item in its [iface`Gio`.ListModel].
* @returns the index of the selected item, or -1 if no item is selected
*/
get_selected_index(): number;
/**
* Gets whether the current value of `self` should be displayed as its subtitle.
* @returns whether the current value of @self should be displayed as its subtitle
*/
get_use_subtitle(): boolean;
/**
* Creates a model for `enum_type` and binds it to `self`.
*
* The items of the model will be [class`EnumValueObject]` objects.
*
* If `self` was already bound to a model, that previous binding is destroyed.
*
* The contents of `self` are cleared and then filled with widgets that represent
* items from `model`. `self` is updated whenever `model` changes. If `model` is
* `NULL`, `self` is left empty.
*
* This is more convenient to use than [method`ComboRow`.bind_name_model] if you
* want to represent values of an enumeration with names.
*
* See [func`enum_value_row_name]`.
* @param enum_type the enumeration [alias@GLib.Type] to be bound to @self
* @param get_name_func a function that creates names for items, or `NULL` in case you also passed `NULL` as @model
*/
set_for_enum(enum_type: GObject.GType, get_name_func?: ComboRowGetEnumValueNameFunc | null): void;
/**
* Sets a closure to convert items into names.
*
* See [property`ComboRow:`use-subtitle].
* @param get_name_func a function that creates names for items, or `NULL` in case you also passed `NULL` as @model
*/
set_get_name_func(get_name_func?: ComboRowGetNameFunc | null): void;
/**
* Sets the index of the selected item in its [iface`Gio`.ListModel].
* @param selected_index the index of the selected item
*/
set_selected_index(selected_index: number): void;
/**
* Sets whether the current value of `self` should be displayed as its subtitle.
*
* If `TRUE`, you should not access [property`ActionRow:`subtitle].
* @param use_subtitle `TRUE` to set the current value as the subtitle
*/
set_use_subtitle(use_subtitle: 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;
// Conflicted with Handy.ActionRow.activate
activate(...args: never[]): any;
/**
* 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 Deck {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps,
Swipeable.ConstructorProps {
can_swipe_back: boolean;
canSwipeBack: boolean;
can_swipe_forward: boolean;
canSwipeForward: boolean;
hhomogeneous: boolean;
interpolate_size: boolean;
interpolateSize: boolean;
transition_duration: number;
transitionDuration: number;
transition_running: boolean;
transitionRunning: boolean;
transition_type: DeckTransitionType;
transitionType: DeckTransitionType;
vhomogeneous: boolean;
visible_child: Gtk.Widget;
visibleChild: Gtk.Widget;
visible_child_name: string;
visibleChildName: string;
}
}
/**
* A swipeable widget showing one of the visible children at a time.
*
* The `HdyDeck` widget displays one of the visible children, similar to a
* [class`Gtk`.Stack]. The children are strictly ordered and can be navigated
* using swipe gestures.
*
* The “over” and “under” stack the children one on top of the other, while the
* “slide” transition puts the children side by side. While navigating to a
* child on the side or below can be performed by swiping the current child
* away, navigating to an upper child requires dragging it from the edge where
* it resides. This doesn't affect non-dragging swipes.
*
* The “over” and “under” transitions can draw their shadow on top of the
* window's transparent areas, like the rounded corners. This is a side-effect
* of allowing shadows to be drawn on top of OpenGL areas. It can be mitigated
* by using [class`Window]` or [class`ApplicationWindow]` as they will crop
* anything drawn beyond the rounded corners.
*
* ## CSS nodes
*
* `HdyDeck` has a single CSS node with name `deck`.
*/
class Deck extends Gtk.Container implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable, Swipeable {
static $gtype: GObject.GType;
// Properties
/**
* Whether swipe gestures allow switching to the previous child.
*/
get can_swipe_back(): boolean;
set can_swipe_back(val: boolean);
/**
* Whether swipe gestures allow switching to the previous child.
*/
get canSwipeBack(): boolean;
set canSwipeBack(val: boolean);
/**
* Whether swipe gestures allow switching to the next child.
*/
get can_swipe_forward(): boolean;
set can_swipe_forward(val: boolean);
/**
* Whether swipe gestures allow switching to the next child.
*/
get canSwipeForward(): boolean;
set canSwipeForward(val: boolean);
/**
* Horizontally homogeneous sizing.
*/
get hhomogeneous(): boolean;
set hhomogeneous(val: boolean);
/**
* Whether or not the size should smoothly change when changing between
* differently sized children.
*/
get interpolate_size(): boolean;
set interpolate_size(val: boolean);
/**
* Whether or not the size should smoothly change when changing between
* differently sized children.
*/
get interpolateSize(): boolean;
set interpolateSize(val: boolean);
/**
* The transition animation duration, in milliseconds.
*/
get transition_duration(): number;
set transition_duration(val: number);
/**
* The transition animation duration, in milliseconds.
*/
get transitionDuration(): number;
set transitionDuration(val: number);
/**
* Whether or not the transition is currently running.
*/
get transition_running(): boolean;
/**
* Whether or not the transition is currently running.
*/
get transitionRunning(): boolean;
/**
* The type of animation that will be used for transitions between children.
*
* The transition type can be changed without problems at runtime, so it is
* possible to change the animation based on the child that is about to become
* current.
*/
get transition_type(): DeckTransitionType;
set transition_type(val: DeckTransitionType);
/**
* The type of animation that will be used for transitions between children.
*
* The transition type can be changed without problems at runtime, so it is
* possible to change the animation based on the child that is about to become
* current.
*/
get transitionType(): DeckTransitionType;
set transitionType(val: DeckTransitionType);
/**
* Vertically homogeneous sizing.
*/
get vhomogeneous(): boolean;
set vhomogeneous(val: boolean);
/**
* The widget currently visible.
*
* The transition is determined by [property`Deck:`transition-type] and
* [property`Deck:`transition-duration]. The transition can be cancelled by the
* user, in which case visible child will change back to the previously
* visible child.
*/
get visible_child(): Gtk.Widget;
set visible_child(val: Gtk.Widget);
/**
* The widget currently visible.
*
* The transition is determined by [property`Deck:`transition-type] and
* [property`Deck:`transition-duration]. The transition can be cancelled by the
* user, in which case visible child will change back to the previously
* visible child.
*/
get visibleChild(): Gtk.Widget;
set visibleChild(val: Gtk.Widget);
/**
* The name of the widget currently visible.
*/
get visible_child_name(): string;
set visible_child_name(val: string);
/**
* The name of the widget currently visible.
*/
get visibleChildName(): string;
set visibleChildName(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Deck;
// Methods
/**
* Finds the previous or next navigatable child.
*
* Gets the previous or next child. This will be the same widget
* [method`Deck`.navigate] will navigate to.
*
* If there's no child to navigate to, `NULL` will be returned instead.
* @param direction the direction
* @returns the previous or next child
*/
get_adjacent_child(direction: NavigationDirection | null): Gtk.Widget | null;
/**
* Gets whether swipe gestures for navigating backward are enabled.
* @returns Whether swipe gestures are enabled.
*/
get_can_swipe_back(): boolean;
/**
* Gets whether swipe gestures for navigating forward enabled.
* @returns Whether swipe gestures are enabled.
*/
get_can_swipe_forward(): boolean;
/**
* Finds the child of `self` with `name`.
*
* Returns `NULL` if there is no child with this name.
* @param name the name of the child to find
* @returns the requested child of @self
*/
get_child_by_name(name: string): Gtk.Widget | null;
/**
* Gets whether `self` is homogeneous for the given orientation.
* @param orientation the orientation
* @returns whether @self is homogeneous for the given orientation
*/
get_homogeneous(orientation: Gtk.Orientation | null): boolean;
/**
* Gets whether `self` will interpolate its size when changing the visible child.
* @returns whether child sizes are interpolated
*/
get_interpolate_size(): boolean;
/**
* Gets the mode transition animation duration for `self`.
* @returns the mode transition duration, in milliseconds.
*/
get_transition_duration(): number;
/**
* Gets whether a transition is currently running for `self`.
* @returns whether a transition is currently running
*/
get_transition_running(): boolean;
/**
* Gets the type of animation used for transitions between children.
* @returns the current transition type of @self
*/
get_transition_type(): DeckTransitionType;
/**
* Gets the visible child widget.
* @returns the visible child widget
*/
get_visible_child(): Gtk.Widget;
/**
* Gets the name of the currently visible child widget.
* @returns the name of the visible child
*/
get_visible_child_name(): string;
/**
* Inserts `child` in the position after `sibling` in the list of children.
*
* If `sibling` is `NULL`, inserts `child` at the first position.
* @param child the widget to insert
* @param sibling the sibling after which to insert @child
*/
insert_child_after(child: Gtk.Widget, sibling?: Gtk.Widget | null): void;
/**
* Navigates to the previous or next child.
*
* The switch is similar to performing a swipe gesture to go in `direction`.
* @param direction the direction
* @returns whether the visible child was changed
*/
navigate(direction: NavigationDirection | null): boolean;
/**
* Inserts `child` at the first position in `self`.
* @param child the widget to prepend
*/
prepend(child: Gtk.Widget): void;
/**
* Moves `child` to the position after `sibling` in the list of children.
*
* If `sibling` is `NULL`, move `child` to the first position.
* @param child the widget to move, must be a child of @self
* @param sibling the sibling to move @child after
*/
reorder_child_after(child: Gtk.Widget, sibling?: Gtk.Widget | null): void;
/**
* Sets whether swipe gestures for navigating backward are enabled.
* @param can_swipe_back the new value
*/
set_can_swipe_back(can_swipe_back: boolean): void;
/**
* Sets whether swipe gestures for navigating forward are enabled.
* @param can_swipe_forward the new value
*/
set_can_swipe_forward(can_swipe_forward: boolean): void;
/**
* Sets whether `self` is homogeneous for a given orientation.
*
* If set to `FALSE`, different children can have different size along the
* opposite orientation.
* @param orientation the orientation
* @param homogeneous `TRUE` to make @self homogeneous
*/
set_homogeneous(orientation: Gtk.Orientation | null, homogeneous: boolean): void;
/**
* Sets whether `self` will interpolate its size when changing the visible child.
*
* `self` will interpolate its size between the current one and the one it'll
* take after changing the visible child, according to the set transition
* duration.
* @param interpolate_size the new value
*/
set_interpolate_size(interpolate_size: boolean): void;
/**
* Sets the mode transition animation duration for `self`.
* @param duration the new duration, in milliseconds
*/
set_transition_duration(duration: number): void;
/**
* Sets the type of animation used for transitions between children.
*
* The transition type can be changed without problems at runtime, so it is
* possible to change the animation based on the child that is about to become
* current.
* @param transition the new transition type
*/
set_transition_type(transition: DeckTransitionType | null): void;
/**
* Sets the currently visible widget.
* @param visible_child the new child
*/
set_visible_child(visible_child: Gtk.Widget): void;
/**
* Makes the child with the name `name` visible.
*
* See [method`Deck`.set_visible_child] for more details.
* @param name the name of a child
*/
set_visible_child_name(name: string): void;
// 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;
/**
* Emits [signal`Swipeable:`:child-switched] signal.
*
* This should be called when the widget switches visible child widget.
*
* `duration` can be 0 if the child is switched without animation.
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
emit_child_switched(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
* @returns the cancel progress, unitless
*/
get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
* @returns the swipe distance in pixels
*/
get_distance(): number;
/**
* Gets the current progress of `self`.
* @returns the current progress, unitless
*/
get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
* @returns the snap points
*/
get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
get_swipe_area(navigation_direction: NavigationDirection | null, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
* @returns the swipe tracker
*/
get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
switch_child(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
*/
vfunc_get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
*/
vfunc_get_distance(): number;
/**
* Gets the current progress of `self`.
*/
vfunc_get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
*/
vfunc_get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
vfunc_get_swipe_area(navigation_direction: NavigationDirection, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
*/
vfunc_get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
vfunc_switch_child(index: number, duration: 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;
// 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 EnumValueObject {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* An object representing an [struct`GObject`.EnumValue].
*
* The `HdyEnumValueObject` object represents a [struct`GObject`.EnumValue],
* allowing it to be used with [iface`Gio`.ListModel].
*/
class EnumValueObject extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](enum_value: GObject.EnumValue): EnumValueObject;
// Methods
/**
* Gets the name of `self`.
* @returns the name of @self
*/
get_name(): string;
/**
* Gets the nick of `self`.
* @returns the nick of @self
*/
get_nick(): string;
/**
* Gets the value of `self`.
* @returns the value of @self
*/
get_value(): number;
}
namespace ExpanderRow {
// Constructor properties interface
interface ConstructorProps
extends PreferencesRow.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Actionable.ConstructorProps,
Gtk.Buildable.ConstructorProps {
enable_expansion: boolean;
enableExpansion: boolean;
expanded: boolean;
icon_name: string;
iconName: string;
show_enable_switch: boolean;
showEnableSwitch: boolean;
subtitle: string;
use_underline: boolean;
useUnderline: boolean;
}
}
/**
* A [class`Gtk`.ListBoxRow] used to reveal widgets.
*
* The `HdyExpanderRow` widget allows the user to reveal or hide widgets below
* it. It also allows the user to enable the expansion of the row, allowing to
* disable all that the row contains.
*
* ## HdyExpanderRow as GtkBuildable
*
* The `HdyExpanderRow` implementation of the [iface`Gtk`.Buildable] interface
* supports adding a child as an action widget by specifying “action” as the
* “type” attribute of a element.
*
* It also supports adding it as a prefix widget by specifying “prefix” as the
* “type” attribute of a element.
*
* ## CSS nodes
*
* `HdyExpanderRow` has a main CSS node with name `row`, and the `.expander`
* style class. It has the `.empty` style class when it contains no children.
*
* It contains the subnodes `row.header` for its main embedded row,
* `list.nested` for the list it can expand, and `image.expander-row-arrow` for
* its arrow.
*
* When expanded, `HdyExpanderRow` will add the
* `.checked-expander-row-previous-sibling` style class to its previous sibling,
* and remove it when retracted.
*/
class ExpanderRow extends PreferencesRow implements Atk.ImplementorIface, Gtk.Actionable, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* Whether expansion is enabled.
*/
get enable_expansion(): boolean;
set enable_expansion(val: boolean);
/**
* Whether expansion is enabled.
*/
get enableExpansion(): boolean;
set enableExpansion(val: boolean);
/**
* Whether the row is expanded.
*/
get expanded(): boolean;
set expanded(val: boolean);
/**
* The icon name for this row.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The icon name for this row.
*/
get iconName(): string;
set iconName(val: string);
/**
* Whether the switch enabling the expansion is visible.
*/
get show_enable_switch(): boolean;
set show_enable_switch(val: boolean);
/**
* Whether the switch enabling the expansion is visible.
*/
get showEnableSwitch(): boolean;
set showEnableSwitch(val: boolean);
/**
* The subtitle for this row.
*/
get subtitle(): string;
set subtitle(val: string);
/**
* Whether an embedded underline in the title or subtitle labels indicates a
* mnemonic.
*/
get use_underline(): boolean;
set use_underline(val: boolean);
/**
* Whether an embedded underline in the title or subtitle labels indicates a
* mnemonic.
*/
get useUnderline(): boolean;
set useUnderline(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ExpanderRow;
// Methods
/**
* Adds an action widget to `self`.
* @param widget the action widget
*/
add_action(widget: Gtk.Widget): void;
/**
* Adds a prefix widget to `self`.
* @param widget the prefix widget
*/
add_prefix(widget: Gtk.Widget): void;
/**
* Gets whether the expansion of `self` is enabled.
* @returns whether the expansion of @self is enabled
*/
get_enable_expansion(): boolean;
get_expanded(): boolean;
/**
* Gets the icon name for `self`.
* @returns the icon name for @self
*/
get_icon_name(): string;
/**
* Gets whether the switch enabling the expansion of `self` is visible.
* @returns whether the switch enabling the expansion of @self is visible
*/
get_show_enable_switch(): boolean;
/**
* Gets the subtitle for `self`.
* @returns the subtitle for @self
*/
get_subtitle(): string | null;
/**
* Gets whether an embedded underline in the title or subtitle labels indicates
* a mnemonic.
* @returns whether an embedded underlines indicates a mnemonic
*/
get_use_underline(): boolean;
/**
* Sets whether the expansion of `self` is enabled.
* @param enable_expansion `TRUE` to enable the expansion
*/
set_enable_expansion(enable_expansion: boolean): void;
set_expanded(expanded: boolean): void;
/**
* Sets the icon name for `self`.
* @param icon_name the icon name
*/
set_icon_name(icon_name: string): void;
/**
* Sets whether the switch enabling the expansion of `self` is visible.
* @param show_enable_switch `TRUE` to show the switch enabling the expansion
*/
set_show_enable_switch(show_enable_switch: boolean): void;
/**
* Sets the subtitle for `self`.
* @param subtitle the subtitle
*/
set_subtitle(subtitle?: string | null): void;
/**
* Sets whether an embedded underline in the title or subtitle labels indicates
* a mnemonic.
* @param use_underline `TRUE` if underlines in the text indicate mnemonics
*/
set_use_underline(use_underline: 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;
/**
* 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 Flap {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps,
Swipeable.ConstructorProps {
content: Gtk.Widget;
flap: Gtk.Widget;
flap_position: Gtk.PackType;
flapPosition: Gtk.PackType;
fold_duration: number;
foldDuration: number;
fold_policy: FlapFoldPolicy;
foldPolicy: FlapFoldPolicy;
folded: boolean;
locked: boolean;
modal: boolean;
reveal_duration: number;
revealDuration: number;
reveal_flap: boolean;
revealFlap: boolean;
reveal_progress: number;
revealProgress: number;
separator: Gtk.Widget;
swipe_to_close: boolean;
swipeToClose: boolean;
swipe_to_open: boolean;
swipeToOpen: boolean;
transition_type: FlapTransitionType;
transitionType: FlapTransitionType;
}
}
/**
* An adaptive container acting like a box or an overlay.
*
* The `HdyFlap` widget can display its children like a [class`Gtk`.Box] does or
* like a [class`Gtk`.Overlay] does, according to the
* [property`Flap:`fold-policy] value.
*
* `HdyFlap` has at most three children: [property`Flap:`content],
* [property`Flap:`flap] and [property`Flap:`separator]. Content is the primary
* child, flap is displayed next to it when unfolded, or overlays it when
* folded. Flap can be shown or hidden by changing the
* [property`Flap:`reveal-flap] value, as well as via swipe gestures if
* [property`Flap:`swipe-to-open] and/or [property`Flap:`swipe-to-close] are set
* to `TRUE`.
*
* Optionally, a separator can be provided, which would be displayed between the
* content and the flap when there's no shadow to separate them, depending on
* the transition type.
*
* [property`Flap:`flap] is transparent by default; add the `.background` style
* class to it if this is unwanted.
*
* If [property`Flap:`modal] is set to `TRUE`, content becomes completely
* inaccessible when the flap is revealed while folded.
*
* The position of the flap and separator children relative to the content is
* determined by orientation, as well as the [property`Flap:`flap-position]
* value.
*
* Folding the flap will automatically hide the flap widget, and unfolding it
* will automatically reveal it. If this behavior is not desired, the
* [property`Flap:`locked] property can be used to override it.
*
* Common use cases include sidebars, header bars that need to be able to
* overlap the window content (for example, in fullscreen mode) and bottom
* sheets.
*
* ## HdyFlap as GtkBuildable
*
* The `HdyFlap` implementation of the [iface`Gtk`.Buildable] interface supports
* setting the flap child by specifying “flap” as the “type” attribute of a
* element, and separator by specifying “separator”. Specifying
* “content” child type or omitting it results in setting the content child.
*
* ## CSS nodes
*
* `HdyFlap` has a single CSS node with name `flap`. The node will get the style
* classes `.folded` when it is folded, and `.unfolded` when it's not.
*/
class Flap extends Gtk.Container implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable, Swipeable {
static $gtype: GObject.GType;
// Properties
/**
* The content widget.
*
* It's always displayed when unfolded, and partially visible
* when folded.
*/
get content(): Gtk.Widget;
set content(val: Gtk.Widget);
/**
* The flap widget.
*
* It's only visible when [property`Flap:`reveal-progress] is greater than 0.
*/
get flap(): Gtk.Widget;
set flap(val: Gtk.Widget);
/**
* The flap position.
*
* If `GTK_PACK_START`, the flap is displayed before the content, if
* `GTK_PACK_END`, it's displayed after the content.
*/
get flap_position(): Gtk.PackType;
set flap_position(val: Gtk.PackType);
/**
* The flap position.
*
* If `GTK_PACK_START`, the flap is displayed before the content, if
* `GTK_PACK_END`, it's displayed after the content.
*/
get flapPosition(): Gtk.PackType;
set flapPosition(val: Gtk.PackType);
/**
* The fold transition animation duration, in milliseconds.
*/
get fold_duration(): number;
set fold_duration(val: number);
/**
* The fold transition animation duration, in milliseconds.
*/
get foldDuration(): number;
set foldDuration(val: number);
/**
* The current fold policy.
*
* See [enum`FlapFoldPolicy]` for available policies.
*/
get fold_policy(): FlapFoldPolicy;
set fold_policy(val: FlapFoldPolicy);
/**
* The current fold policy.
*
* See [enum`FlapFoldPolicy]` for available policies.
*/
get foldPolicy(): FlapFoldPolicy;
set foldPolicy(val: FlapFoldPolicy);
/**
* Whether the flap is currently folded.
*
* See [property`Flap:`fold-policy].
*/
get folded(): boolean;
/**
* Whether the flap is locked.
*
* If `FALSE`, folding when the flap is revealed automatically closes it, and
* unfolding it when the flap is not revealed opens it. If `TRUE`,
* [property`Flap:`reveal-flap] value never changes on its own.
*/
get locked(): boolean;
set locked(val: boolean);
/**
* Whether the flap is modal.
*
* If `TRUE`, clicking the content widget while flap is revealed, as well as
* pressing the Esc key, will close the flap. If `FALSE`, clicks
* are passed through to the content widget.
*/
get modal(): boolean;
set modal(val: boolean);
/**
* The reveal transition animation duration, in milliseconds.
*/
get reveal_duration(): number;
set reveal_duration(val: number);
/**
* The reveal transition animation duration, in milliseconds.
*/
get revealDuration(): number;
set revealDuration(val: number);
/**
* Whether the flap widget is revealed.
*/
get reveal_flap(): boolean;
set reveal_flap(val: boolean);
/**
* Whether the flap widget is revealed.
*/
get revealFlap(): boolean;
set revealFlap(val: boolean);
/**
* The current reveal transition progress.
*
* 0 means fully hidden, 1 means fully revealed. See
* [property`Flap:`reveal-flap].
*/
get reveal_progress(): number;
/**
* The current reveal transition progress.
*
* 0 means fully hidden, 1 means fully revealed. See
* [property`Flap:`reveal-flap].
*/
get revealProgress(): number;
/**
* The separator widget.
*
* It's displayed between content and flap when there's no shadow to display.
* When exactly it's visible depends on the [property`Flap:`transition-type]
* value. If `NULL`, no separator will be used.
*/
get separator(): Gtk.Widget;
set separator(val: Gtk.Widget);
/**
* Whether the flap can be closed with a swipe gesture.
*
* The area that can be swiped depends on the [property`Flap:`transition-type]
* value.
*/
get swipe_to_close(): boolean;
set swipe_to_close(val: boolean);
/**
* Whether the flap can be closed with a swipe gesture.
*
* The area that can be swiped depends on the [property`Flap:`transition-type]
* value.
*/
get swipeToClose(): boolean;
set swipeToClose(val: boolean);
/**
* Whether the flap can be opened with a swipe gesture.
*
* The area that can be swiped depends on the [property`Flap:`transition-type]
* value.
*/
get swipe_to_open(): boolean;
set swipe_to_open(val: boolean);
/**
* Whether the flap can be opened with a swipe gesture.
*
* The area that can be swiped depends on the [property`Flap:`transition-type]
* value.
*/
get swipeToOpen(): boolean;
set swipeToOpen(val: boolean);
/**
* the type of animation used for reveal and fold transitions.
*
* [property`Flap:`flap] is transparent by default, which means the content
* will be seen through it with `HDY_FLAP_TRANSITION_TYPE_OVER` transitions;
* add the `.background` style class to it if this is unwanted.
*/
get transition_type(): FlapTransitionType;
set transition_type(val: FlapTransitionType);
/**
* the type of animation used for reveal and fold transitions.
*
* [property`Flap:`flap] is transparent by default, which means the content
* will be seen through it with `HDY_FLAP_TRANSITION_TYPE_OVER` transitions;
* add the `.background` style class to it if this is unwanted.
*/
get transitionType(): FlapTransitionType;
set transitionType(val: FlapTransitionType);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Flap;
// Methods
/**
* Gets the content widget for `self`
* @returns the content widget for @self
*/
get_content(): Gtk.Widget | null;
/**
* Gets the flap widget for `self`
* @returns the flap widget for @self
*/
get_flap(): Gtk.Widget | null;
/**
* Gets the flap position for `self`.
* @returns the flap position for @self
*/
get_flap_position(): Gtk.PackType;
/**
* Gets the amount of time that fold transitions will take.
* @returns the fold transition duration, in milliseconds
*/
get_fold_duration(): number;
/**
* Gets the current fold policy of `self`.
* @returns the current fold policy of @self
*/
get_fold_policy(): FlapFoldPolicy;
/**
* Gets whether `self` is currently folded.
* @returns `TRUE` if @self is currently folded
*/
get_folded(): boolean;
/**
* Gets whether `self` is locked.
* @returns whether @self is locked
*/
get_locked(): boolean;
/**
* Gets whether the `self` is modal.
* @returns whether @self is modal
*/
get_modal(): boolean;
/**
* Gets the amount of time that reveal transitions will take.
* @returns the reveal transition duration, in milliseconds
*/
get_reveal_duration(): number;
/**
* Gets whether the flap widget is revealed for `self`.
* @returns whether flap widget is revealed
*/
get_reveal_flap(): boolean;
/**
* Gets the current reveal transition progress for `self`.
* @returns the current reveal progress for @self
*/
get_reveal_progress(): number;
/**
* Gets the separator widget for `self`.
* @returns the separator widget for @self
*/
get_separator(): Gtk.Widget | null;
/**
* Gets whether `self` can be closed with a swipe gesture.
* @returns `TRUE` if @self can be closed with a swipe gesture
*/
get_swipe_to_close(): boolean;
/**
* Gets whether `self` can be opened with a swipe gesture.
* @returns `TRUE` if @self can be opened with a swipe gesture
*/
get_swipe_to_open(): boolean;
/**
* Gets the type of animation used for reveal and fold transitions in `self`.
* @returns the current transition type of @self
*/
get_transition_type(): FlapTransitionType;
/**
* Sets the content widget for `self`.
*
* It is always displayed when unfolded, and partially visible when folded.
* @param content the content widget
*/
set_content(content?: Gtk.Widget | null): void;
/**
* Sets the flap widget for `self`.
* @param flap the flap widget
*/
set_flap(flap?: Gtk.Widget | null): void;
/**
* Sets the flap position for `self`.
* @param position the new value
*/
set_flap_position(position: Gtk.PackType | null): void;
/**
* Sets the duration that fold transitions will take.
* @param duration the new duration, in milliseconds
*/
set_fold_duration(duration: number): void;
/**
* Sets the current fold policy for `self`.
* @param policy a fold policy
*/
set_fold_policy(policy: FlapFoldPolicy | null): void;
/**
* Sets whether `self` is locked.
*
* If `FALSE`, folding `self` when the flap is revealed automatically closes it,
* and unfolding it when the flap is not revealed opens it. If `TRUE`,
* [property`Flap:`reveal-flap] value never changes on its own.
* @param locked the new value
*/
set_locked(locked: boolean): void;
/**
* Sets whether the `self` can be closed with a click.
*
* If `modal` is `TRUE`, clicking the content widget while flap is revealed, or
* pressing the Esc key, will close the flap. If `FALSE`, clicks are
* passed through to the content widget.
* @param modal whether @self can be closed with a click
*/
set_modal(modal: boolean): void;
/**
* Sets the duration that reveal transitions in `self` will take.
* @param duration the new duration, in milliseconds
*/
set_reveal_duration(duration: number): void;
/**
* Sets whether the flap widget is revealed for `self`.
* @param reveal_flap `TRUE` to reveal the flap widget, `FALSE` otherwise
*/
set_reveal_flap(reveal_flap: boolean): void;
/**
* Sets the separator widget for `self`.
* @param separator the separator widget
*/
set_separator(separator?: Gtk.Widget | null): void;
/**
* Sets whether `self` can be closed with a swipe gesture.
*
* The area that can be swiped depends on the [property`Flap:`transition-type] value.
* @param swipe_to_close whether @self can be closed with a swipe gesture
*/
set_swipe_to_close(swipe_to_close: boolean): void;
/**
* Sets whether `self` can be opened with a swipe gesture.
*
* The area that can be swiped depends on the [property`Flap:`transition-type]
* value.
* @param swipe_to_open whether @self can be opened with a swipe gesture
*/
set_swipe_to_open(swipe_to_open: boolean): void;
/**
* Sets the type of animation used for reveal and fold transitions in `self`.
* @param transition_type the new transition type
*/
set_transition_type(transition_type: FlapTransitionType | null): void;
// 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;
/**
* Emits [signal`Swipeable:`:child-switched] signal.
*
* This should be called when the widget switches visible child widget.
*
* `duration` can be 0 if the child is switched without animation.
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
emit_child_switched(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
* @returns the cancel progress, unitless
*/
get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
* @returns the swipe distance in pixels
*/
get_distance(): number;
/**
* Gets the current progress of `self`.
* @returns the current progress, unitless
*/
get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
* @returns the snap points
*/
get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
get_swipe_area(navigation_direction: NavigationDirection | null, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
* @returns the swipe tracker
*/
get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
switch_child(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
*/
vfunc_get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
*/
vfunc_get_distance(): number;
/**
* Gets the current progress of `self`.
*/
vfunc_get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
*/
vfunc_get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
vfunc_get_swipe_area(navigation_direction: NavigationDirection, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
*/
vfunc_get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
vfunc_switch_child(index: number, duration: 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;
// 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 HeaderBar {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
centering_policy: CenteringPolicy;
centeringPolicy: CenteringPolicy;
custom_title: Gtk.Widget;
customTitle: Gtk.Widget;
decoration_layout: string;
decorationLayout: string;
decoration_layout_set: boolean;
decorationLayoutSet: boolean;
has_subtitle: boolean;
hasSubtitle: boolean;
interpolate_size: boolean;
interpolateSize: boolean;
show_close_button: boolean;
showCloseButton: boolean;
spacing: number;
subtitle: string;
title: string;
transition_duration: number;
transitionDuration: number;
transition_running: boolean;
transitionRunning: boolean;
}
}
/**
* A title bar widget.
*
* `HdyHeaderBar` is similar to [class`Gtk`.HeaderBar] but is designed to fix
* some of its shortcomings for adaptive applications.
*
* `HdyHeaderBar` doesn't force the custom title widget to be vertically
* centered, hence allowing it to fill up the whole height, which is e.g. needed
* for [class`ViewSwitcher]`.
*
* When used in a mobile dialog, `HdyHeaderBar` will replace its window
* decorations by a back button allowing to close it. It doesn't have to be its
* direct child and you can use any complex contraption you like as the dialog's
* titlebar.
*
* `HdyHeaderBar` can be used in window's content area rather than titlebar, and
* will still be draggable and will handle right click, middle click and double
* click as expected from a titlebar. This is particularly useful with
* [class`Window]` or [class`ApplicationWindow]`.
*
* ## CSS nodes
*
* `HdyHeaderBar` has a single CSS node with name `headerbar`.
*/
class HeaderBar extends Gtk.Container implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The policy for aligning the center widget.
*/
get centering_policy(): CenteringPolicy;
set centering_policy(val: CenteringPolicy);
/**
* The policy for aligning the center widget.
*/
get centeringPolicy(): CenteringPolicy;
set centeringPolicy(val: CenteringPolicy);
/**
* Custom title widget to display.
*/
get custom_title(): Gtk.Widget;
set custom_title(val: Gtk.Widget);
/**
* Custom title widget to display.
*/
get customTitle(): Gtk.Widget;
set customTitle(val: Gtk.Widget);
/**
* The decoration layout for buttons.
*
* If this property is not set, the
* [property`Gtk`.Settings:gtk-decoration-layout] setting is used.
*
* There can be valid reasons for overriding the setting, such as a header bar
* design that does not allow for buttons to take room on the right, or only
* offers room for a single close button. Split header bars are another example
* for overriding the setting.
*
* The format of the string is button names, separated by commas. A colon
* separates the buttons that should appear on the start from those on the
* end. Recognized button names are minimize, maximize, close, icon (the
* window icon) and menu (a menu button for the fallback app menu).
*
* For example, “menu:minimize,maximize,close” specifies a menu on the left, and
* minimize, maximize and close buttons on the right.
*/
get decoration_layout(): string;
set decoration_layout(val: string);
/**
* The decoration layout for buttons.
*
* If this property is not set, the
* [property`Gtk`.Settings:gtk-decoration-layout] setting is used.
*
* There can be valid reasons for overriding the setting, such as a header bar
* design that does not allow for buttons to take room on the right, or only
* offers room for a single close button. Split header bars are another example
* for overriding the setting.
*
* The format of the string is button names, separated by commas. A colon
* separates the buttons that should appear on the start from those on the
* end. Recognized button names are minimize, maximize, close, icon (the
* window icon) and menu (a menu button for the fallback app menu).
*
* For example, “menu:minimize,maximize,close” specifies a menu on the left, and
* minimize, maximize and close buttons on the right.
*/
get decorationLayout(): string;
set decorationLayout(val: string);
/**
* Whether [property`HeaderBar:`decoration-layout] is set.
*/
get decoration_layout_set(): boolean;
set decoration_layout_set(val: boolean);
/**
* Whether [property`HeaderBar:`decoration-layout] is set.
*/
get decorationLayoutSet(): boolean;
set decorationLayoutSet(val: boolean);
/**
* Whether to reserve space for a subtitle, even if none is currently set.
*/
get has_subtitle(): boolean;
set has_subtitle(val: boolean);
/**
* Whether to reserve space for a subtitle, even if none is currently set.
*/
get hasSubtitle(): boolean;
set hasSubtitle(val: boolean);
/**
* Whether the size should smoothly change when changing between children.
*
* If `TRUE`, the header bar will interpolate its size between the one of the
* previous visible child and the one of the new visible child, according to
* the set transition duration and the orientation, e.g. if the orientation is
* horizontal, it will interpolate the its height.
*/
get interpolate_size(): boolean;
set interpolate_size(val: boolean);
/**
* Whether the size should smoothly change when changing between children.
*
* If `TRUE`, the header bar will interpolate its size between the one of the
* previous visible child and the one of the new visible child, according to
* the set transition duration and the orientation, e.g. if the orientation is
* horizontal, it will interpolate the its height.
*/
get interpolateSize(): boolean;
set interpolateSize(val: boolean);
/**
* Whether to show window decorations.
*
* Which buttons are actually shown and where is determined by the
* [property`HeaderBar:`decoration-layout] property, and by the state of the
* window (e.g. a close button will not be shown if the window can't be
* closed).
*/
get show_close_button(): boolean;
set show_close_button(val: boolean);
/**
* Whether to show window decorations.
*
* Which buttons are actually shown and where is determined by the
* [property`HeaderBar:`decoration-layout] property, and by the state of the
* window (e.g. a close button will not be shown if the window can't be
* closed).
*/
get showCloseButton(): boolean;
set showCloseButton(val: boolean);
/**
* The amount of space between children.
*/
get spacing(): number;
set spacing(val: number);
/**
* The subtitle to display.
*/
get subtitle(): string;
set subtitle(val: string);
/**
* The title to display.
*/
get title(): string;
set title(val: string);
/**
* The transition duration, in milliseconds.
*/
get transition_duration(): number;
set transition_duration(val: number);
/**
* The transition duration, in milliseconds.
*/
get transitionDuration(): number;
set transitionDuration(val: number);
/**
* Whether or not the transition is currently running.
*/
get transition_running(): boolean;
/**
* Whether or not the transition is currently running.
*/
get transitionRunning(): boolean;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): HeaderBar;
// Methods
/**
* Gets the policy `self` follows to horizontally align its center widget.
* @returns the centering policy
*/
get_centering_policy(): CenteringPolicy;
/**
* Retrieves the custom title widget of the header.
* @returns the custom title widget of the header
*/
get_custom_title(): Gtk.Widget | null;
/**
* Gets the decoration layout.
* @returns the decoration layout
*/
get_decoration_layout(): string;
/**
* Gets whether space is reserved for a subtitle, regardless if one is currently
* set or not.
* @returns `TRUE` if the header bar reserves space for a subtitle
*/
get_has_subtitle(): boolean;
/**
* Gets whether `self` should interpolate its size on visible child change.
* @returns whether @self interpolates its size on visible child change
*/
get_interpolate_size(): boolean;
/**
* Gets whether this header bar shows the standard window decorations.
* @returns whether decorations are shown
*/
get_show_close_button(): boolean;
/**
* Gets the subtitle of the header.
* @returns the subtitle of the header
*/
get_subtitle(): string | null;
/**
* Retrieves the title of the header.
* @returns the title of the header.
*/
get_title(): string | null;
/**
* Gets the amount of time that transitions between pages will take.
* @returns the transition duration, in milliseconds
*/
get_transition_duration(): number;
/**
* Gets whether the `self` is currently in a transition from one page to another.
* @returns whether the transition is currently running
*/
get_transition_running(): boolean;
/**
* Adds `child` to `self,` packed with reference to the end of the `self`.
* @param child the widget to be added to @self
*/
pack_end(child: Gtk.Widget): void;
/**
* Adds `child` to `self,` packed with reference to the start of the `self`.
* @param child the widget to be added to @self
*/
pack_start(child: Gtk.Widget): void;
/**
* Sets the policy `self` must follow to horizontally align its center widget.
* @param centering_policy the centering policy
*/
set_centering_policy(centering_policy: CenteringPolicy | null): void;
/**
* Sets a custom title for the header bar.
*
* The title should help a user identify the current view. This supersedes any
* title set by [method`HeaderBar`.set_title] or [method`HeaderBar`.set_subtitle].
* To achieve the same style as the builtin title and subtitle, use the `.title`
* and `.subtitle` style classes.
*
* You should set the custom title to `NULL`, for the header title label to be
* visible again.
* @param title_widget a custom widget to use for a title
*/
set_custom_title(title_widget?: Gtk.Widget | null): void;
/**
* Sets the decoration layout for this header bar.
* @param layout a decoration layout
*/
set_decoration_layout(layout?: string | null): void;
/**
* Sets whether space is reserved for a subtitle, even if none is currently set.
* @param setting `TRUE` to reserve space for a subtitle
*/
set_has_subtitle(setting: boolean): void;
/**
* Sets whether `self` should interpolate its size on visible child change.
* @param interpolate_size `TRUE` to interpolate the size
*/
set_interpolate_size(interpolate_size: boolean): void;
/**
* Sets whether this header bar shows the standard window decorations.
* @param setting `TRUE` to show standard window decorations
*/
set_show_close_button(setting: boolean): void;
/**
* Sets the subtitle of the header bar.
*
* The title should give a user an additional detail to help them identify the
* current view.
*
* Note that [class`HeaderBar]` by default reserves room for the subtitle, even
* if none is currently set. If this is not desired, set the
* [property`HeaderBar:`has-subtitle] property to `FALSE`.
* @param subtitle a subtitle
*/
set_subtitle(subtitle?: string | null): void;
/**
* Sets the title of the [class`HeaderBar]`.
*
* The title should help a user identify the current view. A good title should
* not include the application name.
* @param title a title
*/
set_title(title?: string | null): void;
/**
* Sets the duration that transitions between pages will take.
* @param duration the new duration, in milliseconds
*/
set_transition_duration(duration: 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 HeaderGroup {
// Signal callback interfaces
interface UpdateDecorationLayouts {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gtk.Buildable.ConstructorProps {
decorate_all: boolean;
decorateAll: boolean;
}
}
/**
* An object handling composite title bars.
*
* The `HdyHeaderGroup` object handles the header bars of a composite title bar.
* It splits the window decoration across the header bars, giving the left side
* of the decorations to the leftmost header bar, and the right side of the
* decorations to the rightmost header bar. See
* [method`HeaderBar`.set_decoration_layout].
*
* The [property`HeaderGroup:`decorate-all] property can be used in conjunction
* with [property`Leaflet:`folded] when the title bar is split across the pages
* of a [class`Leaflet]` to automatically display the decorations on all the
* pages when the leaflet is folded.
*
* You can nest header groups, which is convenient when you nest leaflets too:
*
* ```xml
*
*
* ```
*/
class HeaderGroup extends GObject.Object implements Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* Whether the elements of the group should all receive the full decoration.
*
* This is useful in conjunction with [property`Leaflet:`folded] when the
* leaflet contains the header bars of the group, as you want them all to
* display the complete decoration when the leaflet is folded.
*/
get decorate_all(): boolean;
set decorate_all(val: boolean);
/**
* Whether the elements of the group should all receive the full decoration.
*
* This is useful in conjunction with [property`Leaflet:`folded] when the
* leaflet contains the header bars of the group, as you want them all to
* display the complete decoration when the leaflet is folded.
*/
get decorateAll(): boolean;
set decorateAll(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): HeaderGroup;
// 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: 'update-decoration-layouts', callback: (_source: this) => void): number;
connect_after(signal: 'update-decoration-layouts', callback: (_source: this) => void): number;
emit(signal: 'update-decoration-layouts'): void;
// Methods
/**
* Adds `header_bar` to `self`.
*
* When the widget is destroyed or no longer referenced elsewhere, it will be
* removed from the header group.
* @param header_bar the header bar to add
*/
add_gtk_header_bar(header_bar: Gtk.HeaderBar): void;
/**
* Adds `header_bar` to `self`.
*
* When the widget is destroyed or no longer referenced elsewhere, it will be
* removed from the header group.
* @param header_bar the header bar to add
*/
add_header_bar(header_bar: HeaderBar): void;
/**
* Adds `header_group` to `self`.
*
* When the nested group is no longer referenced elsewhere, it will be removed
* from the header group.
* @param header_group the header group to add
*/
add_header_group(header_group: HeaderGroup): void;
/**
* Returns the list of children associated with `self`.
* @returns the list of children
*/
get_children(): HeaderGroupChild[];
/**
* Gets whether the elements of the group should all receive the full
* decoration.
* @returns whether the elements of the group should all receive the full decoration
*/
get_decorate_all(): boolean;
/**
* Removes `child` from `self`.
* @param child the header group child to remove
*/
remove_child(child: HeaderGroupChild): void;
/**
* Removes `header_bar` from `self`.
* @param header_bar the header bar to remove
*/
remove_gtk_header_bar(header_bar: Gtk.HeaderBar): void;
/**
* Removes `header_bar` from `self`.
* @param header_bar the header bar to remove
*/
remove_header_bar(header_bar: HeaderBar): void;
/**
* Removes a nested `HdyHeaderGroup` from `self`.
* @param header_group the header group to remove
*/
remove_header_group(header_group: HeaderGroup): void;
/**
* Sets whether the elements of the group should all receive the full
* decoration.
* @param decorate_all whether the elements of the group should all receive the full decoration
*/
set_decorate_all(decorate_all: boolean): 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 HeaderGroupChild {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* A child object for [class`HeaderGroup]`.
*/
class HeaderGroupChild extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets the child type.
* @returns the child type
*/
get_child_type(): HeaderGroupChildType;
/**
* Gets the child [class`Gtk`.HeaderBar].
*
* Use [method`HeaderGroupChild`.get_child_type] to check the child type.
* @returns the child header bar
*/
get_gtk_header_bar(): Gtk.HeaderBar;
/**
* Gets the child [class`HeaderBar]`.
*
* Use [method`HeaderGroupChild`.get_child_type] to check the child type.
* @returns the child headerbar
*/
get_header_bar(): HeaderBar;
/**
* Gets the child [class`HeaderGroup]`.
*
* Use [method`HeaderGroupChild`.get_child_type] to check the child type.
* @returns the child header bar
*/
get_header_group(): HeaderGroup;
}
namespace Keypad {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
column_spacing: number;
columnSpacing: number;
end_action: Gtk.Widget;
endAction: Gtk.Widget;
entry: Gtk.Entry;
letters_visible: boolean;
lettersVisible: boolean;
row_spacing: number;
rowSpacing: number;
start_action: Gtk.Widget;
startAction: Gtk.Widget;
symbols_visible: boolean;
symbolsVisible: boolean;
}
}
/**
* A keypad for dialing numbers
*
* The `HdyKeypad` widget is a keypad for entering numbers such as phone numbers
* or PIN codes.
*
* ## CSS nodes
*
* `HdyKeypad` has a single CSS node with name `keypad`.
*/
class Keypad extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The amount of space between two consecutive columns.
*/
get column_spacing(): number;
set column_spacing(val: number);
/**
* The amount of space between two consecutive columns.
*/
get columnSpacing(): number;
set columnSpacing(val: number);
/**
* The widget for the lower end corner of `self`.
*/
get end_action(): Gtk.Widget;
set end_action(val: Gtk.Widget);
/**
* The widget for the lower end corner of `self`.
*/
get endAction(): Gtk.Widget;
set endAction(val: Gtk.Widget);
/**
* The entry widget connected to the keypad.
*
* The entry will block any input not possible to type with the keypad.
*/
get entry(): Gtk.Entry;
set entry(val: Gtk.Entry);
/**
* Whether standard letters should be displayed below the digits on the
* buttons.
*/
get letters_visible(): boolean;
set letters_visible(val: boolean);
/**
* Whether standard letters should be displayed below the digits on the
* buttons.
*/
get lettersVisible(): boolean;
set lettersVisible(val: boolean);
/**
* The amount of space between two consecutive rows.
*/
get row_spacing(): number;
set row_spacing(val: number);
/**
* The amount of space between two consecutive rows.
*/
get rowSpacing(): number;
set rowSpacing(val: number);
/**
* The widget for the lower start corner of `self`.
*/
get start_action(): Gtk.Widget;
set start_action(val: Gtk.Widget);
/**
* The widget for the lower start corner of `self`.
*/
get startAction(): Gtk.Widget;
set startAction(val: Gtk.Widget);
/**
* Whether to display symbols.
*
* This includes hash and asterisk buttons, and the plus symbol at the bottom
* of its 0 button.
*/
get symbols_visible(): boolean;
set symbols_visible(val: boolean);
/**
* Whether to display symbols.
*
* This includes hash and asterisk buttons, and the plus symbol at the bottom
* of its 0 button.
*/
get symbolsVisible(): boolean;
set symbolsVisible(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](symbols_visible: boolean, letters_visible: boolean): Keypad;
// Methods
/**
* Returns the amount of space between the columns of `self`.
* @returns the column spacing of @self
*/
get_column_spacing(): number;
/**
* Gets the widget for the lower right corner (or left, in RTL locales).
* @returns the end action widget
*/
get_end_action(): Gtk.Widget | null;
/**
* Gets the connected entry.
* @returns the entry set
*/
get_entry(): Gtk.Entry;
/**
* Gets whether standard letters are displayed below the digits on the buttons.
* @returns whether the letters below the digits should be visible
*/
get_letters_visible(): boolean;
/**
* Returns the amount of space between the rows of `self`.
* @returns the row spacing of @self
*/
get_row_spacing(): number;
/**
* Gets the widget for the lower left corner (or right, in RTL locales).
* @returns the start action widget
*/
get_start_action(): Gtk.Widget | null;
/**
* Gets whether symbols are displayed.
* @returns whether symboles are visible
*/
get_symbols_visible(): boolean;
/**
* Sets the amount of space between columns of `self`.
* @param spacing the amount of space to insert between columns
*/
set_column_spacing(spacing: number): void;
/**
* Sets the widget for the lower right corner (or left, in RTL locales).
* @param end_action the end action widget
*/
set_end_action(end_action?: Gtk.Widget | null): void;
/**
* Binds `entry` to `self`.
* @param entry an entry
*/
set_entry(entry?: Gtk.Entry | null): void;
/**
* Sets whether standard letters are displayed below the digits on the buttons.
* @param letters_visible whether the letters below the digits should be visible
*/
set_letters_visible(letters_visible: boolean): void;
/**
* Sets the amount of space between rows of `self`.
* @param spacing the amount of space to insert between rows
*/
set_row_spacing(spacing: number): void;
/**
* Sets the widget for the lower left corner (or right, in RTL locales).
* @param start_action the start action widget
*/
set_start_action(start_action?: Gtk.Widget | null): void;
/**
* Sets whether standard letters are displayed below the digits on the buttons.
* @param symbols_visible whether the hash, plus, and asterisk symbols should be visible
*/
set_symbols_visible(symbols_visible: 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 Leaflet {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps,
Swipeable.ConstructorProps {
can_swipe_back: boolean;
canSwipeBack: boolean;
can_swipe_forward: boolean;
canSwipeForward: boolean;
child_transition_duration: number;
childTransitionDuration: number;
child_transition_running: boolean;
childTransitionRunning: boolean;
folded: boolean;
hhomogeneous_folded: boolean;
hhomogeneousFolded: boolean;
hhomogeneous_unfolded: boolean;
hhomogeneousUnfolded: boolean;
interpolate_size: boolean;
interpolateSize: boolean;
mode_transition_duration: number;
modeTransitionDuration: number;
transition_type: LeafletTransitionType;
transitionType: LeafletTransitionType;
vhomogeneous_folded: boolean;
vhomogeneousFolded: boolean;
vhomogeneous_unfolded: boolean;
vhomogeneousUnfolded: boolean;
visible_child: Gtk.Widget;
visibleChild: Gtk.Widget;
visible_child_name: string;
visibleChildName: string;
}
}
/**
* An adaptive container acting like a box or a stack.
*
* The `HdyLeaflet` widget can display its children like a [class`Gtk`.Box] does
* or like a [class`Gtk`.Stack] does, adapting to size changes by switching
* between the two modes.
*
* When there is enough space the children are displayed side by side, otherwise
* only one is displayed and the leaflet is said to be “folded”. The threshold
* is dictated by the preferred minimum sizes of the children. When a leaflet is
* folded, the children can be navigated using swipe gestures.
*
* The “over” and “under” transition types stack the children one on top of the
* other, while the “slide” transition puts the children side by side. While
* navigating to a child on the side or below can be performed by swiping the
* current child away, navigating to an upper child requires dragging it from
* the edge where it resides. This doesn't affect non-dragging swipes.
*
* The “over” and “under” transitions can draw their shadow on top of the
* window's transparent areas, like the rounded corners. This is a side-effect
* of allowing shadows to be drawn on top of OpenGL areas. It can be mitigated
* by using [class`Window]` or [class`ApplicationWindow]` as they will crop
* anything drawn beyond the rounded corners.
*
* The child property `navigatable` can be set on `HdyLeaflet` children to
* determine whether they can be navigated to when folded. If `FALSE`, the child
* will be ignored by [method`Leaflet`.get_adjacent_child],
* [method`Leaflet`.navigate], and swipe gestures. This can be used used to
* prevent switching to widgets like separators.
*
* ## CSS nodes
*
* `HdyLeaflet` has a single CSS node with name `leaflet`. The node will get the
* style classes `.folded` when it is folded, `.unfolded` when it's not, or none
* if it didn't compute its fold yet.
*/
class Leaflet extends Gtk.Container implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable, Swipeable {
static $gtype: GObject.GType;
// Properties
/**
* Whether swipe gestures allow switching to the previous navigatable child.
*/
get can_swipe_back(): boolean;
set can_swipe_back(val: boolean);
/**
* Whether swipe gestures allow switching to the previous navigatable child.
*/
get canSwipeBack(): boolean;
set canSwipeBack(val: boolean);
/**
* Whether swipe gestures allow switching to the next navigatable child.
*/
get can_swipe_forward(): boolean;
set can_swipe_forward(val: boolean);
/**
* Whether swipe gestures allow switching to the next navigatable child.
*/
get canSwipeForward(): boolean;
set canSwipeForward(val: boolean);
/**
* The child transition animation duration, in milliseconds.
*/
get child_transition_duration(): number;
set child_transition_duration(val: number);
/**
* The child transition animation duration, in milliseconds.
*/
get childTransitionDuration(): number;
set childTransitionDuration(val: number);
/**
* Whether a child transition is currently running.
*/
get child_transition_running(): boolean;
/**
* Whether a child transition is currently running.
*/
get childTransitionRunning(): boolean;
/**
* Whether the leaflet is folded.
*
* The leaflet will be folded if the size allocated to it is smaller than the
* sum of the natural size of its children, it will be unfolded otherwise.
*/
get folded(): boolean;
/**
* Whether to allocate the same width for all children when folded.
*/
get hhomogeneous_folded(): boolean;
set hhomogeneous_folded(val: boolean);
/**
* Whether to allocate the same width for all children when folded.
*/
get hhomogeneousFolded(): boolean;
set hhomogeneousFolded(val: boolean);
/**
* Whether to allocate the same width for all children when unfolded.
*/
get hhomogeneous_unfolded(): boolean;
set hhomogeneous_unfolded(val: boolean);
/**
* Whether to allocate the same width for all children when unfolded.
*/
get hhomogeneousUnfolded(): boolean;
set hhomogeneousUnfolded(val: boolean);
/**
* Whether the size should smoothly change when changing between children.
*/
get interpolate_size(): boolean;
set interpolate_size(val: boolean);
/**
* Whether the size should smoothly change when changing between children.
*/
get interpolateSize(): boolean;
set interpolateSize(val: boolean);
/**
* The mode transition animation duration, in milliseconds.
*/
get mode_transition_duration(): number;
set mode_transition_duration(val: number);
/**
* The mode transition animation duration, in milliseconds.
*/
get modeTransitionDuration(): number;
set modeTransitionDuration(val: number);
/**
* The animation type used for transitions between modes and children.
*
* The transition type can be changed without problems at runtime, so it is
* possible to change the animation based on the mode or child that is about
* to become current.
*/
get transition_type(): LeafletTransitionType;
set transition_type(val: LeafletTransitionType);
/**
* The animation type used for transitions between modes and children.
*
* The transition type can be changed without problems at runtime, so it is
* possible to change the animation based on the mode or child that is about
* to become current.
*/
get transitionType(): LeafletTransitionType;
set transitionType(val: LeafletTransitionType);
/**
* Whether to allocates the same height for all children when folded.
*/
get vhomogeneous_folded(): boolean;
set vhomogeneous_folded(val: boolean);
/**
* Whether to allocates the same height for all children when folded.
*/
get vhomogeneousFolded(): boolean;
set vhomogeneousFolded(val: boolean);
/**
* Whether to allocate the same height for all children when unfolded.
*/
get vhomogeneous_unfolded(): boolean;
set vhomogeneous_unfolded(val: boolean);
/**
* Whether to allocate the same height for all children when unfolded.
*/
get vhomogeneousUnfolded(): boolean;
set vhomogeneousUnfolded(val: boolean);
/**
* The widget currently visible when the leaflet is folded.
*
* The transition is determined by [property`Leaflet:`transition-type] and
* [property`Leaflet:`child-transition-duration]. The transition can be
* cancelled by the user, in which case visible child will change back to the
* previously visible child.
*/
get visible_child(): Gtk.Widget;
set visible_child(val: Gtk.Widget);
/**
* The widget currently visible when the leaflet is folded.
*
* The transition is determined by [property`Leaflet:`transition-type] and
* [property`Leaflet:`child-transition-duration]. The transition can be
* cancelled by the user, in which case visible child will change back to the
* previously visible child.
*/
get visibleChild(): Gtk.Widget;
set visibleChild(val: Gtk.Widget);
/**
* The name of the widget currently visible when the leaflet is folded.
*
* See [property`Leaflet:`visible-child].
*/
get visible_child_name(): string;
set visible_child_name(val: string);
/**
* The name of the widget currently visible when the leaflet is folded.
*
* See [property`Leaflet:`visible-child].
*/
get visibleChildName(): string;
set visibleChildName(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Leaflet;
// Methods
/**
* Finds the previous or next navigatable child.
*
* This will be the same widget [method`Leaflet`.navigate] will navigate to.
*
* If there's no child to navigate to, `NULL` will be returned instead.
* @param direction the direction
* @returns the previous or next child
*/
get_adjacent_child(direction: NavigationDirection | null): Gtk.Widget | null;
/**
* Gets whether swipe gestures switch to the previous navigatable child.
* @returns `TRUE` if back swipe is enabled
*/
get_can_swipe_back(): boolean;
/**
* Gets whether swipe gestures switch to the next navigatable child.
* @returns `TRUE` if forward swipe is enabled
*/
get_can_swipe_forward(): boolean;
/**
* Finds the child of `self` with the name given as the argument.
*
* Returns `NULL` if there is no child with this name.
* @param name the name of the child to find
* @returns the requested child of @self
*/
get_child_by_name(name: string): Gtk.Widget | null;
/**
* Gets the amount of time that transitions between children will take.
* @returns the child transition duration, in milliseconds
*/
get_child_transition_duration(): number;
/**
* Returns whether `self` is currently in a transition from one page to another.
* @returns whether a transition is currently running
*/
get_child_transition_running(): boolean;
/**
* Gets whether `self` is folded.
* @returns whether @self is folded
*/
get_folded(): boolean;
/**
* Gets whether `self` is homogeneous for the given fold and orientation.
* @param folded the fold
* @param orientation the orientation
* @returns whether @self is homogeneous for the given fold and orientation
*/
get_homogeneous(folded: boolean, orientation: Gtk.Orientation | null): boolean;
/**
* Gets whether to interpolate between the sizes of children on page switches.
* @returns `TRUE` if child sizes are interpolated
*/
get_interpolate_size(): boolean;
/**
* Gets the amount of time that transitions between modes in `self` will take.
* @returns the mode transition duration, in milliseconds
*/
get_mode_transition_duration(): number;
/**
* Gets the animation type that will be used for transitions between modes and
* children.
* @returns the current transition type of @self
*/
get_transition_type(): LeafletTransitionType;
/**
* Gets the visible child widget.
* @returns the visible child widget
*/
get_visible_child(): Gtk.Widget;
/**
* Gets the name of the currently visible child widget.
* @returns the name of the visible child
*/
get_visible_child_name(): string;
/**
* Inserts `child` in the position after `sibling` in the list of children.
*
* If `sibling` is `NULL`, inserts `child` at the first position.
* @param child the widget to insert
* @param sibling the sibling after which to insert @child
*/
insert_child_after(child: Gtk.Widget, sibling?: Gtk.Widget | null): void;
/**
* Navigates to the previous or next navigatable child.
*
* The switch is similar to performing a swipe gesture to go in `direction`.
* @param direction the direction
* @returns whether the visible child was changed
*/
navigate(direction: NavigationDirection | null): boolean;
/**
* Inserts `child` at the first position in `self`.
* @param child the widget to prepend
*/
prepend(child: Gtk.Widget): void;
/**
* Moves `child` to the position after `sibling` in the list of children.
*
* If `sibling` is `NULL`, move `child` to the first position.
* @param child the widget to move, must be a child of @self
* @param sibling the sibling to move @child after
*/
reorder_child_after(child: Gtk.Widget, sibling?: Gtk.Widget | null): void;
/**
* Sets whether swipe gestures switch to the previous navigatable child.
* @param can_swipe_back the new value
*/
set_can_swipe_back(can_swipe_back: boolean): void;
/**
* Sets whether swipe gestures switch to the next navigatable child.
* @param can_swipe_forward the new value
*/
set_can_swipe_forward(can_swipe_forward: boolean): void;
/**
* Sets the duration that transitions between children in `self` will take.
* @param duration the new duration, in milliseconds
*/
set_child_transition_duration(duration: number): void;
/**
* Sets whether to be homogeneous for the given fold and orientation.
*
* If it is homogeneous, the [class`Leaflet]` will request the same
* width or height for all its children depending on the orientation. If it
* isn't and it is folded, the leaflet may change width or height when a
* different child becomes visible.
* @param folded the fold
* @param orientation the orientation
* @param homogeneous `TRUE` to make @self homogeneous
*/
set_homogeneous(folded: boolean, orientation: Gtk.Orientation | null, homogeneous: boolean): void;
/**
* Sets whether `self` will interpolate its size when changing the visible child.
*
* If the [property`Leaflet:`interpolate-size] property is set to `TRUE`, `self`
* will interpolate its size between the current one and the one it'll take
* after changing the visible child, according to the set transition duration.
* @param interpolate_size the new value
*/
set_interpolate_size(interpolate_size: boolean): void;
/**
* Sets the duration that transitions between modes in `self` will take.
* @param duration the new duration, in milliseconds
*/
set_mode_transition_duration(duration: number): void;
/**
* Sets the animation type that will be used for transitions between modes and
* children.
*
* The transition type can be changed without problems at runtime, so it is
* possible to change the animation based on the mode or child that is about to
* become current.
* @param transition the new transition type
*/
set_transition_type(transition: LeafletTransitionType | null): void;
/**
* Sets the currently visible widget when the leaflet is folded.
* @param visible_child the new child
*/
set_visible_child(visible_child: Gtk.Widget): void;
/**
* Makes the child with the name `name` visible.
*
* See [method`Leaflet`.set_visible_child] for more details.
* @param name the name of a child
*/
set_visible_child_name(name: string): void;
// 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;
/**
* Emits [signal`Swipeable:`:child-switched] signal.
*
* This should be called when the widget switches visible child widget.
*
* `duration` can be 0 if the child is switched without animation.
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
emit_child_switched(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
* @returns the cancel progress, unitless
*/
get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
* @returns the swipe distance in pixels
*/
get_distance(): number;
/**
* Gets the current progress of `self`.
* @returns the current progress, unitless
*/
get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
* @returns the snap points
*/
get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
get_swipe_area(navigation_direction: NavigationDirection | null, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
* @returns the swipe tracker
*/
get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
switch_child(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
*/
vfunc_get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
*/
vfunc_get_distance(): number;
/**
* Gets the current progress of `self`.
*/
vfunc_get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
*/
vfunc_get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
vfunc_get_swipe_area(navigation_direction: NavigationDirection, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
*/
vfunc_get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
vfunc_switch_child(index: number, duration: 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;
// 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 PreferencesGroup {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
description: string;
title: string;
use_markup: boolean;
useMarkup: boolean;
}
}
/**
* A group of preference rows.
*
* A `HdyPreferencesGroup` represents a group or tightly related preferences,
* which in turn are represented by [class`PreferencesRow]`.
*
* To summarize the role of the preferences it gathers, a group can have both a
* title and a description. The title will be used by [class`PreferencesWindow]`
* to let the user look for a preference.
*
* ## CSS nodes
*
* `HdyPreferencesGroup` has a single CSS node with name `preferencesgroup`.
*/
class PreferencesGroup extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The description for this group of preferences.
*/
get description(): string;
set description(val: string);
/**
* The title for this group of preferences.
*/
get title(): string;
set title(val: string);
/**
* Whether to use markup for the title and description.
*/
get use_markup(): boolean;
set use_markup(val: boolean);
/**
* Whether to use markup for the title and description.
*/
get useMarkup(): boolean;
set useMarkup(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PreferencesGroup;
// Methods
get_description(): string;
/**
* Gets the title of `self`.
* @returns the title of @self
*/
get_title(): string;
/**
* Gets whether `self` uses markup for the title and description.
* @returns whether @self uses markup for its labels
*/
get_use_markup(): boolean;
/**
* Sets the description for `self`.
* @param description the description
*/
set_description(description: string): void;
/**
* Sets the title for `self`.
* @param title the title
*/
set_title(title: string): void;
/**
* Sets whether `self` uses markup for the title and description.
* @param use_markup whether to use markup
*/
set_use_markup(use_markup: 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 PreferencesPage {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
icon_name: string;
iconName: string;
title: string;
}
}
/**
* A page from [class`PreferencesWindow]`.
*
* The `HdyPreferencesPage` widget gathers preferences groups into a single page
* of a preferences window.
*
* ## CSS nodes
*
* `HdyPreferencesPage` has a single CSS node with name `preferencespage`.
*/
class PreferencesPage extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The icon name for this page of preferences.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The icon name for this page of preferences.
*/
get iconName(): string;
set iconName(val: string);
/**
* The title for this page of preferences.
*/
get title(): string;
set title(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PreferencesPage;
// Methods
/**
* Gets the icon name for `self`.
* @returns the icon name for @self
*/
get_icon_name(): string | null;
/**
* Gets the title of `self`.
* @returns the title of the @self
*/
get_title(): string | null;
/**
* Sets the icon name for `self`.
* @param icon_name the icon name
*/
set_icon_name(icon_name?: string | null): void;
/**
* Sets the title of `self`.
* @param title the title of the page
*/
set_title(title?: string | 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 PreferencesRow {
// Constructor properties interface
interface ConstructorProps
extends Gtk.ListBoxRow.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Actionable.ConstructorProps,
Gtk.Buildable.ConstructorProps {
title: string;
use_underline: boolean;
useUnderline: boolean;
}
}
/**
* A [class`Gtk`.ListBoxRow] used to present preferences.
*
* The `HdyPreferencesRow` widget has a title that [class`PreferencesWindow]`
* will use to let the user look for a preference. It doesn't present the title
* in any way and lets you present the preference as you please.
*
* [class`ActionRow]` and its derivatives are convenient to use as preference
* rows as they take care of presenting the preference's title while letting you
* compose the inputs of the preference around it.
*/
class PreferencesRow extends Gtk.ListBoxRow implements Atk.ImplementorIface, Gtk.Actionable, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The title of the preference represented by this row.
*/
get title(): string;
set title(val: string);
/**
* Whether an embedded underline in the title indicates a mnemonic.
*/
get use_underline(): boolean;
set use_underline(val: boolean);
/**
* Whether an embedded underline in the title indicates a mnemonic.
*/
get useUnderline(): boolean;
set useUnderline(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PreferencesRow;
// Methods
/**
* Gets the title of the preference represented by `self`.
* @returns the title of the preference represented by @self
*/
get_title(): string | null;
/**
* Gets whether an embedded underline in the title indicates a mnemonic.
* @returns whether an embedded underline in the title indicates a mnemonic
*/
get_use_underline(): boolean;
/**
* Sets the title of the preference represented by `self`.
* @param title the title
*/
set_title(title?: string | null): void;
/**
* Sets whether an embedded underline in the title indicates a mnemonic.
* @param use_underline `TRUE` if underlines in the text indicate mnemonics
*/
set_use_underline(use_underline: boolean): 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);
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;
/**
* 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 PreferencesWindow {
// Constructor properties interface
interface ConstructorProps
extends Window.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
can_swipe_back: boolean;
canSwipeBack: boolean;
search_enabled: boolean;
searchEnabled: boolean;
}
}
/**
* A window to present an application's preferences.
*
* The `HdyPreferencesWindow` widget presents an application's preferences
* gathered into pages and groups. The preferences are searchable by the user.
*
* ## CSS nodes
*
* `HdyPreferencesWindow` has a main CSS node with the name `window` and the
* style class `.preferences`.
*/
class PreferencesWindow extends Window implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* Whether the window allows closing the subpage via a swipe gesture.
*/
get can_swipe_back(): boolean;
set can_swipe_back(val: boolean);
/**
* Whether the window allows closing the subpage via a swipe gesture.
*/
get canSwipeBack(): boolean;
set canSwipeBack(val: boolean);
/**
* Whether search is enabled.
*/
get search_enabled(): boolean;
set search_enabled(val: boolean);
/**
* Whether search is enabled.
*/
get searchEnabled(): boolean;
set searchEnabled(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PreferencesWindow;
// Methods
/**
* Closes the current subpage.
*
* If there is no presented subpage, this does nothing.
*/
close_subpage(): void;
/**
* Gets whether swipe gestures allow switching from a subpage to the
* preferences.
* @returns `TRUE` if back swipe is enabled
*/
get_can_swipe_back(): boolean;
/**
* Gets whether search is enabled for `self`.
* @returns whether search is enabled for @self
*/
get_search_enabled(): boolean;
/**
* Sets `subpage` as the window's subpage and opens it.
*
* The transition can be cancelled by the user, in which case visible child will
* change back to the previously visible child.
* @param subpage the subpage
*/
present_subpage(subpage: Gtk.Widget): void;
/**
* Sets whether swipe gestures allow switching from a subpage to the
* preferences.
* @param can_swipe_back the new value
*/
set_can_swipe_back(can_swipe_back: boolean): void;
/**
* Sets whether search is enabled for `self`.
* @param search_enabled `TRUE` to enable search, `FALSE` to disable it
*/
set_search_enabled(search_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 SearchBar {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
search_mode_enabled: boolean;
searchModeEnabled: boolean;
show_close_button: boolean;
showCloseButton: boolean;
}
}
/**
* A toolbar to integrate a search entry with.
*
* `HdySearchBar` is a container made to have a search entry (possibly with
* additional connex widgets, such as drop-down menus, or buttons) built-in. The
* search bar would appear when a search is started through typing on the
* keyboard, or the application’s search mode is toggled on.
*
* For keyboard presses to start a search, events will need to be forwarded from
* the top-level window that contains the search bar. See
* [method`SearchBar`.handle_event] for example code. Common shortcuts such as
* Ctrl+F should be handled as an application action, or
* through the menu items.
*
* You will also need to tell the search bar about which entry you are using as
* your search entry using [method`SearchBar`.connect_entry]. The following
* example shows you how to create a more complex search entry.
*
* `HdySearchBar` is very similar to [class`Gtk`.SearchBar], the main difference
* being that it allows the search entry to fill all the available space. This
* allows you to control your search entry's width with a [class`Clamp]`.
*
* ## CSS nodes
*
* `HdySearchBar` has a single CSS node with name `searchbar`.
*/
class SearchBar extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* Whether the search mode is on and the search bar shown.
*/
get search_mode_enabled(): boolean;
set search_mode_enabled(val: boolean);
/**
* Whether the search mode is on and the search bar shown.
*/
get searchModeEnabled(): boolean;
set searchModeEnabled(val: boolean);
/**
* Whether to show the close button in the toolbar.
*/
get show_close_button(): boolean;
set show_close_button(val: boolean);
/**
* Whether to show the close button in the toolbar.
*/
get showCloseButton(): boolean;
set showCloseButton(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): SearchBar;
// Methods
/**
* Sets the entry widget passed as the one to be used in this search bar.
*
* The entry should be a descendant of the search bar. This is only required if
* the entry isn’t the direct child of the search bar (as in our main example).
* @param entry an entry
*/
connect_entry(entry: Gtk.Entry): void;
/**
* Gets whether the search mode is on.
* @returns whether search mode is toggled on
*/
get_search_mode(): boolean;
/**
* Gets whether the close button is shown.
* @returns whether the close button is shown
*/
get_show_close_button(): boolean;
/**
* Handles key press events.
*
* This function should be called when the top-level window which contains the
* search bar received a key event.
*
* If the key event is handled by the search bar, the bar will be shown, the
* entry populated with the entered text and `GDK_EVENT_STOP` will be returned.
* The caller should ensure that events are not propagated further.
*
* If no entry has been connected to the search bar, using
* [method`SearchBar`.connect_entry], this function will return immediately with
* a warning.
*
* ## Showing the search bar on key presses
*
* ```c
* static gboolean
* on_key_press_event (GtkWidget *widget,
* GdkEvent *event,
* gpointer user_data)
* {
* HdySearchBar *bar = HDY_SEARCH_BAR (user_data);
* return hdy_search_bar_handle_event (self, event);
* }
*
* static void
* create_toplevel (void)
* {
* GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
* GtkWindow *search_bar = hdy_search_bar_new ();
*
* // Add more widgets to the window...
*
* g_signal_connect (window,
* "key-press-event",
* G_CALLBACK (on_key_press_event),
* search_bar);
* }
* ```
* @param event a [struct@Gdk.Event] containing key press events
* @returns `GDK_EVENT_STOP` if the key press event resulted in text being entered in the search entry (and revealing the search bar if necessary), `GDK_EVENT_PROPAGATE` otherwise.
*/
handle_event(event: Gdk.Event): boolean;
/**
* Switches the search mode on or off.
* @param search_mode the new state of the search mode
*/
set_search_mode(search_mode: boolean): void;
/**
* Shows or hides the close button.
*
* Applications that already have a “search” toggle button should not show a
* close button in their search bar, as it duplicates the role of the toggle
* button.
* @param visible whether the close button will be shown or not
*/
set_show_close_button(visible: 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 Squeezer {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.Orientable.ConstructorProps {
homogeneous: boolean;
interpolate_size: boolean;
interpolateSize: boolean;
transition_duration: number;
transitionDuration: number;
transition_running: boolean;
transitionRunning: boolean;
transition_type: SqueezerTransitionType;
transitionType: SqueezerTransitionType;
visible_child: Gtk.Widget;
visibleChild: Gtk.Widget;
xalign: number;
yalign: number;
}
}
/**
* A best fit container.
*
* The `HdySqueezer` widget is a container which only shows the first of its
* children that fits in the available size. It is convenient to offer different
* widgets to represent the same data with different levels of detail, making
* the widget seem to squeeze itself to fit in the available space.
*
* Transitions between children can be animated as fades. This can be controlled
* with [method`Squeezer`.set_transition_type].
*
* ## CSS nodes
*
* `HdySqueezer` has a single CSS node with name `squeezer`.
*/
class Squeezer extends Gtk.Container implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* Whether all children have the same size for the opposite orientation.
*
* For example, if a squeezer is horizontal and is homogeneous, it will request
* the same height for all its children. If it isn't, the squeezer may change
* size when a different child becomes visible.
*/
get homogeneous(): boolean;
set homogeneous(val: boolean);
/**
* Whether the squeezer interpolates its size when changing the visible child.
*
* If `TRUE`, the squeezer will interpolate its size between the one of the
* previous visible child and the one of the new visible child, according to
* the set transition duration and the orientation, e.g. if the squeezer is
* horizontal, it will interpolate the its height.
*/
get interpolate_size(): boolean;
set interpolate_size(val: boolean);
/**
* Whether the squeezer interpolates its size when changing the visible child.
*
* If `TRUE`, the squeezer will interpolate its size between the one of the
* previous visible child and the one of the new visible child, according to
* the set transition duration and the orientation, e.g. if the squeezer is
* horizontal, it will interpolate the its height.
*/
get interpolateSize(): boolean;
set interpolateSize(val: boolean);
/**
* The animation duration, in milliseconds.
*/
get transition_duration(): number;
set transition_duration(val: number);
/**
* The animation duration, in milliseconds.
*/
get transitionDuration(): number;
set transitionDuration(val: number);
/**
* Whether a transition is currently running.
*/
get transition_running(): boolean;
/**
* Whether a transition is currently running.
*/
get transitionRunning(): boolean;
/**
* The type of animation used for transitions between children.
*
* Available types include various kinds of fades and slides.
*
* The transition type can be changed without problems at runtime, so it is
* possible to change the animation based on the child that is about to become
* current.
*/
get transition_type(): SqueezerTransitionType;
set transition_type(val: SqueezerTransitionType);
/**
* The type of animation used for transitions between children.
*
* Available types include various kinds of fades and slides.
*
* The transition type can be changed without problems at runtime, so it is
* possible to change the animation based on the child that is about to become
* current.
*/
get transitionType(): SqueezerTransitionType;
set transitionType(val: SqueezerTransitionType);
/**
* The currently visible child.
*/
get visible_child(): Gtk.Widget;
/**
* The currently visible child.
*/
get visibleChild(): Gtk.Widget;
/**
* The horizontal alignment, from 0 (start) to 1 (end).
*
* The xalign property determines the horizontal alignment of the children
* inside the squeezer's size allocation. Compare this to
* [property`Gtk`.Widget:halign], which determines how the squeezer's size
* allocation is positioned in the space available for the squeezer.
*
* This will affect the position of children too wide to fit in the squeezer
* as they are fading out.
*/
get xalign(): number;
set xalign(val: number);
/**
* The vertical alignment, from 0 (start) to 1 (end).
*
* The yalign property determines the vertical alignment of the children
* inside the squeezer's size allocation. Compare this to
* [property`Gtk`.Widget:valign], which determines how the squeezer's size
* allocation is positioned in the space available for the squeezer.
*
* This will affect the position of children too tall to fit in the squeezer
* as they are fading out.
*/
get yalign(): number;
set yalign(val: number);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Squeezer;
// Methods
/**
* Gets whether `child` is enabled.
*
* See [method`Squeezer`.set_child_enabled].
* @param child a child of @self
* @returns whether @child is enabled
*/
get_child_enabled(child: Gtk.Widget): boolean;
/**
* Gets whether `self` is homogeneous.
* @returns whether @self is homogeneous
*/
get_homogeneous(): boolean;
/**
* Gets whether `self` should interpolate its size on visible child change.
* @returns whether @self interpolates its size on visible child change
*/
get_interpolate_size(): boolean;
/**
* Gets the amount of time that transitions between children will take.
* @returns the transition duration, in milliseconds
*/
get_transition_duration(): number;
/**
* Gets whether a transition is currently running for `self`.
* @returns whether a transition is currently running
*/
get_transition_running(): boolean;
/**
* Gets the animation type that will be used for transitions between children.
* @returns the current transition type of @self
*/
get_transition_type(): SqueezerTransitionType;
/**
* Gets the currently visible child of `self`.
* @returns the visible child
*/
get_visible_child(): Gtk.Widget | null;
/**
* Gets the horizontal alignment.
* @returns the xalign property
*/
get_xalign(): number;
/**
* Gets the vertical alignment.
* @returns the yalign property
*/
get_yalign(): number;
/**
* Sets whether `child` is enabled.
*
* If a child is disabled, it will be ignored when looking for the child fitting
* the available size best. This allows to programmatically and prematurely hide
* a child of `self` even if it fits in the available space.
*
* This can be used e.g. to ensure a certain child is hidden below a certain
* window width, or any other constraint you find suitable.
* @param child a child of @self
* @param enabled whether to enable the child
*/
set_child_enabled(child: Gtk.Widget, enabled: boolean): void;
/**
* Sets whether all children have the same size for the opposite orientation.
* @param homogeneous `TRUE` to make @self homogeneous
*/
set_homogeneous(homogeneous: boolean): void;
/**
* Sets whether `self` should interpolate its size on visible child change.
* @param interpolate_size `TRUE` to interpolate the size
*/
set_interpolate_size(interpolate_size: boolean): void;
/**
* Sets the duration that transitions between children in `self` will take.
* @param duration the new duration, in milliseconds
*/
set_transition_duration(duration: number): void;
/**
* Sets the animation type that will be used for transitions between children.
* @param transition the new transition type
*/
set_transition_type(transition: SqueezerTransitionType | null): void;
/**
* Sets the horizontal alignment.
* @param xalign the new xalign value, between 0 and 1
*/
set_xalign(xalign: number): void;
/**
* Sets the vertical alignment.
* @param yalign the new yalign value, between 0 and 1
*/
set_yalign(yalign: 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 StatusPage {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
description: string;
icon_name: string;
iconName: string;
title: string;
}
}
/**
* A page used for empty/error states and similar use-cases.
*
* The `HdyStatusPage` widget can have an icon, a title, a description and a
* custom widget which is displayed below them.
*
* ## CSS nodes
*
* `HdyStatusPage` has a main CSS node with name `statuspage`.
*/
class StatusPage extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The description to be displayed below the title.
*/
get description(): string;
set description(val: string);
/**
* The name of the icon to be used.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The name of the icon to be used.
*/
get iconName(): string;
set iconName(val: string);
/**
* The title to be displayed below the icon.
*/
get title(): string;
set title(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): StatusPage;
// Methods
/**
* Gets the description for `self`.
* @returns the description for @self
*/
get_description(): string | null;
/**
* Gets the icon name for `self`.
* @returns the icon name for @self
*/
get_icon_name(): string | null;
/**
* Gets the title for `self`.
* @returns the title for @self
*/
get_title(): string | null;
/**
* Sets the description for `self`.
* @param description the description
*/
set_description(description?: string | null): void;
/**
* Sets the icon name for `self`.
* @param icon_name the icon name
*/
set_icon_name(icon_name?: string | null): void;
/**
* Sets the title for `self`.
* @param title the title
*/
set_title(title?: string | 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 StyleManager {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
color_scheme: ColorScheme;
colorScheme: ColorScheme;
dark: boolean;
display: Gdk.Display;
high_contrast: boolean;
highContrast: boolean;
system_supports_color_schemes: boolean;
systemSupportsColorSchemes: boolean;
}
}
/**
* A class for managing application-wide styling.
*
* `HdyStyleManager` provides a way to query and influence the application
* styles, such as whether to use dark or high contrast appearance.
*
* It allows to set the color scheme via the
* [property`StyleManager:`color-scheme] property, and to query the current
* appearance, as well as whether a system-wide color scheme preference exists.
*
* Important: [property`Gtk`.Settings:gtk-application-prefer-dark-theme] should
* not be used together with `HdyStyleManager` and will result in a warning.
* Color schemes should be used instead.
*/
class StyleManager extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The requested application color scheme.
*
* The effective appearance will be decided based on the application color
* scheme and the system preferred color scheme. The
* [property`StyleManager:`dark] property can be used to query the current
* effective appearance.
*
* The `HDY_COLOR_SCHEME_PREFER_LIGHT` color scheme results in the application
* using light appearance unless the system prefers dark colors. This is the
* default value.
*
* The `HDY_COLOR_SCHEME_PREFER_DARK` color scheme results in the application
* using dark appearance, but can still switch to the light appearance if the
* system can prefers it, for example, when the high contrast preference is
* enabled.
*
* The `HDY_COLOR_SCHEME_FORCE_LIGHT` and `HDY_COLOR_SCHEME_FORCE_DARK` values
* ignore the system preference entirely, they are useful if the application
* wants to match its UI to its content or to provide a separate color scheme
* switcher.
*
* If a per-[class`Gdk`.Display] style manager has its color scheme set to
* `HDY_COLOR_SCHEME_DEFAULT`, it will inherit the color scheme from the
* default style manager.
*
* For the default style manager, `HDY_COLOR_SCHEME_DEFAULT` is equivalent to
* `HDY_COLOR_SCHEME_FORCE_LIGHT`.
*
* The [property`StyleManager:`system-supports-color-schemes] property can be
* used to check if the current environment provides a color scheme
* preference.
*/
get color_scheme(): ColorScheme;
set color_scheme(val: ColorScheme);
/**
* The requested application color scheme.
*
* The effective appearance will be decided based on the application color
* scheme and the system preferred color scheme. The
* [property`StyleManager:`dark] property can be used to query the current
* effective appearance.
*
* The `HDY_COLOR_SCHEME_PREFER_LIGHT` color scheme results in the application
* using light appearance unless the system prefers dark colors. This is the
* default value.
*
* The `HDY_COLOR_SCHEME_PREFER_DARK` color scheme results in the application
* using dark appearance, but can still switch to the light appearance if the
* system can prefers it, for example, when the high contrast preference is
* enabled.
*
* The `HDY_COLOR_SCHEME_FORCE_LIGHT` and `HDY_COLOR_SCHEME_FORCE_DARK` values
* ignore the system preference entirely, they are useful if the application
* wants to match its UI to its content or to provide a separate color scheme
* switcher.
*
* If a per-[class`Gdk`.Display] style manager has its color scheme set to
* `HDY_COLOR_SCHEME_DEFAULT`, it will inherit the color scheme from the
* default style manager.
*
* For the default style manager, `HDY_COLOR_SCHEME_DEFAULT` is equivalent to
* `HDY_COLOR_SCHEME_FORCE_LIGHT`.
*
* The [property`StyleManager:`system-supports-color-schemes] property can be
* used to check if the current environment provides a color scheme
* preference.
*/
get colorScheme(): ColorScheme;
set colorScheme(val: ColorScheme);
/**
* Whether the application is using dark appearance.
*
* This property can be used to query the current appearance, as requested via
* [property`StyleManager:`color-scheme].
*/
get dark(): boolean;
/**
* The display the style manager is associated with.
*
* The display will be `NULL` for the style manager returned by
* [func`StyleManager`.get_default].
*/
get display(): Gdk.Display;
/**
* Whether the application is using high contrast appearance.
*
* This cannot be overridden by applications.
*/
get high_contrast(): boolean;
/**
* Whether the application is using high contrast appearance.
*
* This cannot be overridden by applications.
*/
get highContrast(): boolean;
/**
* Whether the system supports color schemes.
*
* This property can be used to check if the current environment provides a
* color scheme preference. For example, applications might want to show a
* separate appearance switcher if it's set to `FALSE`.
*
* It's only set at startup and cannot change its value later.
*
* See [property`StyleManager:`color-scheme].
*/
get system_supports_color_schemes(): boolean;
/**
* Whether the system supports color schemes.
*
* This property can be used to check if the current environment provides a
* color scheme preference. For example, applications might want to show a
* separate appearance switcher if it's set to `FALSE`.
*
* It's only set at startup and cannot change its value later.
*
* See [property`StyleManager:`color-scheme].
*/
get systemSupportsColorSchemes(): boolean;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Gets the default [class`StyleManager]` instance.
*
* It manages all [class`Gdk`.Display] instances unless the style manager for
* that display has an override.
*
* See [func`StyleManager`.get_for_display].
*/
static get_default(): StyleManager;
/**
* Gets the [class`StyleManager]` instance managing `display`.
*
* It can be used to override styles for that specific display instead of the
* whole application.
*
* Most applications should use [func`StyleManager`.get_default] instead.
* @param display a display
*/
static get_for_display(display: Gdk.Display): StyleManager;
// Methods
/**
* Gets the requested application color scheme.
* @returns the color scheme
*/
get_color_scheme(): ColorScheme;
/**
* Gets whether the application is using dark appearance.
* @returns whether the application is using dark appearance
*/
get_dark(): boolean;
/**
* Gets the display the style manager is associated with.
*
* The display will be `NULL` for the style manager returned by
* [func`StyleManager`.get_default].
* @returns (nullable): the display
*/
get_display(): Gdk.Display;
/**
* Gets whether the application is using high contrast appearance.
* @returns whether the application is using high contrast appearance
*/
get_high_contrast(): boolean;
/**
* Gets whether the system supports color schemes.
* @returns whether the system supports color schemes
*/
get_system_supports_color_schemes(): boolean;
/**
* Sets the requested application color scheme.
*
* The effective appearance will be decided based on the application color
* scheme and the system preferred color scheme. The
* [property`StyleManager:`dark] property can be used to query the current
* effective appearance.
* @param color_scheme the color scheme
*/
set_color_scheme(color_scheme: ColorScheme | null): void;
}
namespace SwipeGroup {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gtk.Buildable.ConstructorProps {}
}
/**
* An object for syncing swipeable widgets.
*
* The `HdySwipeGroup` object can be used to sync multiple swipeable widgets
* that implement the [iface`Swipeable]` interface, such as [class`Carousel]`, so
* that animating one of them also animates all the other widgets in the group.
*
* This can be useful for syncing widgets between a window's titlebar and
* content area.
*
* ## HdySwipeGroup as GtkBuildable
*
* `HdySwipeGroup` can be created in an UI definition. The list of swipeable
* widgets is specified with a <swipeables> element containing multiple
* <swipeable> elements with their ”name” attribute specifying the id of
* the widgets.
*
* ```xml
*
* ```
*
* `HdySwipeGroup` has been deprecated, [class`Window]` and
* [class`ApplicationWindow]` allow using a single leaflet for both content and
* header bar, without the need to sync them.
*/
class SwipeGroup extends GObject.Object implements Gtk.Buildable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): SwipeGroup;
// Methods
/**
* Adds a swipeable to `self`.
*
* When the widget is destroyed or no longer referenced elsewhere, it will be
* removed from the swipe group.
* @param swipeable the [iface@Swipeable] to add
*/
add_swipeable(swipeable: Swipeable): void;
/**
* Gets the list of swipeables associated with `self`.
* @returns a list of swipeables
*/
get_swipeables(): Swipeable[];
/**
* Removes a widget from a [class`SwipeGroup]`.
* @param swipeable the [iface@Swipeable] to remove
*/
remove_swipeable(swipeable: Swipeable): 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 SwipeTracker {
// Signal callback interfaces
interface BeginSwipe {
(direction: NavigationDirection, direct: boolean): void;
}
interface EndSwipe {
(duration: number, to: number): void;
}
interface UpdateSwipe {
(progress: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gtk.Orientable.ConstructorProps {
allow_long_swipes: boolean;
allowLongSwipes: boolean;
allow_mouse_drag: boolean;
allowMouseDrag: boolean;
enabled: boolean;
reversed: boolean;
swipeable: Swipeable;
}
}
/**
* Swipe tracker used in [class`Carousel]` and [class`Leaflet]`.
*
* The `HdySwipeTracker` object can be used for implementing widgets with swipe
* gestures. It supports touch-based swipes, pointer dragging, and touchpad
* scrolling.
*
* The widgets will probably want to expose [property`SwipeTracker:`enabled]
* property. If they expect to use horizontal orientation,
* [property`SwipeTracker:`reversed] property can be used for supporting RTL text
* direction.
*/
class SwipeTracker extends GObject.Object implements Gtk.Orientable {
static $gtype: GObject.GType;
// Properties
/**
* Whether to allow swiping for more than one snap point at a time.
*
* If the value is `FALSE`, each swipe can only move to the adjacent snap
* points.
*/
get allow_long_swipes(): boolean;
set allow_long_swipes(val: boolean);
/**
* Whether to allow swiping for more than one snap point at a time.
*
* If the value is `FALSE`, each swipe can only move to the adjacent snap
* points.
*/
get allowLongSwipes(): boolean;
set allowLongSwipes(val: boolean);
/**
* Whether to allow dragging with mouse pointer.
*
* This should usually be `FALSE`.
*/
get allow_mouse_drag(): boolean;
set allow_mouse_drag(val: boolean);
/**
* Whether to allow dragging with mouse pointer.
*
* This should usually be `FALSE`.
*/
get allowMouseDrag(): boolean;
set allowMouseDrag(val: boolean);
/**
* Whether the swipe tracker is enabled.
*
* When it's not enabled, no events will be processed. Usually widgets will
* want to expose this via a property.
*/
get enabled(): boolean;
set enabled(val: boolean);
/**
* Whether to reverse the swipe direction.
*
* If the swipe tracker is horizontal, it can be used for supporting RTL text
* direction.
*/
get reversed(): boolean;
set reversed(val: boolean);
/**
* The widget the swipe tracker is attached to. Must not be `NULL`.
*/
get swipeable(): Swipeable;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](swipeable: Swipeable): SwipeTracker;
// 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: 'begin-swipe',
callback: (_source: this, direction: NavigationDirection, direct: boolean) => void,
): number;
connect_after(
signal: 'begin-swipe',
callback: (_source: this, direction: NavigationDirection, direct: boolean) => void,
): number;
emit(signal: 'begin-swipe', direction: NavigationDirection, direct: boolean): void;
connect(signal: 'end-swipe', callback: (_source: this, duration: number, to: number) => void): number;
connect_after(signal: 'end-swipe', callback: (_source: this, duration: number, to: number) => void): number;
emit(signal: 'end-swipe', duration: number, to: number): void;
connect(signal: 'update-swipe', callback: (_source: this, progress: number) => void): number;
connect_after(signal: 'update-swipe', callback: (_source: this, progress: number) => void): number;
emit(signal: 'update-swipe', progress: number): void;
// Methods
/**
* Whether to allow swiping for more than one snap point at a time.
*
* If the value is `FALSE`, each swipe can only move to the adjacent snap
* points.
* @returns whether long swipes are allowed
*/
get_allow_long_swipes(): boolean;
/**
* Get whether `self` can be dragged with mouse pointer.
* @returns `TRUE` is mouse dragging is allowed
*/
get_allow_mouse_drag(): boolean;
/**
* Get whether `self` is enabled.
* @returns `TRUE` if @self is enabled
*/
get_enabled(): boolean;
/**
* Get whether `self` is reversing the swipe direction.
* @returns `TRUE` is the direction is reversed
*/
get_reversed(): boolean;
/**
* Get `self'`s swipeable widget.
* @returns the swipeable widget
*/
get_swipeable(): Swipeable;
/**
* Sets whether to allow swiping for more than one snap point at a time.
*
* If the value is `FALSE`, each swipe can only move to the adjacent snap
* points.
* @param allow_long_swipes whether to allow long swipes
*/
set_allow_long_swipes(allow_long_swipes: boolean): void;
/**
* Set whether `self` can be dragged with mouse pointer.
*
* This should usually be `FALSE`.
* @param allow_mouse_drag whether to allow mouse dragging
*/
set_allow_mouse_drag(allow_mouse_drag: boolean): void;
/**
* Set whether `self` is enabled.
* @param enabled whether to enable to swipe tracker
*/
set_enabled(enabled: boolean): void;
/**
* Set whether to reverse the swipe direction.
*
* If `self` is horizontal, can be used for supporting RTL text direction.
* @param reversed whether to reverse the swipe direction
*/
set_reversed(reversed: boolean): void;
/**
* Move the current progress value by `delta`.
*
* This can be used to adjust the current position if snap points move during
* the gesture.
* @param delta the position delta
*/
shift_position(delta: 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 TabBar {
// Signal callback interfaces
interface ExtraDragDataReceived {
(page: TabPage, context: Gdk.DragContext, data: Gtk.SelectionData, info: number, time: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
autohide: boolean;
end_action_widget: Gtk.Widget;
endActionWidget: Gtk.Widget;
expand_tabs: boolean;
expandTabs: boolean;
extra_drag_dest_targets: Gtk.TargetList;
extraDragDestTargets: Gtk.TargetList;
inverted: boolean;
is_overflowing: boolean;
isOverflowing: boolean;
start_action_widget: Gtk.Widget;
startActionWidget: Gtk.Widget;
tabs_revealed: boolean;
tabsRevealed: boolean;
view: TabView;
}
}
/**
* A tab bar for [class`TabView]`.
*
* The `HdyTabBar` widget is a tab bar that can be used with conjunction with
* [class`TabView]`.
*
* `HdyTabBar` can autohide and can optionally contain action widgets on both
* sides of the tabs.
*
* When there's not enough space to show all the tabs, `HdyTabBar` will scroll
* them. Pinned tabs always stay visible and aren't a part of the scrollable
* area.
*
* ## CSS nodes
*
* `HdyTabBar` has a single CSS node with name `tabbar`.
*/
class TabBar extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* Whether tabs automatically hide.
*
* If set to `TRUE`, the tab bar disappears when the associated
* [class`TabView]` has 0 or 1 tab, no pinned tabs, and no tab is being
* transferred.
*
* See [property`TabBar:`tabs-revealed].
*/
get autohide(): boolean;
set autohide(val: boolean);
/**
* The widget shown after the tabs.
*/
get end_action_widget(): Gtk.Widget;
set end_action_widget(val: Gtk.Widget);
/**
* The widget shown after the tabs.
*/
get endActionWidget(): Gtk.Widget;
set endActionWidget(val: Gtk.Widget);
/**
* Whether tabs should expand.
*
* If set to `TRUE`, the tabs will always vary width filling the whole width
* when possible, otherwise tabs will always have the minimum possible size.
*/
get expand_tabs(): boolean;
set expand_tabs(val: boolean);
/**
* Whether tabs should expand.
*
* If set to `TRUE`, the tabs will always vary width filling the whole width
* when possible, otherwise tabs will always have the minimum possible size.
*/
get expandTabs(): boolean;
set expandTabs(val: boolean);
/**
* Extra drag destination targets.
*
* Allows to drag arbitrary content onto tabs, for example URLs in a web
* browser.
*
* If a tab is hovered for a certain period of time while dragging the
* content, it will be automatically selected.
*
* After content is dropped, the [signal`TabBar:`:extra-drag-data-received]
* signal can be used to retrieve and process the drag data.
*/
get extra_drag_dest_targets(): Gtk.TargetList;
set extra_drag_dest_targets(val: Gtk.TargetList);
/**
* Extra drag destination targets.
*
* Allows to drag arbitrary content onto tabs, for example URLs in a web
* browser.
*
* If a tab is hovered for a certain period of time while dragging the
* content, it will be automatically selected.
*
* After content is dropped, the [signal`TabBar:`:extra-drag-data-received]
* signal can be used to retrieve and process the drag data.
*/
get extraDragDestTargets(): Gtk.TargetList;
set extraDragDestTargets(val: Gtk.TargetList);
/**
* Whether tabs use inverted layout.
*
* If set to `TRUE`, non-pinned tabs will have the close button at the
* beginning and the indicator at the end rather than the opposite.
*/
get inverted(): boolean;
set inverted(val: boolean);
/**
* Whether the tab bar is overflowing.
*
* If set to `TRUE`, all tabs cannot be displayed at once and require
* scrolling.
*/
get is_overflowing(): boolean;
/**
* Whether the tab bar is overflowing.
*
* If set to `TRUE`, all tabs cannot be displayed at once and require
* scrolling.
*/
get isOverflowing(): boolean;
/**
* The widget shown before the tabs.
*/
get start_action_widget(): Gtk.Widget;
set start_action_widget(val: Gtk.Widget);
/**
* The widget shown before the tabs.
*/
get startActionWidget(): Gtk.Widget;
set startActionWidget(val: Gtk.Widget);
/**
* Whether tabs are currently revealed.
*
* See [property`TabBar:`autohide].
*/
get tabs_revealed(): boolean;
/**
* Whether tabs are currently revealed.
*
* See [property`TabBar:`autohide].
*/
get tabsRevealed(): boolean;
/**
* The [class`TabView]` the tab bar controls.
*/
get view(): TabView;
set view(val: TabView);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TabBar;
// 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: 'extra-drag-data-received',
callback: (
_source: this,
page: TabPage,
context: Gdk.DragContext,
data: Gtk.SelectionData,
info: number,
time: number,
) => void,
): number;
connect_after(
signal: 'extra-drag-data-received',
callback: (
_source: this,
page: TabPage,
context: Gdk.DragContext,
data: Gtk.SelectionData,
info: number,
time: number,
) => void,
): number;
emit(
signal: 'extra-drag-data-received',
page: TabPage,
context: Gdk.DragContext,
data: Gtk.SelectionData,
info: number,
time: number,
): void;
// Methods
/**
* Gets whether the tabs automatically hide.
* @returns whether the tabs automatically hide
*/
get_autohide(): boolean;
/**
* Gets the widget shown after the tabs.
* @returns the widget shown after the tabs
*/
get_end_action_widget(): Gtk.Widget | null;
/**
* Gets whether tabs should expand.
* @returns whether tabs should expand
*/
get_expand_tabs(): boolean;
/**
* Gets extra drag destination targets.
* @returns extra drag targets
*/
get_extra_drag_dest_targets(): Gtk.TargetList | null;
/**
* Gets whether tabs use inverted layout.
* @returns whether tabs use inverted layout
*/
get_inverted(): boolean;
/**
* Gets whether `self` is overflowing.
* @returns whether @self is overflowing
*/
get_is_overflowing(): boolean;
/**
* Gets the widget shown before the tabs.
* @returns the widget shown before the tabs
*/
get_start_action_widget(): Gtk.Widget | null;
/**
* Gets the value of the [property`TabBar:`tabs-revealed] property.
* @returns whether the tabs are current revealed
*/
get_tabs_revealed(): boolean;
/**
* Gets the [class`TabView]` `self` controls.
* @returns the [class@TabView] @self controls
*/
get_view(): TabView | null;
/**
* Sets whether the tabs automatically hide.
*
* If `autohide` is `TRUE`, the tab bar disappears when the associated
* [class`TabView]` has 0 or 1 tab, no pinned tabs, and no tab is being
* transferred.
*
* Autohide is enabled by default.
*
* See [property`TabBar:`tabs-revealed].
* @param autohide whether the tabs automatically hide
*/
set_autohide(autohide: boolean): void;
/**
* Sets the widget to show after the tabs.
* @param widget the widget to show after the tabs
*/
set_end_action_widget(widget?: Gtk.Widget | null): void;
/**
* Sets whether tabs should expand.
*
* If `expand_tabs` is `TRUE`, the tabs will always vary width filling the whole
* width when possible, otherwise tabs will always have the minimum possible
* size.
*
* Expand is enabled by default.
* @param expand_tabs whether to expand tabs
*/
set_expand_tabs(expand_tabs: boolean): void;
/**
* Sets extra drag destination targets.
*
* This allows to drag arbitrary content onto tabs, for example URLs in a web
* browser.
*
* If a tab is hovered for a certain period of time while dragging the content,
* it will be automatically selected.
*
* After content is dropped, the [signal`TabBar:`:extra-drag-data-received]
* signal can be used to retrieve and process the drag data.
* @param extra_drag_dest_targets extra drag targets
*/
set_extra_drag_dest_targets(extra_drag_dest_targets?: Gtk.TargetList | null): void;
/**
* Sets whether tabs tabs use inverted layout.
*
* If `inverted` is `TRUE`, non-pinned tabs will have the close button at the
* beginning and the indicator at the end rather than the opposite.
* @param inverted whether tabs use inverted layout
*/
set_inverted(inverted: boolean): void;
/**
* Sets the widget to show before the tabs.
* @param widget the widget to show before the tabs
*/
set_start_action_widget(widget?: Gtk.Widget | null): void;
/**
* Sets the [class`TabView]` `self` controls.
* @param view a tab view
*/
set_view(view?: TabView | 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 TabPage {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
child: Gtk.Widget;
icon: Gio.Icon;
indicator_activatable: boolean;
indicatorActivatable: boolean;
indicator_icon: Gio.Icon;
indicatorIcon: Gio.Icon;
loading: boolean;
needs_attention: boolean;
needsAttention: boolean;
parent: TabPage;
pinned: boolean;
selected: boolean;
title: string;
tooltip: string;
}
}
/**
* An auxiliary class used by [class`TabView]`.
*/
class TabPage extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The child of the page.
*/
get child(): Gtk.Widget;
/**
* The icon of the page.
*
* [class`TabBar]` displays the icon next to the title.
*
* It will not show the icon if [property`TabPage:`loading] is set to `TRUE`,
* or if the page is pinned and [propertyTabPage:indicator-icon] is set.
*/
get icon(): Gio.Icon;
set icon(val: Gio.Icon);
/**
* Whether the indicator icon is activatable.
*
* If set to `TRUE`, [signal`TabView:`:indicator-activated] will be emitted
* when the indicator icon is clicked.
*
* If [property`TabPage:`indicator-icon] is not set, does nothing.
*/
get indicator_activatable(): boolean;
set indicator_activatable(val: boolean);
/**
* Whether the indicator icon is activatable.
*
* If set to `TRUE`, [signal`TabView:`:indicator-activated] will be emitted
* when the indicator icon is clicked.
*
* If [property`TabPage:`indicator-icon] is not set, does nothing.
*/
get indicatorActivatable(): boolean;
set indicatorActivatable(val: boolean);
/**
* An indicator icon for the page.
*
* A common use case is an audio or camera indicator in a web browser.
*
* [class`TabPage]` will show it at the beginning of the tab, alongside icon
* representing [property`TabPage:`icon] or loading spinner.
*
* If the page is pinned, the indicator will be shown instead of icon or
* spinner.
*
* If [property`TabPage:`indicator-activatable] is set to `TRUE`, the indicator
* icon can act as a button.
*/
get indicator_icon(): Gio.Icon;
set indicator_icon(val: Gio.Icon);
/**
* An indicator icon for the page.
*
* A common use case is an audio or camera indicator in a web browser.
*
* [class`TabPage]` will show it at the beginning of the tab, alongside icon
* representing [property`TabPage:`icon] or loading spinner.
*
* If the page is pinned, the indicator will be shown instead of icon or
* spinner.
*
* If [property`TabPage:`indicator-activatable] is set to `TRUE`, the indicator
* icon can act as a button.
*/
get indicatorIcon(): Gio.Icon;
set indicatorIcon(val: Gio.Icon);
/**
* Whether the page is loading.
*
* If set to `TRUE`, [class`TabBar]` will display a spinner in place of icon.
*
* If the page is pinned and [property`TabPage:`indicator-icon] is set, the
* loading status will not be visible.
*/
get loading(): boolean;
set loading(val: boolean);
/**
* Whether the page needs attention.
*
* [class`TabBar]` will display a glow under the tab representing the page if
* set to `TRUE`. If the tab is not visible, the corresponding edge of the tab
* bar will be highlighted.
*/
get needs_attention(): boolean;
set needs_attention(val: boolean);
/**
* Whether the page needs attention.
*
* [class`TabBar]` will display a glow under the tab representing the page if
* set to `TRUE`. If the tab is not visible, the corresponding edge of the tab
* bar will be highlighted.
*/
get needsAttention(): boolean;
set needsAttention(val: boolean);
/**
* The parent page of the page.
*
* See [method`TabView`.add_page] and [method`TabView`.close_page].
*/
get parent(): TabPage;
/**
* Whether the page is pinned.
*
* See [method`TabView`.set_page_pinned].
*/
get pinned(): boolean;
/**
* Whether the page is selected.
*/
get selected(): boolean;
/**
* The title of the page.
*
* [class`TabBar]` will display it in the center of the tab unless it's pinned,
* and will use it as a tooltip unless [property`TabPage:`tooltip] is set.
*/
get title(): string;
set title(val: string);
/**
* The tooltip of the page.
*
* The tooltip can be marked up with the Pango text markup language.
*
* If not set, [class`TabBar]` will use [property`TabPage:`title] as a tooltip
* instead.
*/
get tooltip(): string;
set tooltip(val: string);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets the child of `self`.
* @returns the child of @self
*/
get_child(): Gtk.Widget;
/**
* Gets the icon of `self`.
* @returns the icon of @self
*/
get_icon(): Gio.Icon | null;
/**
* Gets whether the indicator of `self` is activatable.
* @returns whether the indicator is activatable
*/
get_indicator_activatable(): boolean;
/**
* Gets the indicator icon of `self`.
* @returns the indicator icon of @self
*/
get_indicator_icon(): Gio.Icon | null;
/**
* Gets whether `self` is loading.
* @returns whether @self is loading
*/
get_loading(): boolean;
/**
* Gets whether `self` needs attention.
* @returns whether @self needs attention
*/
get_needs_attention(): boolean;
/**
* Gets the parent page of `self`.
* @returns the parent page of @self
*/
get_parent(): TabPage | null;
/**
* Gets whether `self` is pinned.
* @returns whether @self is pinned
*/
get_pinned(): boolean;
/**
* Gets whether `self` is selected.
* @returns whether @self is selected
*/
get_selected(): boolean;
/**
* Gets the title of `self`.
* @returns the title of @self
*/
get_title(): string | null;
/**
* Gets the tooltip of `self`.
* @returns the tooltip of @self
*/
get_tooltip(): string | null;
/**
* Sets the icon of `self`.
* @param icon the icon of @self
*/
set_icon(icon?: Gio.Icon | null): void;
/**
* Sets whether the indicator of `self` is activatable.
* @param activatable whether the indicator is activatable
*/
set_indicator_activatable(activatable: boolean): void;
/**
* Sets the indicator icon of `self`.
* @param indicator_icon the indicator icon of @self
*/
set_indicator_icon(indicator_icon?: Gio.Icon | null): void;
/**
* Sets whether `self` is loading.
* @param loading whether @self is loading
*/
set_loading(loading: boolean): void;
/**
* Sets whether `self` needs attention.
* @param needs_attention whether @self needs attention
*/
set_needs_attention(needs_attention: boolean): void;
/**
* Sets the title of `self`.
* @param title the title of @self
*/
set_title(title?: string | null): void;
/**
* Sets the tooltip of `self`.
* @param tooltip the tooltip of @self
*/
set_tooltip(tooltip?: string | null): void;
}
namespace TabView {
// Signal callback interfaces
interface ClosePage {
(page: TabPage): boolean;
}
interface CreateWindow {
(): TabView | null;
}
interface IndicatorActivated {
(page: TabPage): void;
}
interface PageAttached {
(page: TabPage, position: number): void;
}
interface PageDetached {
(page: TabPage, position: number): void;
}
interface PageReordered {
(page: TabPage, position: number): void;
}
interface SetupMenu {
(page: TabPage): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
default_icon: Gio.Icon;
defaultIcon: Gio.Icon;
is_transferring_page: boolean;
isTransferringPage: boolean;
menu_model: Gio.MenuModel;
menuModel: Gio.MenuModel;
n_pages: number;
nPages: number;
n_pinned_pages: number;
nPinnedPages: number;
selected_page: TabPage;
selectedPage: TabPage;
shortcut_widget: Gtk.Widget;
shortcutWidget: Gtk.Widget;
}
}
/**
* A dynamic tabbed container.
*
* `HdyTabView` is a container which shows one child at a time. While it
* provides keyboard shortcuts for switching between pages, it does not provide
* a visible tab bar and relies on external widgets for that, such as
* [class`TabBar]`.
*
* `HdyTabView` maintains a [class`TabPage]` object for each page,which holds
* additional per-page properties. You can obtain the [class`TabPage]` for a page
* with [method`TabView`.get_page], and as return value for
* [method`TabView`.append] and other functions for adding children.
*
* `HdyTabView` only aims to be useful for dynamic tabs in multi-window
* document-based applications, such as web browsers, file managers, text
* editors or terminals. It does not aim to replace [class`Gtk`.Notebook] for use
* cases such as tabbed dialogs.
*
* As such, it does not support disabling page reordering or detaching, or
* adding children via [iface`Gtk`.Buildable].
*
* ## CSS nodes
*
* `HdyTabView` has a main CSS node with the name `tabview`.
*
* It contains the subnode overlay, which contains subnodes stack and widget.
* The stack subnode contains the added pages.
*
* ```
* tabview
* ╰── overlay
* ├── stack
* │ ╰── [ Children ]
* ╰── widget
* ```
*/
class TabView extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* Default page icon.
*
* If a page doesn't provide its own icon via [property`TabPage:`icon], default
* icon may be used instead for contexts where having an icon is necessary.
*
* [class`TabBar]` will use default icon for pinned tabs in case the page is
* not loading, doesn't have an icon and an indicator. Default icon is never
* used for tabs that aren't pinned.
*/
get default_icon(): Gio.Icon;
set default_icon(val: Gio.Icon);
/**
* Default page icon.
*
* If a page doesn't provide its own icon via [property`TabPage:`icon], default
* icon may be used instead for contexts where having an icon is necessary.
*
* [class`TabBar]` will use default icon for pinned tabs in case the page is
* not loading, doesn't have an icon and an indicator. Default icon is never
* used for tabs that aren't pinned.
*/
get defaultIcon(): Gio.Icon;
set defaultIcon(val: Gio.Icon);
/**
* Whether a page is being transferred.
*
* This property will be set to `TRUE` when a drag-n-drop tab transfer starts
* on any [class`TabView]`, and to `FALSE` after it ends.
*
* During the transfer, children cannot receive pointer input and a tab can be
* safely dropped on the tab view.
*/
get is_transferring_page(): boolean;
/**
* Whether a page is being transferred.
*
* This property will be set to `TRUE` when a drag-n-drop tab transfer starts
* on any [class`TabView]`, and to `FALSE` after it ends.
*
* During the transfer, children cannot receive pointer input and a tab can be
* safely dropped on the tab view.
*/
get isTransferringPage(): boolean;
/**
* Tab context menu model.
*
* When a context menu is shown for a tab, it will be constructed from the
* provided menu model. Use [signal`TabView:`:setup-menu] signal to set up the
* menu actions for the particular tab.
*/
get menu_model(): Gio.MenuModel;
set menu_model(val: Gio.MenuModel);
/**
* Tab context menu model.
*
* When a context menu is shown for a tab, it will be constructed from the
* provided menu model. Use [signal`TabView:`:setup-menu] signal to set up the
* menu actions for the particular tab.
*/
get menuModel(): Gio.MenuModel;
set menuModel(val: Gio.MenuModel);
/**
* The number of pages in the tab view.
*/
get n_pages(): number;
/**
* The number of pages in the tab view.
*/
get nPages(): number;
/**
* The number of pinned pages in the tab view.
*
* See [method`TabView`.set_page_pinned].
*/
get n_pinned_pages(): number;
/**
* The number of pinned pages in the tab view.
*
* See [method`TabView`.set_page_pinned].
*/
get nPinnedPages(): number;
/**
* The currently selected page.
*/
get selected_page(): TabPage;
set selected_page(val: TabPage);
/**
* The currently selected page.
*/
get selectedPage(): TabPage;
set selectedPage(val: TabPage);
/**
* Tab shortcut widget.
*
* Has the following shortcuts:
*
* * Ctrl+Page Up - switch to the previous page
* * Ctrl+Page Down - switch to the next page
* * Ctrl+Home - switch to the first page
* * Ctrl+End - switch to the last page
* * Ctrl+Shift+Page Up - move the current page
* backward
* * Ctrl+Shift+Page Down - move the current
* page forward
* * Ctrl+Shift+Home - move the current page at
* the start
* * Ctrl+Shift+End - move the current page at
* the end
* * Ctrl+Tab - switch to the next page, with looping
* * Ctrl+Shift+Tab - switch to the previous
* page, with looping
* * Alt+1⋯9 - switch to pages 1-9
* * Alt+0 - switch to page 10
*
* These shortcuts are always available on `self,` this property is useful if
* they should be available globally.
*/
get shortcut_widget(): Gtk.Widget;
set shortcut_widget(val: Gtk.Widget);
/**
* Tab shortcut widget.
*
* Has the following shortcuts:
*
* * Ctrl+Page Up - switch to the previous page
* * Ctrl+Page Down - switch to the next page
* * Ctrl+Home - switch to the first page
* * Ctrl+End - switch to the last page
* * Ctrl+Shift+Page Up - move the current page
* backward
* * Ctrl+Shift+Page Down - move the current
* page forward
* * Ctrl+Shift+Home - move the current page at
* the start
* * Ctrl+Shift+End - move the current page at
* the end
* * Ctrl+Tab - switch to the next page, with looping
* * Ctrl+Shift+Tab - switch to the previous
* page, with looping
* * Alt+1⋯9 - switch to pages 1-9
* * Alt+0 - switch to page 10
*
* These shortcuts are always available on `self,` this property is useful if
* they should be available globally.
*/
get shortcutWidget(): Gtk.Widget;
set shortcutWidget(val: Gtk.Widget);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TabView;
// 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: 'close-page', callback: (_source: this, page: TabPage) => boolean): number;
connect_after(signal: 'close-page', callback: (_source: this, page: TabPage) => boolean): number;
emit(signal: 'close-page', page: TabPage): void;
connect(signal: 'create-window', callback: (_source: this) => TabView | null): number;
connect_after(signal: 'create-window', callback: (_source: this) => TabView | null): number;
emit(signal: 'create-window'): void;
connect(signal: 'indicator-activated', callback: (_source: this, page: TabPage) => void): number;
connect_after(signal: 'indicator-activated', callback: (_source: this, page: TabPage) => void): number;
emit(signal: 'indicator-activated', page: TabPage): void;
connect(
signal: 'page-attached',
callback: (_source: this, page: TabPage, position: number) => void,
): number;
connect_after(
signal: 'page-attached',
callback: (_source: this, page: TabPage, position: number) => void,
): number;
emit(signal: 'page-attached', page: TabPage, position: number): void;
connect(
signal: 'page-detached',
callback: (_source: this, page: TabPage, position: number) => void,
): number;
connect_after(
signal: 'page-detached',
callback: (_source: this, page: TabPage, position: number) => void,
): number;
emit(signal: 'page-detached', page: TabPage, position: number): void;
connect(
signal: 'page-reordered',
callback: (_source: this, page: TabPage, position: number) => void,
): number;
connect_after(
signal: 'page-reordered',
callback: (_source: this, page: TabPage, position: number) => void,
): number;
emit(signal: 'page-reordered', page: TabPage, position: number): void;
connect(signal: 'setup-menu', callback: (_source: this, page: TabPage) => void): number;
connect_after(signal: 'setup-menu', callback: (_source: this, page: TabPage) => void): number;
emit(signal: 'setup-menu', page: TabPage): void;
// Methods
/**
* Adds `child` to `self` with `parent` as the parent.
*
* This function can be used to automatically position new pages, and to select
* the correct page when this page is closed while being selected (see
* [method`TabView`.close_page].
*
* If `parent` is `NULL`, this function is equivalent to [method`TabView`.append].
* @param child a widget to add
* @param parent a parent page for @child
* @returns the page object representing @child
*/
add_page(child: Gtk.Widget, parent?: TabPage | null): TabPage;
/**
* Inserts `child` as the last non-pinned page.
* @param child a widget to add
* @returns the page object representing @child
*/
append(child: Gtk.Widget): TabPage;
/**
* Inserts `child` as the last pinned page.
* @param child a widget to add
* @returns the page object representing @child
*/
append_pinned(child: Gtk.Widget): TabPage;
/**
* Requests to close all pages other than `page`.
* @param page a page of @self
*/
close_other_pages(page: TabPage): void;
/**
* Requests to close `page`.
*
* Calling this function will result in [signal`TabView:`:close-page] signal
* being emitted for `page`. Closing the page can then be confirmed or denied via
* [method`TabView`.close_page_finish].
*
* If the page is waiting for a [method`TabView`.close_page_finish] call, this
* function will do nothing.
*
* The default handler for [signal`TabView:`:close-page] will immediately confirm
* closing the page if it's non-pinned, or reject it if it's pinned. This
* behavior can be changed by registering your own handler for that signal.
*
* If `page` was selected, another page will be selected instead:
*
* If the [property`TabPage:`parent] value is `NULL`, the next page will be
* selected when possible, or if the page was already last, the previous page
* will be selected instead.
*
* If it's not `NULL`, the previous page will be selected if it's a descendant
* (possibly indirect) of the parent. If both the previous page and the parent
* are pinned, the parent will be selected instead.
* @param page a page of @self
*/
close_page(page: TabPage): void;
/**
* Completes a [method`TabView`.close_page] call for `page`.
*
* If `confirm` is `TRUE`, `page` will be closed. If it's `FALSE`, ite will be
* reverted to its previous state and [method`TabView`.close_page] can be called
* for it again.
*
* This function should not be called unless a custom handler for
* [signal`TabView:`:close-page] is used.
* @param page a page of @self
* @param confirm whether to confirm or deny closing @page
*/
close_page_finish(page: TabPage, confirm: boolean): void;
/**
* Requests to close all pages after `page`.
* @param page a page of @self
*/
close_pages_after(page: TabPage): void;
/**
* Requests to close all pages before `page`.
* @param page a page of @self
*/
close_pages_before(page: TabPage): void;
/**
* Gets default icon of `self`.
* @returns the default icon of @self
*/
get_default_icon(): Gio.Icon;
/**
* Whether a page is being transferred.
*
* Gets the value of [property`TabView:`is-transferring-page] property.
* @returns whether a page is being transferred
*/
get_is_transferring_page(): boolean;
/**
* Gets the tab context menu model for `self`.
* @returns the tab context menu model for @self
*/
get_menu_model(): Gio.MenuModel | null;
/**
* Gets the number of pages in `self`.
* @returns the number of pages in @self
*/
get_n_pages(): number;
/**
* Gets the number of pinned pages in `self`.
*
* See [method`TabView`.set_page_pinned].
* @returns the number of pinned pages in @self
*/
get_n_pinned_pages(): number;
/**
* Gets the [class`TabPage]` representing the child at `position`.
* @param position the index of the page in @self, starting from 0
* @returns the page object at @position
*/
get_nth_page(position: number): TabPage;
/**
* Gets the [class`TabPage]` object representing `child`.
* @param child a child in @self
* @returns the [class@TabPage] representing @child
*/
get_page(child: Gtk.Widget): TabPage;
/**
* Finds the position of `page` in `self,` starting from 0.
* @param page a page of @self
* @returns the position of @page in @self
*/
get_page_position(page: TabPage): number;
/**
* Returns a [iface`Gio`.ListModel] containing the pages of `self`.
*
* This model can be used to keep an up to date view of the pages.
* @returns the model containing pages of @self
*/
get_pages(): Gio.ListModel;
/**
* Gets the currently selected page in `self`.
* @returns the selected page in @self
*/
get_selected_page(): TabPage | null;
/**
* Gets the shortcut widget for `self`.
* @returns the shortcut widget for @self
*/
get_shortcut_widget(): Gtk.Widget | null;
/**
* Inserts a non-pinned page at `position`.
*
* It's an error to try to insert a page before a pinned page, in that case
* [method`TabView`.insert_pinned] should be used instead.
* @param child a widget to add
* @param position the position to add @child at, starting from 0
* @returns the page object representing @child
*/
insert(child: Gtk.Widget, position: number): TabPage;
/**
* Inserts a pinned page at `position`.
*
* It's an error to try to insert a pinned page after a non-pinned page, in that
* case [method`TabView`.insert] should be used instead.
* @param child a widget to add
* @param position the position to add @child at, starting from 0
* @returns the page object representing @child
*/
insert_pinned(child: Gtk.Widget, position: number): TabPage;
/**
* Inserts `child` as the first non-pinned page.
* @param child a widget to add
* @returns the page object representing @child
*/
prepend(child: Gtk.Widget): TabPage;
/**
* Inserts `child` as the first pinned page.
* @param child a widget to add
* @returns the page object representing @child
*/
prepend_pinned(child: Gtk.Widget): TabPage;
/**
* Reorders `page` to before its previous page if possible.
* @param page a page of @self
* @returns whether @page was moved
*/
reorder_backward(page: TabPage): boolean;
/**
* Reorders `page` to the first possible position.
* @param page a page of @self
* @returns whether @page was moved
*/
reorder_first(page: TabPage): boolean;
/**
* Reorders `page` to after its next page if possible.
* @param page a page of @self
* @returns whether @page was moved
*/
reorder_forward(page: TabPage): boolean;
/**
* Reorders `page` to the last possible position.
* @param page a page of @self
* @returns whether @page was moved
*/
reorder_last(page: TabPage): boolean;
/**
* Reorders `page` to `position`.
*
* It's a programmer error to try to reorder a pinned page after a non-pinned
* one, or a non-pinned page before a pinned one.
* @param page a page of @self
* @param position the position to insert the page at, starting at 0
* @returns whether @page was moved
*/
reorder_page(page: TabPage, position: number): boolean;
/**
* Selects the page after the currently selected page.
*
* If the last page was already selected, this function does nothing.
* @returns whether the selected page was changed
*/
select_next_page(): boolean;
/**
* Selects the page before the currently selected page.
*
* If the first page was already selected, this function does nothing.
* @returns whether the selected page was changed
*/
select_previous_page(): boolean;
/**
* Sets default page icon for `self`.
*
* If a page doesn't provide its own icon via [property`TabPage:`icon], default
* icon may be used instead for contexts where having an icon is necessary.
*
* [class`TabBar]` will use default icon for pinned tabs in case the page is not
* loading, doesn't have an icon and an indicator. Default icon is never used
* for tabs that aren't pinned.
*
* By default, `hdy-tab-icon-missing-symbolic` icon is used.
* @param default_icon the default icon
*/
set_default_icon(default_icon: Gio.Icon): void;
/**
* Sets the tab context menu model for `self`.
*
* When a context menu is shown for a tab, it will be constructed from the
* provided menu model. Use [signal`TabView:`:setup-menu] signal to set up the
* menu actions for the particular tab.
* @param menu_model a menu model
*/
set_menu_model(menu_model?: Gio.MenuModel | null): void;
/**
* Pins or unpins `page`.
*
* Pinned pages are guaranteed to be placed before all non-pinned pages; at any
* given moment the first [property`TabView:`n-pinned-pages] pages in `self` are
* guaranteed to be pinned.
*
* When a page is pinned or unpinned, it's automatically reordered: pinning a
* page moves it after other pinned pages; unpinning a page moves it before
* other non-pinned pages.
*
* Pinned pages can still be reordered between each other.
*
* [class`TabBar]` will display pinned pages in a compact form, never showing the
* title or close button, and only showing a single icon, selected in the
* following order:
*
* 1. [property`TabPage:`indicator-icon]
* 2. A spinner if [property`TabPage:`loading] is `TRUE`
* 3. [property`TabPage:`icon]
* 4. [property`TabView:`default-icon]
*
* Pinned pages cannot be closed by default, see [signal`TabView:`:close-page]
* for how to override that behavior.
* @param page a page of @self
* @param pinned whether @page should be pinned
*/
set_page_pinned(page: TabPage, pinned: boolean): void;
/**
* Sets the currently selected page in `self`.
* @param selected_page a page in @self
*/
set_selected_page(selected_page: TabPage): void;
/**
* Sets the shortcut widget for `self`.
* @param widget a shortcut widget
*/
set_shortcut_widget(widget?: Gtk.Widget | null): void;
/**
* Transfers `page` from `self` to `other_view`.
*
* The `page` object will be reused.
*
* It's a programmer error to try to insert a pinned page after a non-pinned
* one, or a non-pinned page before a pinned one.
* @param page a page of @self
* @param other_view the tab view to transfer the page to
* @param position the position to insert the page at, starting at 0
*/
transfer_page(page: TabPage, other_view: TabView, position: 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 TitleBar {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
selection_mode: boolean;
selectionMode: boolean;
}
}
/**
* A simple title bar container.
*
* `HdyTitleBar` is meant to be used as the top-level widget of your window's
* title bar. It will be drawn with the same style as a [class`Gtk`.HeaderBar]
* but it won't force a widget layout on you: you can put whatever widget you
* want in it, including a [class`Gtk`.HeaderBar].
*
* `HdyTitleBar` becomes really useful when you want to animate header bars,
* like an adaptive application using [class`Leaflet]` would do.
*
* `HdyTitleBar` has been deprecated, header bars can be animated without it
* when placed inside [class`Window]` or [class`ApplicationWindow]`.
*
* ## CSS nodes
*
* `HdyTitleBar` has a single CSS node with name `headerbar`.
*/
class TitleBar extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* Whether or not the title bar is in selection mode.
*/
get selection_mode(): boolean;
set selection_mode(val: boolean);
/**
* Whether or not the title bar is in selection mode.
*/
get selectionMode(): boolean;
set selectionMode(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TitleBar;
// Methods
/**
* Returns whether whether `self` is in selection mode.
* @returns `TRUE` if the title bar is in selection mode
*/
get_selection_mode(): boolean;
/**
* Sets whether `self` is in selection mode.
* @param selection_mode `TRUE` to enable the selection mode
*/
set_selection_mode(selection_mode: 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 ValueObject {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
value: GObject.Value;
}
}
/**
* An object representing a [struct`GObject`.Value].
*
* The `HdyValueObject` object represents a [struct`GObject`.Value], allowing it
* to be used with [iface`Gio`.ListModel].
*/
class ValueObject extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The contained value.
*/
get value(): GObject.Value;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](value: GObject.Value | any): ValueObject;
// Methods
/**
* Copy data from the contained [struct`GObject`.Value] into `dest`.
* @param dest value with correct type to copy into
*/
copy_value(dest: GObject.Value | any): void;
/**
* Gets a copy of the contained string if the value is of type `G_TYPE_STRING`.
* @returns a copy of the contained string
*/
dup_string(): string;
/**
* Returns the contained string if the value is of type `G_TYPE_STRING`.
* @returns the contained string
*/
get_string(): string;
/**
* Return the contained value.
* @returns the contained [struct@GObject.Value]
*/
get_value(): unknown;
}
namespace ViewSwitcher {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
narrow_ellipsize: Pango.EllipsizeMode;
narrowEllipsize: Pango.EllipsizeMode;
policy: ViewSwitcherPolicy;
stack: Gtk.Stack;
}
}
/**
* An adaptive view switcher.
*
* An adaptive view switcher, designed to switch between multiple views in a
* similar fashion than a [class`Gtk`.StackSwitcher].
*
* Depending on the available width, the view switcher can adapt from a wide
* mode showing the view's icon and title side by side, to a narrow mode showing
* the view's icon and title one on top of the other, in a more compact way.
* This can be controlled via the policy property.
*
* To look good in a header bar, an `HdyViewSwitcher` requires to fill its full
* height. Contrary to [class`Gtk`.HeaderBar], [class`HeaderBar]` doesn't force a
* vertical alignment on its title widget, so we recommend it over
* [class`Gtk`.HeaderBar].
*
* ## CSS nodes
*
* `HdyViewSwitcher` has a single CSS node with name `viewswitcher`.
*/
class ViewSwitcher extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The preferred place to ellipsize the string.
*
* If the narrow mode label does not have enough room to display the entire
* string, specified as a [enum`Pango`.EllipsizeMode].
*
* Note that setting this property to a value other than
* `PANGO_ELLIPSIZE_NONE` has the side-effect that the label requests only
* enough space to display the ellipsis.
*/
get narrow_ellipsize(): Pango.EllipsizeMode;
set narrow_ellipsize(val: Pango.EllipsizeMode);
/**
* The preferred place to ellipsize the string.
*
* If the narrow mode label does not have enough room to display the entire
* string, specified as a [enum`Pango`.EllipsizeMode].
*
* Note that setting this property to a value other than
* `PANGO_ELLIPSIZE_NONE` has the side-effect that the label requests only
* enough space to display the ellipsis.
*/
get narrowEllipsize(): Pango.EllipsizeMode;
set narrowEllipsize(val: Pango.EllipsizeMode);
/**
* The policy to determine which mode to use.
*/
get policy(): ViewSwitcherPolicy;
set policy(val: ViewSwitcherPolicy);
/**
* The [class`Gtk`.Stack] the view switcher controls.
*/
get stack(): Gtk.Stack;
set stack(val: Gtk.Stack);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ViewSwitcher;
// Methods
/**
* Get the ellipsizing position of the narrow mode label.
* @returns a [enum@Pango.EllipsizeMode]
*/
get_narrow_ellipsize(): Pango.EllipsizeMode;
/**
* Gets the policy of `self`.
* @returns the policy of @self
*/
get_policy(): ViewSwitcherPolicy;
/**
* Gets the stack controlled by `self`.
* @returns the stack
*/
get_stack(): Gtk.Stack | null;
/**
* Sets the mode used to ellipsize the text in narrow mode.
* @param mode a [enum@Pango.EllipsizeMode]
*/
set_narrow_ellipsize(mode: Pango.EllipsizeMode | null): void;
/**
* Sets the policy of `self`.
* @param policy the new policy
*/
set_policy(policy: ViewSwitcherPolicy | null): void;
/**
* Sets the [class`Gtk`.Stack] to control.
* @param stack a stack
*/
set_stack(stack?: Gtk.Stack | 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 ViewSwitcherBar {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
policy: ViewSwitcherPolicy;
reveal: boolean;
stack: Gtk.Stack;
}
}
/**
* A view switcher action bar.
*
* An action bar letting you switch between multiple views offered by a
* [class`Gtk`.Stack], via an [class`ViewSwitcher]`. It is designed to be put at
* the bottom of a window and to be revealed only on really narrow windows e.g.
* on mobile phones. It can't be revealed if there are less than two pages.
*
* `HdyViewSwitcherBar` is intended to be used together with
* [class`ViewSwitcherTitle]`.
*
* A common use case is to bind the [property`ViewSwitcherBar:`reveal] property
* to [property`ViewSwitcherTitle:`title-visible] to automatically reveal the
* view switcher bar when the title label is displayed in place of the view
* switcher, as follows:
*
* ```xml
*
*
*
*
*
*
*
*
* ```
*
* ## CSS nodes
*
* `HdyViewSwitcherBar` has a single CSS node with name `viewswitcherbar`.
*/
class ViewSwitcherBar extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The policy used to determine which mode to use.
*/
get policy(): ViewSwitcherPolicy;
set policy(val: ViewSwitcherPolicy);
/**
* Whether the bar should be revealed or hidden.
*/
get reveal(): boolean;
set reveal(val: boolean);
/**
* The [class`Gtk`.Stack] the [class`ViewSwitcher]` controls.
*/
get stack(): Gtk.Stack;
set stack(val: Gtk.Stack);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ViewSwitcherBar;
// Methods
/**
* Gets the policy of `self`.
* @returns the policy of @self
*/
get_policy(): ViewSwitcherPolicy;
/**
* Gets whether `self` should be revealed or hidden.
* @returns whether @self is revealed
*/
get_reveal(): boolean;
/**
* Get the [class`Gtk`.Stack] being controlled by the [class`ViewSwitcher]`.
* @returns the stack
*/
get_stack(): Gtk.Stack | null;
/**
* Sets the policy of `self`.
* @param policy the new policy
*/
set_policy(policy: ViewSwitcherPolicy | null): void;
/**
* Sets whether `self` should be revealed or not.
* @param reveal `TRUE` to reveal @self
*/
set_reveal(reveal: boolean): void;
/**
* Sets the [class`Gtk`.Stack] to control.
* @param stack a stack
*/
set_stack(stack?: Gtk.Stack | 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 ViewSwitcherTitle {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
policy: ViewSwitcherPolicy;
stack: Gtk.Stack;
subtitle: string;
title: string;
title_visible: boolean;
titleVisible: boolean;
view_switcher_enabled: boolean;
viewSwitcherEnabled: boolean;
}
}
/**
* A view switcher title.
*
* A widget letting you switch between multiple views contained by a
* [class`Gtk`.Stack], via an [class`ViewSwitcher]`.
*
* It is designed to be used as the title widget of a [class`HeaderBar]`, and
* will display the window's title when the window is too narrow to fit the view
* switcher e.g. on mobile phones, or if there are less than two views.
*
* `HdyViewSwitcherTitle` is intended to be used together with
* [class`ViewSwitcherBar]`.
*
* A common use case is to bind the [property`ViewSwitcherBar:`reveal] property
* to [property`ViewSwitcherTitle:`title-visible] to automatically reveal the
* view switcher bar when the title label is displayed in place of the view
* switcher, as follows:
*
* ```xml
*
*
*
*
*
*
*
*
*
*
*
* stack
*
*
*
*
*
*
* ```
*
* ## CSS nodes
*
* `HdyViewSwitcherTitle` has a single CSS node with name `viewswitchertitle`.
*/
class ViewSwitcherTitle extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Properties
/**
* The policy used to determine which mode to use.
*/
get policy(): ViewSwitcherPolicy;
set policy(val: ViewSwitcherPolicy);
/**
* The [class`Gtk`.Stack] the [class`ViewSwitcher]` controls.
*/
get stack(): Gtk.Stack;
set stack(val: Gtk.Stack);
/**
* The subtitle of the [class`ViewSwitcher]`.
*
* The subtitle should give a user additional details.
*/
get subtitle(): string;
set subtitle(val: string);
/**
* The title of the [class`ViewSwitcher]`.
*
* The title should give a user additional details. A good title should not
* include the application name.
*/
get title(): string;
set title(val: string);
/**
* Whether the bar should be revealed or hidden.
*/
get title_visible(): boolean;
/**
* Whether the bar should be revealed or hidden.
*/
get titleVisible(): boolean;
/**
* Whether the bar should be revealed or hidden.
*
* If it is disabled, the title will be displayed instead. This allows to
* programmatically hide the view switcher even if it fits in the available
* space.
*
* This can be used e.g. to ensure the view switcher is hidden below a certain
* window width, or any other constraint you find suitable.
*/
get view_switcher_enabled(): boolean;
set view_switcher_enabled(val: boolean);
/**
* Whether the bar should be revealed or hidden.
*
* If it is disabled, the title will be displayed instead. This allows to
* programmatically hide the view switcher even if it fits in the available
* space.
*
* This can be used e.g. to ensure the view switcher is hidden below a certain
* window width, or any other constraint you find suitable.
*/
get viewSwitcherEnabled(): boolean;
set viewSwitcherEnabled(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ViewSwitcherTitle;
// Methods
/**
* Gets the policy of `self`.
* @returns the policy of @self
*/
get_policy(): ViewSwitcherPolicy;
/**
* Gets the stack controlled by `self`.
* @returns the stack
*/
get_stack(): Gtk.Stack | null;
/**
* Gets the subtitle of `self`.
* @returns the subtitle of @self
*/
get_subtitle(): string | null;
/**
* Gets the title of `self`.
* @returns the title of @self
*/
get_title(): string | null;
/**
* Gets whether the title of `self` is currently visible.
* @returns whether the title of @self is currently visible
*/
get_title_visible(): boolean;
/**
* Gets whether `self'`s view switcher is enabled.
* @returns whether the view switcher is enabled
*/
get_view_switcher_enabled(): boolean;
/**
* Sets the policy of `self`.
* @param policy the new policy
*/
set_policy(policy: ViewSwitcherPolicy | null): void;
/**
* Sets the [class`Gtk`.Stack] to control.
* @param stack a stack
*/
set_stack(stack?: Gtk.Stack | null): void;
/**
* Sets the subtitle of `self`.
* @param subtitle a subtitle
*/
set_subtitle(subtitle?: string | null): void;
/**
* Sets the title of `self`.
* @param title a title
*/
set_title(title?: string | null): void;
/**
* Sets whether `self'`s view switcher is enabled.
* @param enabled `TRUE` to enable the view switcher, `FALSE` to disable it
*/
set_view_switcher_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 Window {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Window.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
/**
* A freeform window.
*
* The `HdyWindow` widget is a subclass of [class`Gtk`.Window] which has no
* titlebar area and provides rounded corners on all sides, ensuring they can
* never be overlapped by the content. This makes it safe to use headerbars in
* the content area as follows:
*
* ```xml
*
*
*
* True
* vertical
*
*
*
*
*
*
*
*
*
* ```
*
* It's recommended to use [class`HeaderBar]` with `HdyWindow`, as unlike
* [class`Gtk`.HeaderBar] it remains draggable inside the window. Otherwise,
* [class`WindowHandle]` can be used.
*
* `HdyWindow` allows to easily implement titlebar autohiding by putting the
* headerbar inside a [class`Gtk`.Revealer], and to show titlebar above content
* by putting it into a [class`Gtk`.Overlay] instead of [class`Gtk`.Box].
*
* If the window has a [class`Gtk`.GLArea], it may bring a slight performance
* regression when the window is not fullscreen, tiled or maximized.
*
* Using [method`Gtk`.Window.get_titlebar] and [method`Gtk`.Window.set_titlebar]
* is not supported and will result in a crash.
*
* ## CSS nodes
*
* `HdyWindow` has a main CSS node with the name `window` and style classes
* `.background`, `.csd` and `.unified`.
*
* The `.solid-csd` style class on the main node is used for client-side
* decorations without invisible borders.
*
* `HdyWindow` also represents window states with the following style classes on
* the main node: `.tiled`, `.maximized`, `.fullscreen`.
*
* It contains the subnodes decoration for window shadow and/or border,
* decoration-overlay for the sheen on top of the window, `widget.titlebar`, and
* deck, which contains the child inside the window.
*/
class Window extends Gtk.Window implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): 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;
}
namespace WindowHandle {
// Constructor properties interface
interface ConstructorProps
extends Gtk.EventBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {}
}
/**
* A bin that acts like a titlebar.
*
* `HdyWindowHandle` is a [class`Gtk`.Bin] subclass that can be dragged to move
* its [class`Gtk`.Window], and handles right click, middle click and double
* click as expected from a titlebar. This is particularly useful with
* [class`Window]` or [class`ApplicationWindow]`.
*
* It isn't necessary to use `HdyWindowHandle` if you use [class`HeaderBar]`.
*
* It can be safely nested or used in the actual window titlebar.
*
* ## CSS nodes
*
* `HdyWindowHandle` has a single CSS node with name `windowhandle`.
*/
class WindowHandle extends Gtk.EventBox implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): WindowHandle;
// 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 ActionRowClass = typeof ActionRow;
type ApplicationWindowClass = typeof ApplicationWindow;
type AvatarClass = typeof Avatar;
type CarouselClass = typeof Carousel;
type CarouselIndicatorDotsClass = typeof CarouselIndicatorDots;
type CarouselIndicatorLinesClass = typeof CarouselIndicatorLines;
type ClampClass = typeof Clamp;
type ComboRowClass = typeof ComboRow;
type DeckClass = typeof Deck;
type EnumValueObjectClass = typeof EnumValueObject;
type ExpanderRowClass = typeof ExpanderRow;
type FlapClass = typeof Flap;
type HeaderBarClass = typeof HeaderBar;
type HeaderGroupChildClass = typeof HeaderGroupChild;
type HeaderGroupClass = typeof HeaderGroup;
type KeypadClass = typeof Keypad;
type LeafletClass = typeof Leaflet;
type PreferencesGroupClass = typeof PreferencesGroup;
type PreferencesPageClass = typeof PreferencesPage;
type PreferencesRowClass = typeof PreferencesRow;
type PreferencesWindowClass = typeof PreferencesWindow;
type SearchBarClass = typeof SearchBar;
type SqueezerClass = typeof Squeezer;
type StatusPageClass = typeof StatusPage;
type StyleManagerClass = typeof StyleManager;
type SwipeGroupClass = typeof SwipeGroup;
type SwipeTrackerClass = typeof SwipeTracker;
type SwipeableInterface = typeof Swipeable;
type TabBarClass = typeof TabBar;
type TabPageClass = typeof TabPage;
type TabViewClass = typeof TabView;
type TitleBarClass = typeof TitleBar;
type ValueObjectClass = typeof ValueObject;
type ViewSwitcherBarClass = typeof ViewSwitcherBar;
type ViewSwitcherClass = typeof ViewSwitcher;
type ViewSwitcherTitleClass = typeof ViewSwitcherTitle;
type WindowClass = typeof Window;
type WindowHandleClass = typeof WindowHandle;
namespace Swipeable {
// Constructor properties interface
interface ConstructorProps extends Gtk.Widget.ConstructorProps {}
}
export interface SwipeableNamespace {
$gtype: GObject.GType;
prototype: Swipeable;
}
interface Swipeable extends Gtk.Widget {
// Methods
/**
* Emits [signal`Swipeable:`:child-switched] signal.
*
* This should be called when the widget switches visible child widget.
*
* `duration` can be 0 if the child is switched without animation.
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
emit_child_switched(index: number, duration: number): void;
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
* @returns the cancel progress, unitless
*/
get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
* @returns the swipe distance in pixels
*/
get_distance(): number;
/**
* Gets the current progress of `self`.
* @returns the current progress, unitless
*/
get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
* @returns the snap points
*/
get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
get_swipe_area(navigation_direction: NavigationDirection | null, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
* @returns the swipe tracker
*/
get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
switch_child(index: number, duration: number): void;
// Virtual methods
/**
* Gets the progress `self` will snap back to after the gesture is canceled.
*/
vfunc_get_cancel_progress(): number;
/**
* Gets the swipe distance of `self`.
*
* This corresponds to how many pixels 1 unit represents.
*/
vfunc_get_distance(): number;
/**
* Gets the current progress of `self`.
*/
vfunc_get_progress(): number;
/**
* Gets the snap points of `self`.
*
* Each snap point represents a progress value that is considered acceptable to
* end the swipe on.
*/
vfunc_get_snap_points(): number[];
/**
* Gets the area `self` can start a swipe from for the given direction and
* gesture type.
*
* This can be used to restrict swipes to only be possible from a certain area,
* for example, to only allow edge swipes, or to have a draggable element and
* ignore swipes elsewhere.
*
* Swipe area is only considered for direct swipes (as in, not initiated by
* [class`SwipeGroup]`).
*
* If not implemented, the default implementation returns the allocation of
* `self,` allowing swipes from anywhere.
* @param navigation_direction the direction of the swipe
* @param is_drag whether the swipe is caused by a dragging gesture
*/
vfunc_get_swipe_area(navigation_direction: NavigationDirection, is_drag: boolean): Gdk.Rectangle;
/**
* Gets the [class`SwipeTracker]` used by this swipeable widget.
*/
vfunc_get_swipe_tracker(): SwipeTracker;
/**
* Switches to child with index `index`.
*
* See [signal`Swipeable:`:child-switched].
* @param index the index of the child to switch to
* @param duration animation duration, in milliseconds
*/
vfunc_switch_child(index: number, duration: number): void;
}
export const Swipeable: SwipeableNamespace & {
new (): Swipeable; // This allows `obj instanceof Swipeable`
};
/**
* 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 Handy;
}
declare module 'gi://Handy' {
import Handy1 from 'gi://Handy?version=1';
export default Handy1;
}
// END